CARLA
 
载入中...
搜索中...
未找到
RegionOfInterestPubSubTypes.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 RegionOfInterestPubSubTypes.h
17 * 此头文件包含序列化函数的声明。
18 *
19 * 此文件是由工具 fastcdrgen 生成的。
20 */
21
22#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_// 防止重复包含
23#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_
24
25#include <fastdds/dds/topic/TopicDataType.hpp>// 引入 Fast DDS 主题数据类型
26#include <fastrtps/utils/md5.h>// 引入 MD5 哈希支持
27
28#include "RegionOfInterest.h"// 引入 RegionOfInterest 结构的定义
29
30#if !defined(GEN_API_VER) || (GEN_API_VER != 1)// 确保与 Fast DDS 版本兼容
31#error \
32 Generated RegionOfInterest is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
33#endif // GEN_API_VER
34
35namespace sensor_msgs
36{
37 namespace msg
38 {
39
40 #ifndef SWIG
41 namespace detail {
42
43 template<typename Tag, typename Tag::type M>
45 {
46 friend constexpr typename Tag::type get(
47 Tag)
48 {
49 return M;
50 }
51 };
52
54 {
55 typedef bool RegionOfInterest::* type;// 定义 RegionOfInterest 中 bool 类型的成员
56 friend constexpr type get(
58 };
59
61
62 template <typename T, typename Tag>
63 inline size_t constexpr RegionOfInterest_offset_of() {
64 return ((::size_t) &reinterpret_cast<char const volatile&>((((T*)0)->*get(Tag()))));
65 }
66 }
67 #endif
68
69 /*!
70 * @brief 此类表示用户在 IDL 文件中定义的 RegionOfInterest 类型的 TopicDataType。
71 * @ingroup RegionOfInterest
72 */
73 class RegionOfInterestPubSubType : public eprosima::fastdds::dds::TopicDataType
74 {
75 public:
76
77 typedef RegionOfInterest type;// 定义类型别名
78
80
81 eProsima_user_DllExport virtual ~RegionOfInterestPubSubType() override;// 析构函数
82
83 eProsima_user_DllExport virtual bool serialize(
84 void* data,
85 eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;// 序列化函数
86
87 eProsima_user_DllExport virtual bool deserialize(
88 eprosima::fastrtps::rtps::SerializedPayload_t* payload,
89 void* data) override;// 反序列化函数
90
91 eProsima_user_DllExport virtual std::function<uint32_t()> getSerializedSizeProvider(
92 void* data) override;// 获取序列化大小的提供者
93
94 eProsima_user_DllExport virtual bool getKey(
95 void* data,
96 eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
97 bool force_md5 = false) override;// 获取键值
98
99 eProsima_user_DllExport virtual void* createData() override;// 创建数据
100
101 eProsima_user_DllExport virtual void deleteData(
102 void* data) override;// 删除数据
103
104 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
105 eProsima_user_DllExport inline bool is_bounded() const override
106 {
107 return true;// 返回是否是有界的
108 }
109
110 #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
111
112 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
113 eProsima_user_DllExport inline bool is_plain() const override
114 {
115 return is_plain_impl();// 返回是否是简单类型
116 }
117
118 #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
119
120 #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
121 eProsima_user_DllExport inline bool construct_sample(
122 void* memory) const override
123 {
124 new (memory) RegionOfInterest();// 在给定内存中构造样本
125 return true;
126 }
127
128 #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
129
130 MD5 m_md5;// MD5 哈希
131 unsigned char* m_keyBuffer;// 键缓冲区
132
133 private:
134
135 static constexpr bool is_plain_impl()
136 {
137 return 17ULL == (detail::RegionOfInterest_offset_of<RegionOfInterest, detail::RegionOfInterest_f>() + sizeof(bool));
138
139 }};
140 }
141}
142
143#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_
#define eProsima_user_DllExport
Definition CameraInfo.h:44
Traits::size_t size_t
此类表示用户在 IDL 文件中定义的 RegionOfInterest 类型的 TopicDataType。 <>
This class represents the structure RegionOfInterest defined by the user in the IDL file.
size_t constexpr RegionOfInterest_offset_of()
friend constexpr type get(RegionOfInterest_f)