CARLA
 
载入中...
搜索中...
未找到
NavSatFix.cpp
浏览该文件的文档.
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 NavSatFix.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
24namespace {
25char dummy;
26} // namespace
27#endif // _WIN32
28
29#include "NavSatFix.h"
30#include <fastcdr/Cdr.h>
31
32#include <fastcdr/exceptions/BadParamException.h>
33using namespace eprosima::fastcdr::exception;
34
35#include <utility>
36
37#define std_msgs_msg_Time_max_cdr_typesize 8ULL;
38#define sensor_msgs_msg_NavSatStatus_max_cdr_typesize 4ULL;
39#define std_msgs_msg_Header_max_cdr_typesize 268ULL;
40#define sensor_msgs_msg_NavSatFix_max_cdr_typesize 369ULL;
41
42#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
43#define sensor_msgs_msg_NavSatStatus_max_key_cdr_typesize 0ULL;
44#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
45#define sensor_msgs_msg_NavSatFix_max_key_cdr_typesize 0ULL;
46
48{
49 // std_msgs::msg::Header m_header
50
51 // sensor_msgs::msg::NavSatStatus m_status
52
53 // double m_latitude
54 m_latitude = 0.0;
55 // double m_longitude
56 m_longitude = 0.0;
57 // double m_altitude
58 m_altitude = 0.0;
59 // sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance
60 memset(&m_position_covariance, 0, (9) * 8);
61 // octet m_position_covariance_type
63}
64
68
70 const NavSatFix& x)
71{
72 m_header = x.m_header;
73 m_status = x.m_status;
74 m_latitude = x.m_latitude;
75 m_longitude = x.m_longitude;
76 m_altitude = x.m_altitude;
77 m_position_covariance = x.m_position_covariance;
78 m_position_covariance_type = x.m_position_covariance_type;
79}
80
82 NavSatFix&& x) noexcept
83{
84 m_header = std::move(x.m_header);
85 m_status = std::move(x.m_status);
86 m_latitude = x.m_latitude;
87 m_longitude = x.m_longitude;
88 m_altitude = x.m_altitude;
89 m_position_covariance = std::move(x.m_position_covariance);
90 m_position_covariance_type = x.m_position_covariance_type;
91}
92
94 const NavSatFix& x)
95{
96 m_header = x.m_header;
97 m_status = x.m_status;
98 m_latitude = x.m_latitude;
99 m_longitude = x.m_longitude;
100 m_altitude = x.m_altitude;
101 m_position_covariance = x.m_position_covariance;
102 m_position_covariance_type = x.m_position_covariance_type;
103
104 return *this;
105}
106
108 NavSatFix&& x) noexcept
109{
110 m_header = std::move(x.m_header);
111 m_status = std::move(x.m_status);
112 m_latitude = x.m_latitude;
113 m_longitude = x.m_longitude;
114 m_altitude = x.m_altitude;
115 m_position_covariance = std::move(x.m_position_covariance);
116 m_position_covariance_type = x.m_position_covariance_type;
117
118 return *this;
119}
120
122 const NavSatFix& x) const
123{
124 return (m_header == x.m_header && m_status == x.m_status && m_latitude == x.m_latitude && m_longitude == x.m_longitude && m_altitude == x.m_altitude && m_position_covariance == x.m_position_covariance && m_position_covariance_type == x.m_position_covariance_type);
125}
126
128 const NavSatFix& x) const
129{
130 return !(*this == x);
131}
132
134 size_t current_alignment)
135{
136 static_cast<void>(current_alignment);
138}
139
141 const sensor_msgs::msg::NavSatFix& data,
142 size_t current_alignment)
143{
144 size_t initial_alignment = current_alignment;
145 current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment);
146 current_alignment += sensor_msgs::msg::NavSatStatus::getCdrSerializedSize(data.status(), current_alignment);
147 current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
148 current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
149 current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
150 current_alignment += ((9) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
151 current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);
152
153 return current_alignment - initial_alignment;
154}
155
157 eprosima::fastcdr::Cdr& scdr) const
158{
159 scdr << m_header;
160 scdr << m_status;
161 scdr << m_latitude;
162 scdr << m_longitude;
163 scdr << m_altitude;
164 scdr << m_position_covariance;
165 scdr << m_position_covariance_type;
166}
167
169 eprosima::fastcdr::Cdr& dcdr)
170{
171 dcdr >> m_header;
172 dcdr >> m_status;
173 dcdr >> m_latitude;
174 dcdr >> m_longitude;
175 dcdr >> m_altitude;
176 dcdr >> m_position_covariance;
177 dcdr >> m_position_covariance_type;
178}
179
180/*!
181 * @brief This function copies the value in member header
182 * @param _header New value to be copied in member header
183 */
185 const std_msgs::msg::Header& _header)
186{
187 m_header = _header;
188}
189
190/*!
191 * @brief This function moves the value in member header
192 * @param _header New value to be moved in member header
193 */
195 std_msgs::msg::Header&& _header)
196{
197 m_header = std::move(_header);
198}
199
200/*!
201 * @brief This function returns a constant reference to member header
202 * @return Constant reference to member header
203 */
205{
206 return m_header;
207}
208
209/*!
210 * @brief This function returns a reference to member header
211 * @return Reference to member header
212 */
217
218/*!
219 * @brief This function copies the value in member status
220 * @param _status New value to be copied in member status
221 */
223 const sensor_msgs::msg::NavSatStatus& _status)
224{
225 m_status = _status;
226}
227
228/*!
229 * @brief This function moves the value in member status
230 * @param _status New value to be moved in member status
231 */
234{
235 m_status = std::move(_status);
236}
237
238/*!
239 * @brief This function returns a constant reference to member status
240 * @return Constant reference to member status
241 */
243{
244 return m_status;
245}
246
247/*!
248 * @brief This function returns a reference to member status
249 * @return Reference to member status
250 */
255
256/*!
257 * @brief This function sets a value in member latitude
258 * @param _latitude New value for member latitude
259 */
261 double _latitude)
262{
263 m_latitude = _latitude;
264}
265
266/*!
267 * @brief This function returns the value of member latitude
268 * @return Value of member latitude
269 */
271{
272 return m_latitude;
273}
274
275/*!
276 * @brief This function returns a reference to member latitude
277 * @return Reference to member latitude
278 */
280{
281 return m_latitude;
282}
283
284/*!
285 * @brief This function sets a value in member longitude
286 * @param _longitude New value for member longitude
287 */
289 double _longitude)
290{
291 m_longitude = _longitude;
292}
293
294/*!
295 * @brief This function returns the value of member longitude
296 * @return Value of member longitude
297 */
299{
300 return m_longitude;
301}
302
303/*!
304 * @brief This function returns a reference to member longitude
305 * @return Reference to member longitude
306 */
308{
309 return m_longitude;
310}
311
312/*!
313 * @brief This function sets a value in member altitude
314 * @param _altitude New value for member altitude
315 */
317 double _altitude)
318{
319 m_altitude = _altitude;
320}
321
322/*!
323 * @brief This function returns the value of member altitude
324 * @return Value of member altitude
325 */
327{
328 return m_altitude;
329}
330
331/*!
332 * @brief This function returns a reference to member altitude
333 * @return Reference to member altitude
334 */
336{
337 return m_altitude;
338}
339
340/*!
341 * @brief This function copies the value in member position_covariance
342 * @param _position_covariance New value to be copied in member position_covariance
343 */
346{
347 m_position_covariance = _position_covariance;
348}
349
350/*!
351 * @brief This function moves the value in member position_covariance
352 * @param _position_covariance New value to be moved in member position_covariance
353 */
356{
357 m_position_covariance = std::move(_position_covariance);
358}
359
360/*!
361 * @brief This function returns a constant reference to member position_covariance
362 * @return Constant reference to member position_covariance
363 */
368
369/*!
370 * @brief This function returns a reference to member position_covariance
371 * @return Reference to member position_covariance
372 */
377/*!
378 * @brief This function sets a value in member position_covariance_type
379 * @param _position_covariance_type New value for member position_covariance_type
380 */
382 uint8_t _position_covariance_type)
383{
384 m_position_covariance_type = _position_covariance_type;
385}
386
387/*!
388 * @brief This function returns the value of member position_covariance_type
389 * @return Value of member position_covariance_type
390 */
392{
393 return m_position_covariance_type;
394}
395
396/*!
397 * @brief This function returns a reference to member position_covariance_type
398 * @return Reference to member position_covariance_type
399 */
401{
402 return m_position_covariance_type;
403}
404
406 size_t current_alignment)
407{
408 static_cast<void>(current_alignment);
410}
411
413{
414 return false;
415}
416
418 eprosima::fastcdr::Cdr& scdr) const
419{
420 (void) scdr;
421}
#define sensor_msgs_msg_NavSatFix_max_cdr_typesize
Definition NavSatFix.cpp:40
#define sensor_msgs_msg_NavSatFix_max_key_cdr_typesize
Definition NavSatFix.cpp:45
This class represents the structure NavSatFix defined by the user in the IDL file.
Definition NavSatFix.h:79
eProsima_user_DllExport void header(const std_msgs::msg::Header &_header)
This function copies the value in member header
sensor_msgs::msg::NavSatStatus m_status
Definition NavSatFix.h:341
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 NavSatFix &x) const
Comparison operator.
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 NavSatFix & operator=(const NavSatFix &x)
Copy assignment.
Definition NavSatFix.cpp:93
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header
eProsima_user_DllExport uint8_t position_covariance_type() const
This function returns the value of member position_covariance_type
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
std_msgs::msg::Header m_header
Definition NavSatFix.h:340
sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance
Definition NavSatFix.h:345
eProsima_user_DllExport void status(const sensor_msgs::msg::NavSatStatus &_status)
This function copies the value in member status
eProsima_user_DllExport bool operator!=(const NavSatFix &x) const
Comparison operator.
eProsima_user_DllExport NavSatFix()
Default constructor.
Definition NavSatFix.cpp:47
eProsima_user_DllExport ~NavSatFix()
Default destructor.
Definition NavSatFix.cpp:65
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatFix &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 getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
eProsima_user_DllExport double altitude() const
This function returns the value of member altitude
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type
eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 & position_covariance() const
This function returns a constant reference to member position_covariance
eProsima_user_DllExport double longitude() const
This function returns the value of member longitude
eProsima_user_DllExport const sensor_msgs::msg::NavSatStatus & status() const
This function returns a constant reference to member status
eProsima_user_DllExport double latitude() const
This function returns the value of member latitude
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
This class represents the structure NavSatStatus defined by the user in the IDL file.
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatStatus &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
This class represents the structure Header defined by the user in the IDL file.
Definition Header.h:73
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
std::array< double, 9 > sensor_msgs__NavSatFix__double_array_9
Definition NavSatFix.h:73