CARLA
 
载入中...
搜索中...
未找到
Float32.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 Float32.h
17 * This header file contains the declaration of the described types in the IDL file.
18 *
19 * This file was generated by the tool gen.
20 */
21
22#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_
23#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_
24// 包含一些必要的头文件
25#include <fastrtps/utils/fixed_size_string.hpp>
26
27#include <stdint.h>
28#include <array>
29#include <string>
30#include <vector>
31#include <map>
32#include <bitset>
33// Windows平台下的DLL导出/导入宏定义
34#if defined(_WIN32)
35#if defined(EPROSIMA_USER_DLL_EXPORT)
36#define eProsima_user_DllExport __declspec( dllexport )
37#else
38#define eProsima_user_DllExport
39#endif // EPROSIMA_USER_DLL_EXPORT
40#else
41#define eProsima_user_DllExport
42#endif // _WIN32
43// Windows平台下的DLL导出/导入宏定义,针对Float32类
44#if defined(_WIN32)
45#if defined(EPROSIMA_USER_DLL_EXPORT)
46#if defined(Float32_SOURCE)
47#define Float32_DllAPI __declspec( dllexport )
48#else
49#define Float32_DllAPI __declspec( dllimport )
50#endif // Float32_SOURCE
51#else
52#define Float32_DllAPI
53#endif // EPROSIMA_USER_DLL_EXPORT
54#else
55#define Float32_DllAPI
56#endif // _WIN32
57// 引入fastcdr命名空间,用于序列化和反序列化
58namespace eprosima {
59namespace fastcdr {
60class Cdr;
61} // namespace fastcdr
62} // namespace eprosima
63// std_msgs命名空间,包含消息类型定义
64namespace std_msgs {
65 namespace msg {
66 /*!
67 * @brief 这个类表示用户在IDL文件中定义的Float32结构。
68 * @ingroup FLOAT32
69 */
70
71 class Float32
72 {
73 public:
74 /*!
75 * @brief 默认构造函数。
76 */
78
79 /*!
80 * @brief 默认析构函数。
81 */
83
84 /*!
85 * @brief 拷贝构造函数。
86 * @param x 要拷贝的std_msgs::msg::Float32对象的引用。
87 */
89 const Float32& x);
90
91 /*!
92 * @brief 移动构造函数。
93 * @param x 要移动的std_msgs::msg::Float32对象的引用。
94 */
96 Float32&& x) noexcept;
97
98 /*!
99 * @brief 拷贝赋值操作符。
100 * @param x 要拷贝的std_msgs::msg::Float32对象的引用。
101 */
103 const Float32& x);
104
105 /*!
106 * @brief 移动赋值操作符。
107 * @param x 要移动的std_msgs::msg::Float32对象的引用。
108 */
110 Float32&& x) noexcept;
111
112 /*!
113 * @brief 比较操作符。
114 * @param x 要比较的std_msgs::msg::Float32对象。
115 */
117 const Float32& x) const;
118
119 /*!
120 * @brief 比较操作符。
121 * @param x 要比较的std_msgs::msg::Float32对象。
122 */
124 const Float32& x) const;
125
126 /*!
127 * @brief 设置成员data的值。
128 * @param _data 成员data的新值。
129 */
131 float _data);
132
133 /*!
134 * @brief 获取成员data的值。
135 * @return 成员data的值。
136 */
137 eProsima_user_DllExport float data() const;
138
139 /*!
140 * @brief 获取成员data的引用。
141 * @return 成员data的引用。
142 */
144
145 /*!
146 * @brief 返回对象的最大序列化大小,取决于缓冲区对齐。
147 * @param current_alignment 缓冲区对齐。
148 * @return 最大序列化大小。
149 */
151 size_t current_alignment = 0);
152
153 /*!
154 * @brief 返回数据的序列化大小,取决于缓冲区对齐。
155 * @param data 要计算序列化大小的数据。
156 * @param current_alignment 缓冲区对齐。
157 * @return 序列化大小。
158 */
161 size_t current_alignment = 0);
162
163 /*!
164 * @brief 使用CDR序列化对象。
165 * @param cdr CDR序列化对象。
166 */
168 eprosima::fastcdr::Cdr& cdr) const;
169
170 /*!
171 * @brief 使用CDR反序列化对象。
172 * @param cdr CDR序列化对象。
173 */
175 eprosima::fastcdr::Cdr& cdr);
176
177 /*!
178 * @brief 返回对象的Key的最大序列化大小,取决于缓冲区对齐。
179 * @param current_alignment 缓冲区对齐。
180 * @return 最大序列化大小。
181 */
183 size_t current_alignment = 0);
184
185 /*!
186 * @brief 告诉你是否为这种类型定义了Key。
187 */
189
190 /*!
191 * @brief 使用CDR序列化对象的Key成员。
192 * @param cdr CDR序列化对象。
193 */
195 eprosima::fastcdr::Cdr& cdr) const;
196
197 private:
198 float m_data;// 成员变量,存储浮点数数据
199 };
200 } // namespace msg
201} // namespace std_msgs
202
203#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_
#define eProsima_user_DllExport
Definition CameraInfo.h:44
这个类表示用户在IDL文件中定义的Float32结构。
Definition Float32.h:72
eProsima_user_DllExport ~Float32()
默认析构函数。
Definition Float32.cpp:49
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
使用CDR反序列化对象。
Definition Float32.cpp:145
eProsima_user_DllExport Float32 & operator=(const Float32 &x)
拷贝赋值操作符。
Definition Float32.cpp:77
eProsima_user_DllExport bool operator==(const Float32 &x) const
比较操作符。
Definition Float32.cpp:97
static eProsima_user_DllExport size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
返回对象的Key的最大序列化大小,取决于缓冲区对齐。
Definition Float32.cpp:186
static eProsima_user_DllExport size_t getCdrSerializedSize(const std_msgs::msg::Float32 &data, size_t current_alignment=0)
返回数据的序列化大小,取决于缓冲区对齐。
Definition Float32.cpp:123
static eProsima_user_DllExport bool isKeyDefined()
告诉你是否为这种类型定义了Key。
Definition Float32.cpp:198
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
使用CDR序列化对象。
Definition Float32.cpp:137
eProsima_user_DllExport bool operator!=(const Float32 &x) const
比较操作符。
Definition Float32.cpp:105
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
使用CDR序列化对象的Key成员。
Definition Float32.cpp:205
eProsima_user_DllExport Float32()
默认构造函数。
Definition Float32.cpp:42
static eProsima_user_DllExport size_t getMaxCdrSerializedSize(size_t current_alignment=0)
返回对象的最大序列化大小,取决于缓冲区对齐。
Definition Float32.cpp:113
eProsima_user_DllExport float data() const
获取成员data的值。
Definition Float32.cpp:169