CARLA
Point.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 Point.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 "Point.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_Point_max_cdr_typesize 24ULL;
38 #define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL;
39 
41 {
42  // double m_x
43  m_x = 0.0;
44  // double m_y
45  m_y = 0.0;
46  // double m_z
47  m_z = 0.0;
48 }
49 
51 {
52 }
53 
55  const Point& x)
56 {
57  m_x = x.m_x;
58  m_y = x.m_y;
59  m_z = x.m_z;
60 }
61 
63  Point&& x) noexcept
64 {
65  m_x = x.m_x;
66  m_y = x.m_y;
67  m_z = x.m_z;
68 }
69 
71  const Point& x)
72 {
73  m_x = x.m_x;
74  m_y = x.m_y;
75  m_z = x.m_z;
76 
77  return *this;
78 }
79 
81  Point&& x) noexcept
82 {
83  m_x = x.m_x;
84  m_y = x.m_y;
85  m_z = x.m_z;
86 
87  return *this;
88 }
89 
91  const Point& x) const
92 {
93  return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z);
94 }
95 
97  const Point& x) const
98 {
99  return !(*this == x);
100 }
101 
103  size_t current_alignment)
104 {
105  static_cast<void>(current_alignment);
107 }
108 
110  const geometry_msgs::msg::Point& data,
111  size_t current_alignment)
112 {
113  (void)data;
114  size_t initial_alignment = current_alignment;
115  current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
116  current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
117  current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
118 
119  return current_alignment - initial_alignment;
120 }
121 
123  eprosima::fastcdr::Cdr& scdr) const
124 {
125  scdr << m_x;
126  scdr << m_y;
127  scdr << m_z;
128 }
129 
131  eprosima::fastcdr::Cdr& dcdr)
132 {
133  dcdr >> m_x;
134  dcdr >> m_y;
135  dcdr >> m_z;
136 }
137 
138 /*!
139  * @brief This function sets a value in member x
140  * @param _x New value for member x
141  */
143  double _x)
144 {
145  m_x = _x;
146 }
147 
148 /*!
149  * @brief This function returns the value of member x
150  * @return Value of member x
151  */
153 {
154  return m_x;
155 }
156 
157 /*!
158  * @brief This function returns a reference to member x
159  * @return Reference to member x
160  */
162 {
163  return m_x;
164 }
165 
166 /*!
167  * @brief This function sets a value in member y
168  * @param _y New value for member y
169  */
171  double _y)
172 {
173  m_y = _y;
174 }
175 
176 /*!
177  * @brief This function returns the value of member y
178  * @return Value of member y
179  */
181 {
182  return m_y;
183 }
184 
185 /*!
186  * @brief This function returns a reference to member y
187  * @return Reference to member y
188  */
190 {
191  return m_y;
192 }
193 
194 /*!
195  * @brief This function sets a value in member z
196  * @param _z New value for member z
197  */
199  double _z)
200 {
201  m_z = _z;
202 }
203 
204 /*!
205  * @brief This function returns the value of member z
206  * @return Value of member z
207  */
209 {
210  return m_z;
211 }
212 
213 /*!
214  * @brief This function returns a reference to member z
215  * @return Reference to member z
216  */
218 {
219  return m_z;
220 }
221 
223  size_t current_alignment)
224 {
225  static_cast<void>(current_alignment);
227 }
228 
230 {
231  return false;
232 }
233 
235  eprosima::fastcdr::Cdr& scdr) const
236 {
237  (void) scdr;
238 }
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: Point.cpp:122
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: Point.cpp:222
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: Point.cpp:130
eProsima_user_DllExport Point & operator=(const Point &x)
Copy assignment.
Definition: Point.cpp:70
eProsima_user_DllExport bool operator!=(const Point &x) const
Comparison operator.
Definition: Point.cpp:96
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: Point.cpp:229
eProsima_user_DllExport double y() const
This function returns the value of member y.
Definition: Point.cpp:180
#define geometry_msgs_msg_Point_max_key_cdr_typesize
Definition: Point.cpp:38
eProsima_user_DllExport Point()
Default constructor.
Definition: Point.cpp:40
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: Point.cpp:102
eProsima_user_DllExport bool operator==(const Point &x) const
Comparison operator.
Definition: Point.cpp:90
eProsima_user_DllExport ~Point()
Default destructor.
Definition: Point.cpp:50
eProsima_user_DllExport double z() const
This function returns the value of member z.
Definition: Point.cpp:208
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
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: Point.cpp:234
#define geometry_msgs_msg_Point_max_cdr_typesize
Definition: Point.cpp:37
eProsima_user_DllExport double x() const
This function returns the value of member x.
Definition: Point.cpp:152
This class represents the structure Point defined by the user in the IDL file.
Definition: Point.h:70