CARLA
TransformStamped.cpp
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 TransformStamped.cpp
17  * This source file contains the definition of the described types in the IDL file.
18  *
19  * This file was generated by the tool gen.
20  */
21 
22 #ifdef _WIN32
23 // Remove linker warning LNK4221 on Visual Studio
24 namespace {
25 char dummy;
26 } // namespace
27 #endif // _WIN32
28 
29 #include "TransformStamped.h"
30 #include <fastcdr/Cdr.h>
31 
32 #include <fastcdr/exceptions/BadParamException.h>
33 using namespace eprosima::fastcdr::exception;
34 
35 #include <utility>
36 
37 #define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL;
38 #define geometry_msgs_msg_Transform_max_cdr_typesize 56ULL;
39 #define std_msgs_msg_Time_max_cdr_typesize 8ULL;
40 #define geometry_msgs_msg_TransformStamped_max_cdr_typesize 584ULL;
41 #define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL;
42 #define std_msgs_msg_Header_max_cdr_typesize 268ULL;
43 #define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL;
44 #define geometry_msgs_msg_Transform_max_key_cdr_typesize 0ULL;
45 #define std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
46 #define geometry_msgs_msg_TransformStamped_max_key_cdr_typesize 0ULL;
47 #define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL;
48 #define std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
49 
51 {
52  // std_msgs::msg::Header m_header
53 
54  // string m_child_frame_id
55  m_child_frame_id ="";
56  // geometry_msgs::msg::Transform m_transform
57 }
58 
60 {
61 }
62 
64  const TransformStamped& x)
65 {
66  m_header = x.m_header;
67  m_child_frame_id = x.m_child_frame_id;
68  m_transform = x.m_transform;
69 }
70 
72  TransformStamped&& x) noexcept
73 {
74  m_header = std::move(x.m_header);
75  m_child_frame_id = std::move(x.m_child_frame_id);
76  m_transform = std::move(x.m_transform);
77 }
78 
80  const TransformStamped& x)
81 {
82  m_header = x.m_header;
83  m_child_frame_id = x.m_child_frame_id;
84  m_transform = x.m_transform;
85 
86  return *this;
87 }
88 
90  TransformStamped&& x) noexcept
91 {
92  m_header = std::move(x.m_header);
93  m_child_frame_id = std::move(x.m_child_frame_id);
94  m_transform = std::move(x.m_transform);
95 
96  return *this;
97 }
98 
100  const TransformStamped& x) const
101 {
102  return (m_header == x.m_header && m_child_frame_id == x.m_child_frame_id && m_transform == x.m_transform);
103 }
104 
106  const TransformStamped& x) const
107 {
108  return !(*this == x);
109 }
110 
112  size_t current_alignment)
113 {
114  static_cast<void>(current_alignment);
116 }
117 
120  size_t current_alignment)
121 {
122  size_t initial_alignment = current_alignment;
123  current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment);
124  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.child_frame_id().size() + 1;
125  current_alignment += geometry_msgs::msg::Transform::getCdrSerializedSize(data.transform(), current_alignment);
126 
127  return current_alignment - initial_alignment;
128 }
129 
131  eprosima::fastcdr::Cdr& scdr) const
132 {
133  scdr << m_header;
134  scdr << m_child_frame_id.c_str();
135  scdr << m_transform;
136 }
137 
139  eprosima::fastcdr::Cdr& dcdr)
140 {
141  dcdr >> m_header;
142  dcdr >> m_child_frame_id;
143  dcdr >> m_transform;
144 }
145 
146 /*!
147  * @brief This function copies the value in member header
148  * @param _header New value to be copied in member header
149  */
151  const std_msgs::msg::Header& _header)
152 {
153  m_header = _header;
154 }
155 
156 /*!
157  * @brief This function moves the value in member header
158  * @param _header New value to be moved in member header
159  */
161  std_msgs::msg::Header&& _header)
162 {
163  m_header = std::move(_header);
164 }
165 
166 /*!
167  * @brief This function returns a constant reference to member header
168  * @return Constant reference to member header
169  */
171 {
172  return m_header;
173 }
174 
175 /*!
176  * @brief This function returns a reference to member header
177  * @return Reference to member header
178  */
180 {
181  return m_header;
182 }
183 
184 /*!
185  * @brief This function copies the value in member child_frame_id
186  * @param _child_frame_id New value to be copied in member child_frame_id
187  */
189  const std::string& _child_frame_id)
190 {
191  m_child_frame_id = _child_frame_id;
192 }
193 
194 /*!
195  * @brief This function moves the value in member child_frame_id
196  * @param _child_frame_id New value to be moved in member child_frame_id
197  */
199  std::string&& _child_frame_id)
200 {
201  m_child_frame_id = std::move(_child_frame_id);
202 }
203 
204 /*!
205  * @brief This function returns a constant reference to member child_frame_id
206  * @return Constant reference to member child_frame_id
207  */
209 {
210  return m_child_frame_id;
211 }
212 
213 /*!
214  * @brief This function returns a reference to member child_frame_id
215  * @return Reference to member child_frame_id
216  */
218 {
219  return m_child_frame_id;
220 }
221 
222 /*!
223  * @brief This function copies the value in member transform
224  * @param _transform New value to be copied in member transform
225  */
227  const geometry_msgs::msg::Transform& _transform)
228 {
229  m_transform = _transform;
230 }
231 
232 /*!
233  * @brief This function moves the value in member transform
234  * @param _transform New value to be moved in member transform
235  */
237  geometry_msgs::msg::Transform&& _transform)
238 {
239  m_transform = std::move(_transform);
240 }
241 
242 /*!
243  * @brief This function returns a constant reference to member transform
244  * @return Constant reference to member transform
245  */
247 {
248  return m_transform;
249 }
250 
251 /*!
252  * @brief This function returns a reference to member transform
253  * @return Reference to member transform
254  */
256 {
257  return m_transform;
258 }
259 
261  size_t current_alignment)
262 {
263  static_cast<void>(current_alignment);
265 }
266 
268 {
269  return false;
270 }
271 
273  eprosima::fastcdr::Cdr& scdr) const
274 {
275  (void) scdr;
276 }
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...
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...
#define geometry_msgs_msg_TransformStamped_max_cdr_typesize
eProsima_user_DllExport TransformStamped & operator=(const TransformStamped &x)
Copy assignment.
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
#define geometry_msgs_msg_TransformStamped_max_key_cdr_typesize
This class represents the structure Header defined by the user in the IDL file.
Definition: Header.h:72
eProsima_user_DllExport void transform(const geometry_msgs::msg::Transform &_transform)
This function copies the value in member transform.
static eProsima_user_DllExport size_t getCdrSerializedSize(const std_msgs::msg::Header &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Header.cpp:102
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header.
eProsima_user_DllExport void header(const std_msgs::msg::Header &_header)
This function copies the value in member header.
This class represents the structure Transform defined by the user in the IDL file.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::TransformStamped &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
eProsima_user_DllExport ~TransformStamped()
Default destructor.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Transform &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Transform.cpp:103
eProsima_user_DllExport const std::string & child_frame_id() const
This function returns a constant reference to member child_frame_id.
geometry_msgs::msg::Transform m_transform
eProsima_user_DllExport void child_frame_id(const std::string &_child_frame_id)
This function copies the value in member child_frame_id.
eProsima_user_DllExport TransformStamped()
Default constructor.
eProsima_user_DllExport bool operator!=(const TransformStamped &x) const
Comparison operator.
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
This class represents the structure TransformStamped defined by the user in the IDL file...
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 bool operator==(const TransformStamped &x) const
Comparison operator.
eProsima_user_DllExport const geometry_msgs::msg::Transform & transform() const
This function returns a constant reference to member transform.