CARLA
 
载入中...
搜索中...
未找到
TFMessagePubSubTypes.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 TFMessagePubSubTypes.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_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_
23#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_
24
25#include <fastdds/dds/topic/TopicDataType.hpp>
26#include <fastrtps/utils/md5.h>
27
28#include "TFMessage.h"
29
31
32#if !defined(GEN_API_VER) || (GEN_API_VER != 1)
33#error \
34 Generated TFMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
35#endif // GEN_API_VER
36
37namespace tf2_msgs
38{
39 namespace msg
40 {
41
42 /*!
43 * @brief This class represents the TopicDataType of the type TFMessage defined by the user in the IDL file.
44 * @ingroup TFMESSAGE
45 */
46 class TFMessagePubSubType : public eprosima::fastdds::dds::TopicDataType
47 {
48 public:
49// 定义一个类型别名,将TFMessage定义为此处相关类型的别名,方便后续代码中使用该类型时书写更简洁
50 typedef TFMessage type;
51 // 以动态链接库导出(eProsima_user_DllExport可能是自定义用于导出函数的宏,具体依赖对应库的定义)的方式声明TFMessagePubSubType函数,
52 // 通常用于和发布订阅相关的类型操作(具体功能要看函数实现,大概率是返回TFMessage对应的发布订阅类型相关信息等)
54// 以动态链接库导出的方式声明虚析构函数,用于在对象销毁时进行必要的清理操作,
55 // override关键字表示这个析构函数是重写了基类中的虚析构函数(确保多态销毁时行为正确)
57// 以动态链接库导出的方式声明序列化函数,该函数用于将给定的数据(通常是自定义类型的数据对象,这里对应void* data指向的数据)
58 // 转换为可用于网络传输等用途的序列化形式,并存储到SerializedPayload_t类型的结构中,
59 // override关键字表示重写了基类中对应的虚函数
61 void* data,
62 eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;
63// 以动态链接库导出的方式声明反序列化函数,用于将接收到的序列化数据(SerializedPayload_t类型)
64 // 转换回原始的数据形式(存储到void* data指向的内存空间),override表示重写基类虚函数
66 eprosima::fastrtps::rtps::SerializedPayload_t* payload,
67 void* data) override;
68// 以动态链接库导出的方式声明一个函数,该函数返回一个std::function类型对象,
69 // 这个对象实际上是一个可调用的函数,其返回值类型为uint32_t,用于获取给定数据(void* data指向的数据)序列化后的大小,
70 // override表示重写基类对应虚函数
71 eProsima_user_DllExport virtual std::function<uint32_t()> getSerializedSizeProvider(
72 void* data) override;
73// 以动态链接库导出的方式声明获取键值的函数,尝试从给定的数据(void* data指向的数据)中获取一个唯一标识此数据的键,
74 // 存储到InstanceHandle_t类型的结构中,用于在发布订阅等场景下进行对象的区分等操作,force_md5参数用于指定是否强制使用MD5相关机制(默认是false),
75 // override表示重写基类虚函数
77 void* data,
78 eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
79 bool force_md5 = false) override;
80 // 以动态链接库导出的方式声明创建数据的函数,用于创建对应类型(这里应该和TFMessage相关)的数据对象,
81 // 返回创建后的数据对象的指针(以void*类型返回,实际使用时可能需要进行类型转换),override表示重写基类虚函数
82 eProsima_user_DllExport virtual void* createData() override;
83 // 以动态链接库导出的方式声明删除数据的函数,用于释放由createData函数创建的数据对象所占用的内存资源,
84 // 参数data指向要删除的数据对象,override表示重写基类虚函数
86 void* data) override;
87
88 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
89 eProsima_user_DllExport inline bool is_bounded() const override
90 {
91 return false;
92 }
93
94 #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
95
96 #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
97 eProsima_user_DllExport inline bool is_plain() const override
98 {
99 return false;
100 }
101
102 #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
103
104 #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
105 eProsima_user_DllExport inline bool construct_sample(
106 void* memory) const override
107 {
108 (void)memory;
109 return false;
110 }
111
112 #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
113 MD5 m_md5;
114 unsigned char* m_keyBuffer;
115 };
116 }
117}
118
119#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_
#define eProsima_user_DllExport
Definition CameraInfo.h:44
This class represents the TopicDataType of the type TFMessage defined by the user in the IDL file.
eProsima_user_DllExport TFMessagePubSubType()
virtual eProsima_user_DllExport std::function< uint32_t()> getSerializedSizeProvider(void *data) override
virtual eProsima_user_DllExport bool serialize(void *data, eprosima::fastrtps::rtps::SerializedPayload_t *payload) override
virtual eProsima_user_DllExport bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t *payload, void *data) override
virtual eProsima_user_DllExport void deleteData(void *data) override
virtual eProsima_user_DllExport ~TFMessagePubSubType() override
virtual eProsima_user_DllExport void * createData() override
virtual eProsima_user_DllExport bool getKey(void *data, eprosima::fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5=false) override