CARLA
 
载入中...
搜索中...
未找到
Float32PubSubTypes.h
浏览该文件的文档.
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*!
16 * @file Float32PubSubTypes.h
17 * This header file contains the declaration of the serialization functions.
18 *
19 * This file was generated by the tool fastcdrgen.
20 */
21
22#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_
23#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_
24
25#include <fastdds/dds/topic/TopicDataType.hpp>
26#include <fastrtps/utils/md5.h>
27
28#include "Float32.h"
29
30#if !defined(GEN_API_VER) || (GEN_API_VER != 1)
31#error \
32 Generated Float32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
33#endif // GEN_API_VER
34
35namespace std_msgs
36{
37 namespace msg
38 {
39 #ifndef SWIG
40 namespace detail {
41 template<typename Tag, typename Tag::type M>
43 {
44 friend constexpr typename Tag::type get(
45 Tag)
46 {
47 return M;
48 }
49 };
50
51 struct Float32_f
52 {
53 typedef float Float32::* type;
54 friend constexpr type get(
55 Float32_f);
56 };
57
59
60 template <typename T, typename Tag>
61 inline size_t constexpr Float32_offset_of() {
62 return ((::size_t) &reinterpret_cast<char const volatile&>((((T*)0)->*get(Tag()))));
63 }
64 }
65 #endif
66
67 /*!
68 * @brief This class represents the TopicDataType of the type Float32 defined by the user in the IDL file.
69 * @ingroup FLOAT32
70 */
71 class Float32PubSubType : public eprosima::fastdds::dds::TopicDataType
72 {
73 public:
74
75 typedef Float32 type;
76
78
80
81 eProsima_user_DllExport virtual bool serialize(
82 void* data,
83 eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;
84
85 eProsima_user_DllExport virtual bool deserialize(
86 eprosima::fastrtps::rtps::SerializedPayload_t* payload,
87 void* data) override;
88
89 eProsima_user_DllExport virtual std::function<uint32_t()> getSerializedSizeProvider(
90 void* data) override;
91
92 eProsima_user_DllExport virtual bool getKey(
93 void* data,
94 eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
95 bool force_md5 = false) override;
96
97 eProsima_user_DllExport virtual void* createData() override;
98
99 eProsima_user_DllExport virtual void deleteData(
100 void* data) override;
101
102 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
103 eProsima_user_DllExport inline bool is_bounded() const override
104 {
105 return true;
106 }
107
108 #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
109
110 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
111 eProsima_user_DllExport inline bool is_plain() const override
112 {
113 return is_plain_impl();
114 }
115
116 #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
117
118 #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
119 eProsima_user_DllExport inline bool construct_sample(
120 void* memory) const override
121 {
122 new (memory) Float32();
123 return true;
124 }
125
126 #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
127 MD5 m_md5;
128 unsigned char* m_keyBuffer;
129
130 private:
131 static constexpr bool is_plain_impl()
132 {
133 return 4ULL == (detail::Float32_offset_of<Float32, detail::Float32_f>() + sizeof(float));
134
135 }};
136 }
137}
138
139#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_
#define eProsima_user_DllExport
Definition CameraInfo.h:44
This class represents the TopicDataType of the type Float32 defined by the user in the IDL file.
static constexpr bool is_plain_impl()
This class represents the structure Float32 defined by the user in the IDL file.
Definition Float32.h:71
size_t constexpr Float32_offset_of()
friend constexpr type get(Float32_f)
friend constexpr Tag::type get(Tag)