30#include <fastcdr/Cdr.h>
32#include <fastcdr/exceptions/BadParamException.h>
33using namespace eprosima::fastcdr::exception;
37#define sensor_msgs_msg_PointField_max_cdr_typesize 272ULL;
38#define std_msgs_msg_Time_max_cdr_typesize 8ULL;
39#define sensor_msgs_msg_PointCloud2_max_cdr_typesize 27597ULL;
40#define std_msgs_msg_Header_max_cdr_typesize 268ULL;
41#define sensor_msgs_msg_PointField_max_key_cdr_typesize 0ULL;
42#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
43#define sensor_msgs_msg_PointCloud2_max_key_cdr_typesize 0ULL;
44#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
89 m_header = std::move(x.m_header);
90 m_height = x.m_height;
92 m_fields = std::move(x.m_fields);
93 m_is_bigendian = x.m_is_bigendian;
94 m_point_step = x.m_point_step;
95 m_row_step = x.m_row_step;
96 m_data = std::move(x.m_data);
97 m_is_dense = x.m_is_dense;
119 m_header = std::move(x.m_header);
120 m_height = x.m_height;
122 m_fields = std::move(x.m_fields);
123 m_is_bigendian = x.m_is_bigendian;
124 m_point_step = x.m_point_step;
125 m_row_step = x.m_row_step;
126 m_data = std::move(x.m_data);
127 m_is_dense = x.m_is_dense;
141 return !(*
this == x);
145 size_t current_alignment)
147 static_cast<void>(current_alignment);
153 size_t current_alignment)
155 size_t initial_alignment = current_alignment;
157 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
158 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
159 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
161 for(
size_t a = 0; a < data.
fields().size(); ++a)
166 current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
167 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
168 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
169 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
171 if (data.
data().size() > 0)
173 current_alignment += (data.
data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
176 current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
178 return current_alignment - initial_alignment;
182 eprosima::fastcdr::Cdr& scdr)
const
188 scdr << m_is_bigendian;
189 scdr << m_point_step;
196 eprosima::fastcdr::Cdr& dcdr)
202 dcdr >> m_is_bigendian;
203 dcdr >> m_point_step;
226 m_header = std::move(_header);
308 const std::vector<sensor_msgs::msg::PointField>& _fields)
318 std::vector<sensor_msgs::msg::PointField>&& _fields)
320 m_fields = std::move(_fields);
348 m_is_bigendian = _is_bigendian;
357 return m_is_bigendian;
366 return m_is_bigendian;
374 uint32_t _point_step)
376 m_point_step = _point_step;
404 m_row_step = _row_step;
430 const std::vector<uint8_t>& _data)
440 std::vector<uint8_t>&& _data)
442 m_data = std::move(_data);
470 m_is_dense = _is_dense;
492 size_t current_alignment)
494 static_cast<void>(current_alignment);
504 eprosima::fastcdr::Cdr& scdr)
const
#define sensor_msgs_msg_PointCloud2_max_cdr_typesize
#define sensor_msgs_msg_PointCloud2_max_key_cdr_typesize
This class represents the structure PointCloud2 defined by the user in the IDL file.
std_msgs::msg::Header m_header
eProsima_user_DllExport bool operator==(const PointCloud2 &x) const
Comparison operator.
eProsima_user_DllExport const std::vector< uint8_t > & data() const
This function returns a constant reference to member data
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type
eProsima_user_DllExport bool is_bigendian() const
This function returns the value of member is_bigendian
std::vector< sensor_msgs::msg::PointField > m_fields
static eProsima_user_DllExport size_t getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
eProsima_user_DllExport const std::vector< sensor_msgs::msg::PointField > & fields() const
This function returns a constant reference to member fields
eProsima_user_DllExport uint32_t width() const
This function returns the value of member width
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eProsima_user_DllExport void fields(const std::vector< sensor_msgs::msg::PointField > &_fields)
This function copies the value in member fields
eProsima_user_DllExport PointCloud2()
Default constructor.
eProsima_user_DllExport bool operator!=(const PointCloud2 &x) const
Comparison operator.
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
eProsima_user_DllExport uint32_t row_step() const
This function returns the value of member row_step
eProsima_user_DllExport void data(const std::vector< uint8_t > &_data)
This function copies the value in member data
std::vector< uint8_t > m_data
eProsima_user_DllExport uint32_t point_step() const
This function returns the value of member point_step
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::PointCloud2 &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
static eProsima_user_DllExport size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
eProsima_user_DllExport bool is_dense() const
This function returns the value of member is_dense
eProsima_user_DllExport ~PointCloud2()
Default destructor.
eProsima_user_DllExport uint32_t height() const
This function returns the value of member height
eProsima_user_DllExport PointCloud2 & operator=(const PointCloud2 &x)
Copy assignment.
eProsima_user_DllExport void header(const std_msgs::msg::Header &_header)
This function copies the value in member header
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::PointField &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.