CARLA
Pose.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 Pose.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 "Pose.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_Pose_max_cdr_typesize 56ULL;
38 #define geometry_msgs_msg_Point_max_cdr_typesize 24ULL;
39 #define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL;
40 #define geometry_msgs_msg_Pose_max_key_cdr_typesize 0ULL;
41 #define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL;
42 #define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL;
43 
45 {
46 }
47 
49 {
50 }
51 
53  const Pose& x)
54 {
55  m_position = x.m_position;
56  m_orientation = x.m_orientation;
57 }
58 
60  Pose&& x) noexcept
61 {
62  m_position = std::move(x.m_position);
63  m_orientation = std::move(x.m_orientation);
64 }
65 
67  const Pose& x)
68 {
69  m_position = x.m_position;
70  m_orientation = x.m_orientation;
71 
72  return *this;
73 }
74 
76  Pose&& x) noexcept
77 {
78  m_position = std::move(x.m_position);
79  m_orientation = std::move(x.m_orientation);
80 
81  return *this;
82 }
83 
85  const Pose& x) const
86 {
87  return (m_position == x.m_position && m_orientation == x.m_orientation);
88 }
89 
91  const Pose& x) const
92 {
93  return !(*this == x);
94 }
95 
97  size_t current_alignment)
98 {
99  static_cast<void>(current_alignment);
101 }
102 
104  const geometry_msgs::msg::Pose& data,
105  size_t current_alignment)
106 {
107  size_t initial_alignment = current_alignment;
108  current_alignment += geometry_msgs::msg::Point::getCdrSerializedSize(data.position(), current_alignment);
109  current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment);
110 
111  return current_alignment - initial_alignment;
112 }
113 
115  eprosima::fastcdr::Cdr& scdr) const
116 {
117  scdr << m_position;
118  scdr << m_orientation;
119 }
120 
122  eprosima::fastcdr::Cdr& dcdr)
123 {
124  dcdr >> m_position;
125  dcdr >> m_orientation;
126 }
127 
128 /*!
129  * @brief This function copies the value in member position
130  * @param _position New value to be copied in member position
131  */
133  const geometry_msgs::msg::Point& _position)
134 {
135  m_position = _position;
136 }
137 
138 /*!
139  * @brief This function moves the value in member position
140  * @param _position New value to be moved in member position
141  */
143  geometry_msgs::msg::Point&& _position)
144 {
145  m_position = std::move(_position);
146 }
147 
148 /*!
149  * @brief This function returns a constant reference to member position
150  * @return Constant reference to member position
151  */
153 {
154  return m_position;
155 }
156 
157 /*!
158  * @brief This function returns a reference to member position
159  * @return Reference to member position
160  */
162 {
163  return m_position;
164 }
165 
166 /*!
167  * @brief This function copies the value in member orientation
168  * @param _orientation New value to be copied in member orientation
169  */
171  const geometry_msgs::msg::Quaternion& _orientation)
172 {
173  m_orientation = _orientation;
174 }
175 
176 /*!
177  * @brief This function moves the value in member orientation
178  * @param _orientation New value to be moved in member orientation
179  */
181  geometry_msgs::msg::Quaternion&& _orientation)
182 {
183  m_orientation = std::move(_orientation);
184 }
185 
186 /*!
187  * @brief This function returns a constant reference to member orientation
188  * @return Constant reference to member orientation
189  */
191 {
192  return m_orientation;
193 }
194 
195 /*!
196  * @brief This function returns a reference to member orientation
197  * @return Reference to member orientation
198  */
200 {
201  return m_orientation;
202 }
203 
204 
206  size_t current_alignment)
207 {
208  static_cast<void>(current_alignment);
210 }
211 
213 {
214  return false;
215 }
216 
218  eprosima::fastcdr::Cdr& scdr) const
219 {
220  (void) scdr;
221 }
eProsima_user_DllExport bool operator==(const Pose &x) const
Comparison operator.
Definition: Pose.cpp:84
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...
Definition: Pose.cpp:205
eProsima_user_DllExport const geometry_msgs::msg::Quaternion & orientation() const
This function returns a constant reference to member orientation.
Definition: Pose.cpp:190
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...
Definition: Pose.cpp:96
eProsima_user_DllExport void position(const geometry_msgs::msg::Point &_position)
This function copies the value in member position.
Definition: Pose.cpp:132
eProsima_user_DllExport Pose & operator=(const Pose &x)
Copy assignment.
Definition: Pose.cpp:66
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: Pose.cpp:121
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Pose &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Pose.cpp:103
eProsima_user_DllExport void orientation(const geometry_msgs::msg::Quaternion &_orientation)
This function copies the value in member orientation.
Definition: Pose.cpp:170
eProsima_user_DllExport Pose()
Default constructor.
Definition: Pose.cpp:44
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Quaternion &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Quaternion.cpp:115
geometry_msgs::msg::Quaternion m_orientation
Definition: Pose.h:236
eProsima_user_DllExport ~Pose()
Default destructor.
Definition: Pose.cpp:48
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: Pose.cpp:212
This class represents the structure Pose defined by the user in the IDL file.
Definition: Pose.h:73
#define geometry_msgs_msg_Pose_max_cdr_typesize
Definition: Pose.cpp:37
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: Pose.cpp:217
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Point &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Point.cpp:109
geometry_msgs::msg::Point m_position
Definition: Pose.h:235
#define geometry_msgs_msg_Pose_max_key_cdr_typesize
Definition: Pose.cpp:40
This class represents the structure Quaternion defined by the user in the IDL file.
Definition: Quaternion.h:70
eProsima_user_DllExport const geometry_msgs::msg::Point & position() const
This function returns a constant reference to member position.
Definition: Pose.cpp:152
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: Pose.cpp:114
This class represents the structure Point defined by the user in the IDL file.
Definition: Point.h:70
eProsima_user_DllExport bool operator!=(const Pose &x) const
Comparison operator.
Definition: Pose.cpp:90