CARLA
PointCloud2.h
Go to the documentation of this file.
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 PointCloud2.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_SENSOR_MSGS_MSG_POINTCLOUD2_H_
23 #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_
24 
25 #include "Header.h"
26 #include "PointField.h"
27 
28 #include <fastrtps/utils/fixed_size_string.hpp>
29 
30 #include <stdint.h>
31 #include <array>
32 #include <string>
33 #include <vector>
34 #include <map>
35 #include <bitset>
36 
37 #if defined(_WIN32)
38 #if defined(EPROSIMA_USER_DLL_EXPORT)
39 #define eProsima_user_DllExport __declspec( dllexport )
40 #else
41 #define eProsima_user_DllExport
42 #endif // EPROSIMA_USER_DLL_EXPORT
43 #else
44 #define eProsima_user_DllExport
45 #endif // _WIN32
46 
47 #if defined(_WIN32)
48 #if defined(EPROSIMA_USER_DLL_EXPORT)
49 #if defined(PointCloud2_SOURCE)
50 #define PointCloud2_DllAPI __declspec( dllexport )
51 #else
52 #define PointCloud2_DllAPI __declspec( dllimport )
53 #endif // PointCloud2_SOURCE
54 #else
55 #define PointCloud2_DllAPI
56 #endif // EPROSIMA_USER_DLL_EXPORT
57 #else
58 #define PointCloud2_DllAPI
59 #endif // _WIN32
60 
61 namespace eprosima {
62 namespace fastcdr {
63 class Cdr;
64 } // namespace fastcdr
65 } // namespace eprosima
66 
67 namespace sensor_msgs {
68  namespace msg {
69  /*!
70  * @brief This class represents the structure PointCloud2 defined by the user in the IDL file.
71  * @ingroup POINTCLOUD2
72  */
74  {
75  public:
76 
77  /*!
78  * @brief Default constructor.
79  */
81 
82  /*!
83  * @brief Default destructor.
84  */
85  eProsima_user_DllExport ~PointCloud2();
86 
87  /*!
88  * @brief Copy constructor.
89  * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied.
90  */
91  eProsima_user_DllExport PointCloud2(
92  const PointCloud2& x);
93 
94  /*!
95  * @brief Move constructor.
96  * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied.
97  */
98  eProsima_user_DllExport PointCloud2(
99  PointCloud2&& x) noexcept;
100 
101  /*!
102  * @brief Copy assignment.
103  * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied.
104  */
105  eProsima_user_DllExport PointCloud2& operator =(
106  const PointCloud2& x);
107 
108  /*!
109  * @brief Move assignment.
110  * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied.
111  */
112  eProsima_user_DllExport PointCloud2& operator =(
113  PointCloud2&& x) noexcept;
114 
115  /*!
116  * @brief Comparison operator.
117  * @param x sensor_msgs::msg::PointCloud2 object to compare.
118  */
120  const PointCloud2& x) const;
121 
122  /*!
123  * @brief Comparison operator.
124  * @param x sensor_msgs::msg::PointCloud2 object to compare.
125  */
127  const PointCloud2& x) const;
128 
129  /*!
130  * @brief This function copies the value in member header
131  * @param _header New value to be copied in member header
132  */
133  eProsima_user_DllExport void header(
134  const std_msgs::msg::Header& _header);
135 
136  /*!
137  * @brief This function moves the value in member header
138  * @param _header New value to be moved in member header
139  */
140  eProsima_user_DllExport void header(
141  std_msgs::msg::Header&& _header);
142 
143  /*!
144  * @brief This function returns a constant reference to member header
145  * @return Constant reference to member header
146  */
147  eProsima_user_DllExport const std_msgs::msg::Header& header() const;
148 
149  /*!
150  * @brief This function returns a reference to member header
151  * @return Reference to member header
152  */
154  /*!
155  * @brief This function sets a value in member height
156  * @param _height New value for member height
157  */
158  eProsima_user_DllExport void height(
159  uint32_t _height);
160 
161  /*!
162  * @brief This function returns the value of member height
163  * @return Value of member height
164  */
165  eProsima_user_DllExport uint32_t height() const;
166 
167  /*!
168  * @brief This function returns a reference to member height
169  * @return Reference to member height
170  */
171  eProsima_user_DllExport uint32_t& height();
172 
173  /*!
174  * @brief This function sets a value in member width
175  * @param _width New value for member width
176  */
177  eProsima_user_DllExport void width(
178  uint32_t _width);
179 
180  /*!
181  * @brief This function returns the value of member width
182  * @return Value of member width
183  */
184  eProsima_user_DllExport uint32_t width() const;
185 
186  /*!
187  * @brief This function returns a reference to member width
188  * @return Reference to member width
189  */
190  eProsima_user_DllExport uint32_t& width();
191 
192  /*!
193  * @brief This function copies the value in member fields
194  * @param _fields New value to be copied in member fields
195  */
196  eProsima_user_DllExport void fields(
197  const std::vector<sensor_msgs::msg::PointField>& _fields);
198 
199  /*!
200  * @brief This function moves the value in member fields
201  * @param _fields New value to be moved in member fields
202  */
203  eProsima_user_DllExport void fields(
204  std::vector<sensor_msgs::msg::PointField>&& _fields);
205 
206  /*!
207  * @brief This function returns a constant reference to member fields
208  * @return Constant reference to member fields
209  */
210  eProsima_user_DllExport const std::vector<sensor_msgs::msg::PointField>& fields() const;
211 
212  /*!
213  * @brief This function returns a reference to member fields
214  * @return Reference to member fields
215  */
216  eProsima_user_DllExport std::vector<sensor_msgs::msg::PointField>& fields();
217  /*!
218  * @brief This function sets a value in member is_bigendian
219  * @param _is_bigendian New value for member is_bigendian
220  */
221  eProsima_user_DllExport void is_bigendian(
222  bool _is_bigendian);
223 
224  /*!
225  * @brief This function returns the value of member is_bigendian
226  * @return Value of member is_bigendian
227  */
228  eProsima_user_DllExport bool is_bigendian() const;
229 
230  /*!
231  * @brief This function returns a reference to member is_bigendian
232  * @return Reference to member is_bigendian
233  */
234  eProsima_user_DllExport bool& is_bigendian();
235 
236  /*!
237  * @brief This function sets a value in member point_step
238  * @param _point_step New value for member point_step
239  */
240  eProsima_user_DllExport void point_step(
241  uint32_t _point_step);
242 
243  /*!
244  * @brief This function returns the value of member point_step
245  * @return Value of member point_step
246  */
247  eProsima_user_DllExport uint32_t point_step() const;
248 
249  /*!
250  * @brief This function returns a reference to member point_step
251  * @return Reference to member point_step
252  */
253  eProsima_user_DllExport uint32_t& point_step();
254 
255  /*!
256  * @brief This function sets a value in member row_step
257  * @param _row_step New value for member row_step
258  */
259  eProsima_user_DllExport void row_step(
260  uint32_t _row_step);
261 
262  /*!
263  * @brief This function returns the value of member row_step
264  * @return Value of member row_step
265  */
266  eProsima_user_DllExport uint32_t row_step() const;
267 
268  /*!
269  * @brief This function returns a reference to member row_step
270  * @return Reference to member row_step
271  */
272  eProsima_user_DllExport uint32_t& row_step();
273 
274  /*!
275  * @brief This function copies the value in member data
276  * @param _data New value to be copied in member data
277  */
278  eProsima_user_DllExport void data(
279  const std::vector<uint8_t>& _data);
280 
281  /*!
282  * @brief This function moves the value in member data
283  * @param _data New value to be moved in member data
284  */
285  eProsima_user_DllExport void data(
286  std::vector<uint8_t>&& _data);
287 
288  /*!
289  * @brief This function returns a constant reference to member data
290  * @return Constant reference to member data
291  */
292  eProsima_user_DllExport const std::vector<uint8_t>& data() const;
293 
294  /*!
295  * @brief This function returns a reference to member data
296  * @return Reference to member data
297  */
298  eProsima_user_DllExport std::vector<uint8_t>& data();
299  /*!
300  * @brief This function sets a value in member is_dense
301  * @param _is_dense New value for member is_dense
302  */
303  eProsima_user_DllExport void is_dense(
304  bool _is_dense);
305 
306  /*!
307  * @brief This function returns the value of member is_dense
308  * @return Value of member is_dense
309  */
310  eProsima_user_DllExport bool is_dense() const;
311 
312  /*!
313  * @brief This function returns a reference to member is_dense
314  * @return Reference to member is_dense
315  */
316  eProsima_user_DllExport bool& is_dense();
317 
318  /*!
319  * @brief This function returns the maximum serialized size of an object
320  * depending on the buffer alignment.
321  * @param current_alignment Buffer alignment.
322  * @return Maximum serialized size.
323  */
324  eProsima_user_DllExport static size_t getMaxCdrSerializedSize(
325  size_t current_alignment = 0);
326 
327  /*!
328  * @brief This function returns the serialized size of a data depending on the buffer alignment.
329  * @param data Data which is calculated its serialized size.
330  * @param current_alignment Buffer alignment.
331  * @return Serialized size.
332  */
333  eProsima_user_DllExport static size_t getCdrSerializedSize(
334  const sensor_msgs::msg::PointCloud2& data,
335  size_t current_alignment = 0);
336 
337  /*!
338  * @brief This function serializes an object using CDR serialization.
339  * @param cdr CDR serialization object.
340  */
341  eProsima_user_DllExport void serialize(
342  eprosima::fastcdr::Cdr& cdr) const;
343 
344  /*!
345  * @brief This function deserializes an object using CDR serialization.
346  * @param cdr CDR serialization object.
347  */
348  eProsima_user_DllExport void deserialize(
349  eprosima::fastcdr::Cdr& cdr);
350 
351  /*!
352  * @brief This function returns the maximum serialized size of the Key of an object
353  * depending on the buffer alignment.
354  * @param current_alignment Buffer alignment.
355  * @return Maximum serialized size.
356  */
357  eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(
358  size_t current_alignment = 0);
359 
360  /*!
361  * @brief This function tells you if the Key has been defined for this type
362  */
363  eProsima_user_DllExport static bool isKeyDefined();
364 
365  /*!
366  * @brief This function serializes the key members of an object using CDR serialization.
367  * @param cdr CDR serialization object.
368  */
369  eProsima_user_DllExport void serializeKey(
370  eprosima::fastcdr::Cdr& cdr) const;
371 
372  private:
374  uint32_t m_height;
375  uint32_t m_width;
376  std::vector<sensor_msgs::msg::PointField> m_fields;
378  uint32_t m_point_step;
379  uint32_t m_row_step;
380  std::vector<uint8_t> m_data;
382  };
383  } // namespace msg
384 } // namespace sensor_msgs
385 
386 #endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_
This class represents the structure PointCloud2 defined by the user in the IDL file.
Definition: PointCloud2.h:73
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
This class represents the structure Header defined by the user in the IDL file.
Definition: Header.h:72
#define eProsima_user_DllExport
Definition: PointCloud2.h:44
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
std::vector< sensor_msgs::msg::PointField > m_fields
Definition: PointCloud2.h:376
std::vector< uint8_t > m_data
Definition: PointCloud2.h:380
std_msgs::msg::Header m_header
Definition: PointCloud2.h:373