CARLA
 
载入中...
搜索中...
未找到
TwistWithCovariancePubSubTypes.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 TwistWithCovariancePubSubTypes.h
17 * 此头文件包含序列化函数的声明。
18 *
19 * 此文件是由工具 fastcdrgen 生成的。
20 */
21
22#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_
23#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_
24
25#include <fastdds/dds/topic/TopicDataType.hpp>
26#include <fastrtps/utils/md5.h>
27
28#include "TwistWithCovariance.h"
29#include "TwistPubSubTypes.h"
30// 检查生成的 API 版本是否与当前安装的 Fast DDS 兼容
31#if !defined(GEN_API_VER) || (GEN_API_VER != 1)
32#error \
33 生成的 TwistWithCovariance 与当前安装的 Fast DDS 不兼容。请使用 fastddsgen 重新生成它。
34#endif // GEN_API_VER
35
36namespace geometry_msgs
37{
38 namespace msg
39 {
40 typedef std::array<double, 36> geometry_msgs__TwistWithCovariance__double_array_36;// 定义一个包含 36 个 double 的数组类型
41
42 #ifndef SWIG
43 namespace detail {
44// 模板结构,用于获取 m_covariance 的偏移量
45 template<typename Tag, typename Tag::type M>
47 {
48 friend constexpr typename Tag::type get(
49 Tag)
50 {
51 return M;
52 }
53 };
54
61// 实例化模板以获取 m_covariance 的偏移量
63// 获取偏移量的辅助函数
64 template <typename T, typename Tag>
65 inline size_t constexpr TwistWithCovariance_offset_of() {
66 return ((::size_t) &reinterpret_cast<char const volatile&>((((T*)0)->*get(Tag()))));
67 }
68 }
69 #endif
70
71 /*!
72 * @brief 此类表示用户在 IDL 文件中定义的 TwistWithCovariance 的 TopicDataType。
73 * @ingroup TWISTWITHCOVARIANCE
74 */
75 class TwistWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType
76 {
77 public:
78
79 typedef TwistWithCovariance type;// 定义类型别名
80
82
83 eProsima_user_DllExport virtual ~TwistWithCovariancePubSubType() override;// 析构函数
84
85 eProsima_user_DllExport virtual bool serialize(
86 void* data,
87 eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;// 序列化函数
88
89 eProsima_user_DllExport virtual bool deserialize(
90 eprosima::fastrtps::rtps::SerializedPayload_t* payload,
91 void* data) override;// 反序列化函数
92
93 eProsima_user_DllExport virtual std::function<uint32_t()> getSerializedSizeProvider(
94 void* data) override;// 获取序列化大小的函数
95
96 eProsima_user_DllExport virtual bool getKey(
97 void* data,
98 eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
99 bool force_md5 = false) override;// 获取键的函数
100
101 eProsima_user_DllExport virtual void* createData() override;// 创建数据的函数
102
103 eProsima_user_DllExport virtual void deleteData(
104 void* data) override;// 删除数据的函数
105
106 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
107 eProsima_user_DllExport inline bool is_bounded() const override
108 {
109 return true;// 判断是否有界
110 }
111
112 #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
113
114 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
115 eProsima_user_DllExport inline bool is_plain() const override
116 {
117 return is_plain_impl();// 判断是否为平面类型
118 }
119
120 #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
121
122 #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
123 eProsima_user_DllExport inline bool construct_sample(
124 void* memory) const override
125 {
126 new (memory) TwistWithCovariance();// 在内存中构造样本
127 return true;
128 }
129
130 #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
131 MD5 m_md5;// MD5 哈希值
132 unsigned char* m_keyBuffer;// 键缓冲区
133 private:// 判断是否为平面类型的实现
134 static constexpr bool is_plain_impl()
135 {
136 return 336ULL == (detail::TwistWithCovariance_offset_of<TwistWithCovariance, detail::TwistWithCovariance_f>() + sizeof(geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36));
137
138 }};
139 }
140}
141
142#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_
#define eProsima_user_DllExport
Definition CameraInfo.h:44
Traits::size_t size_t
此类表示用户在 IDL 文件中定义的 TwistWithCovariance 的 TopicDataType。 <>
此类表示用户在 IDL 文件中定义的 TwistWithCovariance 结构。 <>
std::array< double, 36 > geometry_msgs__TwistWithCovariance__double_array_36
geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 TwistWithCovariance::* type
friend constexpr type get(TwistWithCovariance_f)