CARLA
Clock.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 Clock.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 "Clock.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 Time_max_cdr_typesize 0ULL;
38 #define rosgraph_msg_Clock_max_cdr_typesize 0ULL;
39 #define Time_max_key_cdr_typesize 0ULL;
40 #define rosgraph_msg_Clock_max_key_cdr_typesize 0ULL;
41 
43 {
44 }
45 
47 {
48 }
49 
51  const rosgraph::msg::Clock& x)
52 {
53  m_clock = x.m_clock;
54 }
55 
57  rosgraph::msg::Clock&& x) noexcept
58 {
59  m_clock = x.m_clock;
60 }
61 
63  const rosgraph::msg::Clock& x)
64 {
65  m_clock = x.m_clock;
66  return *this;
67 }
68 
70  rosgraph::msg::Clock&& x) noexcept
71 {
72  m_clock = x.m_clock;
73  return *this;
74 }
75 
77  const Clock& x) const
78 {
79  return (m_clock == x.m_clock);
80 }
81 
83  const Clock& x) const
84 {
85  return !(*this == x);
86 }
87 
89  size_t current_alignment)
90 {
91  static_cast<void>(current_alignment);
93 }
94 
96  const rosgraph::msg::Clock& data,
97  size_t current_alignment)
98 {
99  (void)data;
100  size_t initial_alignment = current_alignment;
101 
102 
103  current_alignment += builtin_interfaces::msg::Time::getCdrSerializedSize(data.clock(), current_alignment);
104 
105  return current_alignment - initial_alignment;
106 }
107 
109  eprosima::fastcdr::Cdr& scdr) const
110 {
111  scdr << m_clock;
112 }
113 
115  eprosima::fastcdr::Cdr& dcdr)
116 {
117  dcdr >> m_clock;
118 }
119 
120 /*!
121  * @brief This function copies the value in member clock
122  * @param _clock New value to be copied in member clock
123  */
125  const builtin_interfaces::msg::Time& _clock)
126 {
127  m_clock = _clock;
128 }
129 
130 /*!
131  * @brief This function moves the value in member clock
132  * @param _clock New value to be moved in member clock
133  */
136 {
137  m_clock = std::move(_clock);
138 }
139 
140 /*!
141  * @brief This function returns a constant reference to member clock
142  * @return Constant reference to member clock
143  */
145 {
146  return m_clock;
147 }
148 
149 /*!
150  * @brief This function returns a reference to member clock
151  * @return Reference to member clock
152  */
154 {
155  return m_clock;
156 }
157 
159  size_t current_alignment)
160 {
161  static_cast<void>(current_alignment);
163 }
164 
166 {
167  return false;
168 }
169 
171  eprosima::fastcdr::Cdr& scdr) const
172 {
173  (void) scdr;
174 }
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: Clock.cpp:165
static eProsima_user_DllExport size_t getCdrSerializedSize(const rosgraph::msg::Clock &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Clock.cpp:95
eProsima_user_DllExport bool operator==(const Clock &x) const
Comparison operator.
Definition: Clock.cpp:76
eProsima_user_DllExport Clock & operator=(const Clock &x)
Copy assignment.
Definition: Clock.cpp:62
eProsima_user_DllExport ~Clock()
Default destructor.
Definition: Clock.cpp:46
eProsima_user_DllExport const builtin_interfaces::msg::Time & clock() const
This function returns a constant reference to member clock.
Definition: Clock.cpp:144
static eProsima_user_DllExport size_t getCdrSerializedSize(const builtin_interfaces::msg::Time &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: Time.cpp:103
eProsima_user_DllExport Clock()
Default constructor.
Definition: Clock.cpp:42
This class represents the structure Clock defined by the user in the IDL file.
Definition: Clock.h:72
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: Clock.cpp:114
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: Clock.cpp:88
This class represents the structure Time defined by the user in the IDL file.
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: Clock.cpp:108
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: Clock.cpp:158
builtin_interfaces::msg::Time m_clock
Definition: Clock.h:209
#define rosgraph_msg_Clock_max_cdr_typesize
Definition: Clock.cpp:38
eProsima_user_DllExport bool operator!=(const Clock &x) const
Comparison operator.
Definition: Clock.cpp:82
eProsima_user_DllExport void clock(const builtin_interfaces::msg::Time &_clock)
This function copies the value in member clock.
Definition: Clock.cpp:124
#define rosgraph_msg_Clock_max_key_cdr_typesize
Definition: Clock.cpp:40
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: Clock.cpp:170