CARLA
TFMessage.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 TFMessage.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 "TFMessage.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_Vector3_max_cdr_typesize 24ULL;
38 #define geometry_msgs_msg_Transform_max_cdr_typesize 56ULL;
39 #define tf2_msgs_msg_TFMessage_max_cdr_typesize 58408ULL;
40 #define std_msgs_msg_Time_max_cdr_typesize 8ULL;
41 #define geometry_msgs_msg_TransformStamped_max_cdr_typesize 584ULL;
42 #define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL;
43 #define std_msgs_msg_Header_max_cdr_typesize 268ULL;
44 #define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL;
45 #define geometry_msgs_msg_Transform_max_key_cdr_typesize 0ULL;
46 #define tf2_msgs_msg_TFMessage_max_key_cdr_typesize 0ULL;
47 #define std_msgs_msg_Time_max_key_cdr_typesize 0ULL;
48 #define geometry_msgs_msg_TransformStamped_max_key_cdr_typesize 0ULL;
49 #define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL;
50 #define std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
51 
53 {
54 }
55 
57 {
58 }
59 
61  const TFMessage& x)
62 {
63  m_transforms = x.m_transforms;
64 }
65 
67  TFMessage&& x) noexcept
68 {
69  m_transforms = std::move(x.m_transforms);
70 }
71 
73  const TFMessage& x)
74 {
75  m_transforms = x.m_transforms;
76 
77  return *this;
78 }
79 
81  TFMessage&& x) noexcept
82 {
83  m_transforms = std::move(x.m_transforms);
84 
85  return *this;
86 }
87 
89  const TFMessage& x) const
90 {
91  return (m_transforms == x.m_transforms);
92 }
93 
95  const TFMessage& x) const
96 {
97  return !(*this == x);
98 }
99 
101  size_t current_alignment)
102 {
103  static_cast<void>(current_alignment);
105 }
106 
108  const tf2_msgs::msg::TFMessage& data,
109  size_t current_alignment)
110 {
111  size_t initial_alignment = current_alignment;
112  current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
113 
114  for(size_t a = 0; a < data.transforms().size(); ++a)
115  {
116  current_alignment += geometry_msgs::msg::TransformStamped::getCdrSerializedSize(data.transforms().at(a), current_alignment);
117  }
118 
119  return current_alignment - initial_alignment;
120 }
121 
123  eprosima::fastcdr::Cdr& scdr) const
124 {
125  scdr << m_transforms;
126 }
127 
129  eprosima::fastcdr::Cdr& dcdr)
130 {
131  dcdr >> m_transforms;
132 }
133 
134 /*!
135  * @brief This function copies the value in member transforms
136  * @param _transforms New value to be copied in member transforms
137  */
139  const std::vector<geometry_msgs::msg::TransformStamped>& _transforms)
140 {
141  m_transforms = _transforms;
142 }
143 
144 /*!
145  * @brief This function moves the value in member transforms
146  * @param _transforms New value to be moved in member transforms
147  */
149  std::vector<geometry_msgs::msg::TransformStamped>&& _transforms)
150 {
151  m_transforms = std::move(_transforms);
152 }
153 
154 /*!
155  * @brief This function returns a constant reference to member transforms
156  * @return Constant reference to member transforms
157  */
158 const std::vector<geometry_msgs::msg::TransformStamped>& tf2_msgs::msg::TFMessage::transforms() const
159 {
160  return m_transforms;
161 }
162 
163 /*!
164  * @brief This function returns a reference to member transforms
165  * @return Reference to member transforms
166  */
167 std::vector<geometry_msgs::msg::TransformStamped>& tf2_msgs::msg::TFMessage::transforms()
168 {
169  return m_transforms;
170 }
171 
173  size_t current_alignment)
174 {
175  static_cast<void>(current_alignment);
177 }
178 
180 {
181  return false;
182 }
183 
185  eprosima::fastcdr::Cdr& scdr) const
186 {
187  (void) scdr;
188 }
static eProsima_user_DllExport size_t getCdrSerializedSize(const tf2_msgs::msg::TFMessage &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: TFMessage.cpp:107
#define tf2_msgs_msg_TFMessage_max_key_cdr_typesize
Definition: TFMessage.cpp:46
eProsima_user_DllExport const std::vector< geometry_msgs::msg::TransformStamped > & transforms() const
This function returns a constant reference to member transforms.
Definition: TFMessage.cpp:158
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: TFMessage.cpp:100
eProsima_user_DllExport TFMessage()
Default constructor.
Definition: TFMessage.cpp:52
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: TFMessage.cpp:122
eProsima_user_DllExport ~TFMessage()
Default destructor.
Definition: TFMessage.cpp:56
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::TransformStamped &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: TFMessage.cpp:184
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: TFMessage.cpp:128
eProsima_user_DllExport bool operator!=(const TFMessage &x) const
Comparison operator.
Definition: TFMessage.cpp:94
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: TFMessage.cpp:172
eProsima_user_DllExport bool operator==(const TFMessage &x) const
Comparison operator.
Definition: TFMessage.cpp:88
#define tf2_msgs_msg_TFMessage_max_cdr_typesize
Definition: TFMessage.cpp:39
This class represents the structure TFMessage defined by the user in the IDL file.
Definition: TFMessage.h:73
std::vector< geometry_msgs::msg::TransformStamped > m_transforms
Definition: TFMessage.h:210
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: TFMessage.cpp:179
eProsima_user_DllExport TFMessage & operator=(const TFMessage &x)
Copy assignment.
Definition: TFMessage.cpp:72
eProsima_user_DllExport void transforms(const std::vector< geometry_msgs::msg::TransformStamped > &_transforms)
This function copies the value in member transforms.
Definition: TFMessage.cpp:138