CARLA
 
载入中...
搜索中...
未找到
Point32.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 Point32.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 "Point32.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 geometry_msgs_msg_Point32_max_cdr_typesize 12ULL;
38#define geometry_msgs_msg_Point32_max_key_cdr_typesize 0ULL;
39
41{
42 // float m_x
43 m_x = 0.0;
44 // float m_y
45 m_y = 0.0;
46 // float m_z
47 m_z = 0.0;
48}
49
53
55 const Point32& x)
56{
57 m_x = x.m_x;
58 m_y = x.m_y;
59 m_z = x.m_z;
60}
61
63 Point32&& 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 Point32& 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 Point32&& 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 Point32& x) const
92{
93 return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z);
94}
95
97 const Point32& 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::Point32& data,
111 size_t current_alignment)
112{
113 (void)data;
114 size_t initial_alignment = current_alignment;
115 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
116 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
117 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
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 float _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 float _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 float _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}
#define geometry_msgs_msg_Point32_max_key_cdr_typesize
Definition Point32.cpp:38
#define geometry_msgs_msg_Point32_max_cdr_typesize
Definition Point32.cpp:37
This class represents the structure Point32 defined by the user in the IDL file.
Definition Point32.h:71
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition Point32.cpp:130
eProsima_user_DllExport float x() const
This function returns the value of member x
Definition Point32.cpp:152
eProsima_user_DllExport bool operator==(const Point32 &x) const
Comparison operator.
Definition Point32.cpp:90
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Point32 &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition Point32.cpp:109
eProsima_user_DllExport Point32 & operator=(const Point32 &x)
Copy assignment.
Definition Point32.cpp:70
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type
Definition Point32.cpp:229
eProsima_user_DllExport ~Point32()
Default destructor.
Definition Point32.cpp:50
eProsima_user_DllExport bool operator!=(const Point32 &x) const
Comparison operator.
Definition Point32.cpp:96
eProsima_user_DllExport float z() const
This function returns the value of member z
Definition Point32.cpp:208
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition Point32.cpp:234
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 Point32.cpp:102
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 Point32.cpp:222
eProsima_user_DllExport Point32()
Default constructor.
Definition Point32.cpp:40
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition Point32.cpp:122
eProsima_user_DllExport float y() const
This function returns the value of member y
Definition Point32.cpp:180