CARLA
CarlaLineInvasion.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 CarlaLineInvasion.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 "CarlaLineInvasion.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_std_msgs_msg_Header_max_cdr_typesize 268ULL;
38 #define carla_msgs_msg_LaneInvasionEvent_max_cdr_typesize 672ULL;
39 #define carla_msgs_msg_std_msgs_msg_Time_max_cdr_typesize 8ULL;
40 #define carla_msgs_msg_std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
41 #define carla_msgs_msg_LaneInvasionEvent_max_key_cdr_typesize 0ULL;
42 #define carla_msgs_msg_std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
43 
45 {
46 }
47 
49 {
50 }
51 
53  const LaneInvasionEvent& x)
54 {
55  m_header = x.m_header;
56  m_crossed_lane_markings = x.m_crossed_lane_markings;
57 }
58 
60  LaneInvasionEvent&& x) noexcept
61 {
62  m_header = std::move(x.m_header);
63  m_crossed_lane_markings = std::move(x.m_crossed_lane_markings);
64 }
65 
67  const LaneInvasionEvent& x)
68 {
69  m_header = x.m_header;
70  m_crossed_lane_markings = x.m_crossed_lane_markings;
71 
72  return *this;
73 }
74 
76  LaneInvasionEvent&& x) noexcept
77 {
78  m_header = std::move(x.m_header);
79  m_crossed_lane_markings = std::move(x.m_crossed_lane_markings);
80 
81  return *this;
82 }
83 
85  const LaneInvasionEvent& x) const
86 {
87  return (m_header == x.m_header && m_crossed_lane_markings == x.m_crossed_lane_markings);
88 }
89 
91  const LaneInvasionEvent& x) const
92 {
93  return !(*this == x);
94 }
95 
97  size_t current_alignment)
98 {
99  static_cast<void>(current_alignment);
101 }
102 
105  size_t current_alignment)
106 {
107  size_t initial_alignment = current_alignment;
108  current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment);
109  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
110 
111  if (data.crossed_lane_markings().size() > 0)
112  {
113  current_alignment += (data.crossed_lane_markings().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
114  }
115 
116  return current_alignment - initial_alignment;
117 }
118 
120  eprosima::fastcdr::Cdr& scdr) const
121 {
122  scdr << m_header;
123  scdr << m_crossed_lane_markings;
124 }
125 
127  eprosima::fastcdr::Cdr& dcdr)
128 {
129  dcdr >> m_header;
130  dcdr >> m_crossed_lane_markings;
131 }
132 
133 /*!
134  * @brief This function copies the value in member header
135  * @param _header New value to be copied in member header
136  */
138  const std_msgs::msg::Header& _header)
139 {
140  m_header = _header;
141 }
142 
143 /*!
144  * @brief This function moves the value in member header
145  * @param _header New value to be moved in member header
146  */
148  std_msgs::msg::Header&& _header)
149 {
150  m_header = std::move(_header);
151 }
152 
153 /*!
154  * @brief This function returns a constant reference to member header
155  * @return Constant reference to member header
156  */
158 {
159  return m_header;
160 }
161 
162 /*!
163  * @brief This function returns a reference to member header
164  * @return Reference to member header
165  */
167 {
168  return m_header;
169 }
170 /*!
171  * @brief This function copies the value in member crossed_lane_markings
172  * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings
173  */
175  const std::vector<int32_t>& _crossed_lane_markings)
176 {
177  m_crossed_lane_markings = _crossed_lane_markings;
178 }
179 
180 /*!
181  * @brief This function moves the value in member crossed_lane_markings
182  * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings
183  */
185  std::vector<int32_t>&& _crossed_lane_markings)
186 {
187  m_crossed_lane_markings = std::move(_crossed_lane_markings);
188 }
189 
190 /*!
191  * @brief This function returns a constant reference to member crossed_lane_markings
192  * @return Constant reference to member crossed_lane_markings
193  */
195 {
196  return m_crossed_lane_markings;
197 }
198 
199 /*!
200  * @brief This function returns a reference to member crossed_lane_markings
201  * @return Reference to member crossed_lane_markings
202  */
204 {
205  return m_crossed_lane_markings;
206 }
207 
208 
210  size_t current_alignment)
211 {
212  static_cast<void>(current_alignment);
214 }
215 
217 {
218  return false;
219 }
220 
222  eprosima::fastcdr::Cdr& scdr) const
223 {
224  (void) scdr;
225 }
This class represents the structure LaneInvasionEvent defined by the user in the IDL file...
eProsima_user_DllExport ~LaneInvasionEvent()
Default destructor.
#define carla_msgs_msg_LaneInvasionEvent_max_cdr_typesize
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...
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 LaneInvasionEvent & operator=(const LaneInvasionEvent &x)
Copy assignment.
static eProsima_user_DllExport size_t getCdrSerializedSize(const carla_msgs::msg::LaneInvasionEvent &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
This class represents the structure Header defined by the user in the IDL file.
Definition: Header.h:72
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 serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
std::vector< int32_t > m_crossed_lane_markings
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header.
#define carla_msgs_msg_LaneInvasionEvent_max_key_cdr_typesize
eProsima_user_DllExport const std::vector< int32_t > & crossed_lane_markings() const
This function returns a constant reference to member crossed_lane_markings.
eProsima_user_DllExport LaneInvasionEvent()
Default constructor.
eProsima_user_DllExport bool operator!=(const LaneInvasionEvent &x) const
Comparison operator.
eProsima_user_DllExport bool operator==(const LaneInvasionEvent &x) const
Comparison operator.
eProsima_user_DllExport void crossed_lane_markings(const std::vector< int32_t > &_crossed_lane_markings)
This function copies the value in member crossed_lane_markings.
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 void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
eProsima_user_DllExport void header(const std_msgs::msg::Header &_header)
This function copies the value in member header.