CARLA
RegionOfInterest.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 RegionOfInterest.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 "RegionOfInterest.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 sensor_msgs_msg_RegionOfInterest_max_cdr_typesize 17ULL;
38 #define sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize 0ULL;
39 
41 {
42  // unsigned long m_x_offset
43  m_x_offset = 0;
44  // unsigned long m_y_offset
45  m_y_offset = 0;
46  // unsigned long m_height
47  m_height = 0;
48  // unsigned long m_width
49  m_width = 0;
50  // boolean m_do_rectify
51  m_do_rectify = false;
52 }
53 
55 {
56 }
57 
59  const RegionOfInterest& x)
60 {
61  m_x_offset = x.m_x_offset;
62  m_y_offset = x.m_y_offset;
63  m_height = x.m_height;
64  m_width = x.m_width;
65  m_do_rectify = x.m_do_rectify;
66 }
67 
69  RegionOfInterest&& x) noexcept
70 {
71  m_x_offset = x.m_x_offset;
72  m_y_offset = x.m_y_offset;
73  m_height = x.m_height;
74  m_width = x.m_width;
75  m_do_rectify = x.m_do_rectify;
76 }
77 
79  const RegionOfInterest& x)
80 {
81  m_x_offset = x.m_x_offset;
82  m_y_offset = x.m_y_offset;
83  m_height = x.m_height;
84  m_width = x.m_width;
85  m_do_rectify = x.m_do_rectify;
86 
87  return *this;
88 }
89 
91  RegionOfInterest&& x) noexcept
92 {
93  m_x_offset = x.m_x_offset;
94  m_y_offset = x.m_y_offset;
95  m_height = x.m_height;
96  m_width = x.m_width;
97  m_do_rectify = x.m_do_rectify;
98 
99  return *this;
100 }
101 
103  const RegionOfInterest& x) const
104 {
105  return (m_x_offset == x.m_x_offset && m_y_offset == x.m_y_offset && m_height == x.m_height && m_width == x.m_width && m_do_rectify == x.m_do_rectify);
106 }
107 
109  const RegionOfInterest& x) const
110 {
111  return !(*this == x);
112 }
113 
115  size_t current_alignment)
116 {
117  static_cast<void>(current_alignment);
119 }
120 
123  size_t current_alignment)
124 {
125  (void)data;
126  size_t initial_alignment = current_alignment;
127  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
128  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
129  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
130  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
131  current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
132 
133  return current_alignment - initial_alignment;
134 }
135 
137  eprosima::fastcdr::Cdr& scdr) const
138 {
139  scdr << m_x_offset;
140  scdr << m_y_offset;
141  scdr << m_height;
142  scdr << m_width;
143  scdr << m_do_rectify;
144 }
145 
147  eprosima::fastcdr::Cdr& dcdr)
148 {
149  dcdr >> m_x_offset;
150  dcdr >> m_y_offset;
151  dcdr >> m_height;
152  dcdr >> m_width;
153  dcdr >> m_do_rectify;
154 }
155 
156 /*!
157  * @brief This function sets a value in member x_offset
158  * @param _x_offset New value for member x_offset
159  */
161  uint32_t _x_offset)
162 {
163  m_x_offset = _x_offset;
164 }
165 
166 /*!
167  * @brief This function returns the value of member x_offset
168  * @return Value of member x_offset
169  */
171 {
172  return m_x_offset;
173 }
174 
175 /*!
176  * @brief This function returns a reference to member x_offset
177  * @return Reference to member x_offset
178  */
180 {
181  return m_x_offset;
182 }
183 
184 /*!
185  * @brief This function sets a value in member y_offset
186  * @param _y_offset New value for member y_offset
187  */
189  uint32_t _y_offset)
190 {
191  m_y_offset = _y_offset;
192 }
193 
194 /*!
195  * @brief This function returns the value of member y_offset
196  * @return Value of member y_offset
197  */
199 {
200  return m_y_offset;
201 }
202 
203 /*!
204  * @brief This function returns a reference to member y_offset
205  * @return Reference to member y_offset
206  */
208 {
209  return m_y_offset;
210 }
211 
212 /*!
213  * @brief This function sets a value in member height
214  * @param _height New value for member height
215  */
217  uint32_t _height)
218 {
219  m_height = _height;
220 }
221 
222 /*!
223  * @brief This function returns the value of member height
224  * @return Value of member height
225  */
227 {
228  return m_height;
229 }
230 
231 /*!
232  * @brief This function returns a reference to member height
233  * @return Reference to member height
234  */
236 {
237  return m_height;
238 }
239 
240 /*!
241  * @brief This function sets a value in member width
242  * @param _width New value for member width
243  */
245  uint32_t _width)
246 {
247  m_width = _width;
248 }
249 
250 /*!
251  * @brief This function returns the value of member width
252  * @return Value of member width
253  */
255 {
256  return m_width;
257 }
258 
259 /*!
260  * @brief This function returns a reference to member width
261  * @return Reference to member width
262  */
264 {
265  return m_width;
266 }
267 
268 /*!
269  * @brief This function sets a value in member do_rectify
270  * @param _do_rectify New value for member do_rectify
271  */
273  bool _do_rectify)
274 {
275  m_do_rectify = _do_rectify;
276 }
277 
278 /*!
279  * @brief This function returns the value of member do_rectify
280  * @return Value of member do_rectify
281  */
283 {
284  return m_do_rectify;
285 }
286 
287 /*!
288  * @brief This function returns a reference to member do_rectify
289  * @return Reference to member do_rectify
290  */
292 {
293  return m_do_rectify;
294 }
295 
297  size_t current_alignment)
298 {
299  static_cast<void>(current_alignment);
301 }
302 
304 {
305  return false;
306 }
307 
309  eprosima::fastcdr::Cdr& scdr) const
310 {
311  (void) scdr;
312 }
eProsima_user_DllExport bool do_rectify() const
This function returns the value of member do_rectify.
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
eProsima_user_DllExport bool operator==(const RegionOfInterest &x) const
Comparison operator.
eProsima_user_DllExport uint32_t height() const
This function returns the value of member height.
eProsima_user_DllExport uint32_t x_offset() const
This function returns the value of member x_offset.
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::RegionOfInterest &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
eProsima_user_DllExport uint32_t width() const
This function returns the value of member width.
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eProsima_user_DllExport RegionOfInterest & operator=(const RegionOfInterest &x)
Copy assignment.
eProsima_user_DllExport uint32_t y_offset() const
This function returns the value of member y_offset.
#define sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize
eProsima_user_DllExport ~RegionOfInterest()
Default destructor.
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 RegionOfInterest defined by the user in the IDL file...
#define sensor_msgs_msg_RegionOfInterest_max_cdr_typesize
eProsima_user_DllExport RegionOfInterest()
Default constructor.
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
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 bool operator!=(const RegionOfInterest &x) const
Comparison operator.