CARLA
 
载入中...
搜索中...
未找到
TwistWithCovariance.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 TwistWithCovariance.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 "TwistWithCovariance.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_TwistWithCovariance_max_cdr_typesize 336ULL;
38#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL;
39#define geometry_msgs_msg_Twist_max_cdr_typesize 48ULL;
40#define geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize 0ULL;
41#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL;
42#define geometry_msgs_msg_Twist_max_key_cdr_typesize 0ULL;
43
45{
46 // geometry_msgs::msg::Twist m_twist
47
48 // geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 m_covariance
49 memset(&m_covariance, 0, (36) * 8);
50}
51
55
62
64 TwistWithCovariance&& x) noexcept
65{
66 m_twist = std::move(x.m_twist);
67 m_covariance = std::move(x.m_covariance);
68}
69
78
80 TwistWithCovariance&& x) noexcept
81{
82 m_twist = std::move(x.m_twist);
83 m_covariance = std::move(x.m_covariance);
84
85 return *this;
86}
87
89 const TwistWithCovariance& x) const
90{
91 return (m_twist == x.m_twist && m_covariance == x.m_covariance);
92}
93
95 const TwistWithCovariance& x) const
96{
97 return !(*this == x);
98}
99
101 size_t current_alignment)
102{
103 static_cast<void>(current_alignment);
105}
106
109 size_t current_alignment)
110{
111 size_t initial_alignment = current_alignment;
112 current_alignment += geometry_msgs::msg::Twist::getCdrSerializedSize(data.twist(), current_alignment);
113 current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
114
115 return current_alignment - initial_alignment;
116}
117
119 eprosima::fastcdr::Cdr& scdr) const
120{
121 scdr << m_twist;
122 scdr << m_covariance;
123}
124
126 eprosima::fastcdr::Cdr& dcdr)
127{
128 dcdr >> m_twist;
129 dcdr >> m_covariance;
130}
131
132/*!
133 * @brief This function copies the value in member twist
134 * @param _twist New value to be copied in member twist
135 */
137 const geometry_msgs::msg::Twist& _twist)
138{
139 m_twist = _twist;
140}
141
142/*!
143 * @brief This function moves the value in member twist
144 * @param _twist New value to be moved in member twist
145 */
148{
149 m_twist = std::move(_twist);
150}
151
152/*!
153 * @brief This function returns a constant reference to member twist
154 * @return Constant reference to member twist
155 */
160
161/*!
162 * @brief This function returns a reference to member twist
163 * @return Reference to member twist
164 */
169
170/*!
171 * @brief This function copies the value in member covariance
172 * @param _covariance New value to be copied in member covariance
173 */
179
180/*!
181 * @brief This function moves the value in member covariance
182 * @param _covariance New value to be moved in member covariance
183 */
189
190/*!
191 * @brief This function returns a constant reference to member covariance
192 * @return Constant reference to member covariance
193 */
198
199/*!
200 * @brief This function returns a reference to member covariance
201 * @return Reference to member covariance
202 */
207
209 size_t current_alignment)
210{
211 static_cast<void>(current_alignment);
213}
214
219
221 eprosima::fastcdr::Cdr& scdr) const
222{
223 (void) scdr;
224}
#define geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize
Definition Odometry.cpp:37
#define geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize
Definition Odometry.cpp:47
This class represents the structure TwistWithCovariance defined by the user in the IDL file.
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 const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 & covariance() const
This function returns a constant reference to member covariance
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 bool isKeyDefined()
This function tells you if the Key has been defined for this type
eProsima_user_DllExport const geometry_msgs::msg::Twist & twist() const
This function returns a constant reference to member twist
geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 m_covariance
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
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 TwistWithCovariance &x) const
Comparison operator.
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eProsima_user_DllExport TwistWithCovariance & operator=(const TwistWithCovariance &x)
Copy assignment.
eProsima_user_DllExport TwistWithCovariance()
Default constructor.
eProsima_user_DllExport ~TwistWithCovariance()
Default destructor.
eProsima_user_DllExport bool operator!=(const TwistWithCovariance &x) const
Comparison operator.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::TwistWithCovariance &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
eProsima_user_DllExport void twist(const geometry_msgs::msg::Twist &_twist)
This function copies the value in member twist
This class represents the structure Twist defined by the user in the IDL file.
Definition Twist.h:73
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Twist &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition Twist.cpp:101
std::array< double, 36 > geometry_msgs__TwistWithCovariance__double_array_36