CARLA
CarlaCollisionEvent.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 CarlaCarlaCollisionEvent.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 "CarlaCollisionEvent.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 carla_msgs_msg_geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL;
38 #define carla_msgs_msg_std_msgs_msg_Header_max_cdr_typesize 268ULL;
39 #define carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize 296ULL;
40 #define carla_msgs_msg_std_msgs_msg_Time_max_cdr_typesize 8ULL;
41 #define carla_msgs_msg_geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL;
42 #define carla_msgs_msg_std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
43 #define carla_msgs_msg_CarlaCollisionEvent_max_key_cdr_typesize 0ULL;
44 #define carla_msgs_msg_std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
45 
47 {
48  // std_msgs::msg::Header m_header
49  // unsigned long m_other_actor_id
50  m_other_actor_id = 0;
51  // geometry_msgs::msg::Vector3 m_normal_impulse
52 }
53 
55 {
56 }
57 
59  const CarlaCollisionEvent& x)
60 {
61  m_header = x.m_header;
62  m_other_actor_id = x.m_other_actor_id;
63  m_normal_impulse = x.m_normal_impulse;
64 }
65 
67  CarlaCollisionEvent&& x) noexcept
68 {
69  m_header = std::move(x.m_header);
70  m_other_actor_id = x.m_other_actor_id;
71  m_normal_impulse = std::move(x.m_normal_impulse);
72 }
73 
75  const CarlaCollisionEvent& x)
76 {
77  m_header = x.m_header;
78  m_other_actor_id = x.m_other_actor_id;
79  m_normal_impulse = x.m_normal_impulse;
80 
81  return *this;
82 }
83 
85  CarlaCollisionEvent&& x) noexcept
86 {
87  m_header = std::move(x.m_header);
88  m_other_actor_id = x.m_other_actor_id;
89  m_normal_impulse = std::move(x.m_normal_impulse);
90 
91  return *this;
92 }
93 
95  const CarlaCollisionEvent& x) const
96 {
97  return (m_header == x.m_header && m_other_actor_id == x.m_other_actor_id && m_normal_impulse == x.m_normal_impulse);
98 }
99 
101  const CarlaCollisionEvent& x) const
102 {
103  return !(*this == x);
104 }
105 
107  size_t current_alignment)
108 {
109  static_cast<void>(current_alignment);
111 }
112 
115  size_t current_alignment)
116 {
117  (void)data;
118  size_t initial_alignment = current_alignment;
119  current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment);
120  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
121  current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.normal_impulse(), current_alignment);
122  return current_alignment - initial_alignment;
123 }
124 
126  eprosima::fastcdr::Cdr& scdr) const
127 {
128  scdr << m_header;
129  scdr << m_other_actor_id;
130  scdr << m_normal_impulse;
131 }
132 
134  eprosima::fastcdr::Cdr& dcdr)
135 {
136  dcdr >> m_header;
137  dcdr >> m_other_actor_id;
138  dcdr >> m_normal_impulse;
139 }
140 
141 /*!
142  * @brief This function copies the value in member header
143  * @param _header New value to be copied in member header
144  */
146  const std_msgs::msg::Header& _header)
147 {
148  m_header = _header;
149 }
150 
151 /*!
152  * @brief This function moves the value in member header
153  * @param _header New value to be moved in member header
154  */
156  std_msgs::msg::Header&& _header)
157 {
158  m_header = std::move(_header);
159 }
160 
161 /*!
162  * @brief This function returns a constant reference to member header
163  * @return Constant reference to member header
164  */
166 {
167  return m_header;
168 }
169 
170 /*!
171  * @brief This function returns a reference to member header
172  * @return Reference to member header
173  */
175 {
176  return m_header;
177 }
178 
179 /*!
180  * @brief This function sets a value in member other_actor_id
181  * @param _other_actor_id New value for member other_actor_id
182  */
184  uint32_t _other_actor_id)
185 {
186  m_other_actor_id = _other_actor_id;
187 }
188 
189 /*!
190  * @brief This function returns the value of member other_actor_id
191  * @return Value of member other_actor_id
192  */
194 {
195  return m_other_actor_id;
196 }
197 
198 /*!
199  * @brief This function returns a reference to member other_actor_id
200  * @return Reference to member other_actor_id
201  */
203 {
204  return m_other_actor_id;
205 }
206 
207 /*!
208  * @brief This function copies the value in member normal_impulse
209  * @param _normal_impulse New value to be copied in member normal_impulse
210  */
212  const geometry_msgs::msg::Vector3& _normal_impulse)
213 {
214  m_normal_impulse = _normal_impulse;
215 }
216 
217 /*!
218  * @brief This function moves the value in member normal_impulse
219  * @param _normal_impulse New value to be moved in member normal_impulse
220  */
222  geometry_msgs::msg::Vector3&& _normal_impulse)
223 {
224  m_normal_impulse = std::move(_normal_impulse);
225 }
226 
227 /*!
228  * @brief This function returns a constant reference to member normal_impulse
229  * @return Constant reference to member normal_impulse
230  */
232 {
233  return m_normal_impulse;
234 }
235 
236 /*!
237  * @brief This function returns a reference to member normal_impulse
238  * @return Reference to member normal_impulse
239  */
241 {
242  return m_normal_impulse;
243 }
244 
246  size_t current_alignment)
247 {
248  static_cast<void>(current_alignment);
250 }
251 
253 {
254  return false;
255 }
256 
258  eprosima::fastcdr::Cdr& scdr) const
259 {
260  (void) scdr;
261 }
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 void header(const std_msgs::msg::Header &_header)
This function copies the value in member header.
eProsima_user_DllExport void normal_impulse(const geometry_msgs::msg::Vector3 &_normal_impulse)
This function copies the value in member normal_impulse.
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header.
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
#define carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize
This class represents the structure Header defined by the user in the IDL file.
Definition: Header.h:72
eProsima_user_DllExport bool operator!=(const CarlaCollisionEvent &x) const
Comparison operator.
eProsima_user_DllExport CarlaCollisionEvent()
Default constructor.
static eProsima_user_DllExport size_t getCdrSerializedSize(const carla_msgs::msg::CarlaCollisionEvent &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 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 void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
This class represents the structure Vector3 defined by the user in the IDL file.
Definition: Vector3.h:71
eProsima_user_DllExport uint32_t other_actor_id() const
This function returns the value of member other_actor_id.
eProsima_user_DllExport const geometry_msgs::msg::Vector3 & normal_impulse() const
This function returns a constant reference to member normal_impulse.
This class represents the structure CarlaCollisionEvent defined by the user in the IDL file...
eProsima_user_DllExport ~CarlaCollisionEvent()
Default destructor.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Vector3 &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Vector3.cpp:110
eProsima_user_DllExport bool operator==(const CarlaCollisionEvent &x) const
Comparison operator.
geometry_msgs::msg::Vector3 m_normal_impulse
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 carla_msgs_msg_CarlaCollisionEvent_max_key_cdr_typesize
eProsima_user_DllExport CarlaCollisionEvent & operator=(const CarlaCollisionEvent &x)
Copy assignment.
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.