CARLA
ros2/types/Time.h
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 Time.h
17  * This header file contains the declaration of the described types in the IDL file.
18  *
19  * This file was generated by the tool gen.
20  */
21 
22 #ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_
23 #define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_
24 
25 
26 #include <fastrtps/utils/fixed_size_string.hpp>
27 
28 #include <stdint.h>
29 #include <array>
30 #include <string>
31 #include <vector>
32 #include <map>
33 #include <bitset>
34 
35 #if defined(_WIN32)
36 #if defined(EPROSIMA_USER_DLL_EXPORT)
37 #define eProsima_user_DllExport __declspec( dllexport )
38 #else
39 #define eProsima_user_DllExport
40 #endif // EPROSIMA_USER_DLL_EXPORT
41 #else
42 #define eProsima_user_DllExport
43 #endif // _WIN32
44 
45 #if defined(_WIN32)
46 #if defined(EPROSIMA_USER_DLL_EXPORT)
47 #if defined(Time_SOURCE)
48 #define Time_DllAPI __declspec( dllexport )
49 #else
50 #define Time_DllAPI __declspec( dllimport )
51 #endif // Time_SOURCE
52 #else
53 #define Time_DllAPI
54 #endif // EPROSIMA_USER_DLL_EXPORT
55 #else
56 #define Time_DllAPI
57 #endif // _WIN32
58 
59 namespace eprosima {
60 namespace fastcdr {
61 class Cdr;
62 } // namespace fastcdr
63 } // namespace eprosima
64 
65 namespace builtin_interfaces {
66  namespace msg {
67  /*!
68  * @brief This class represents the structure Time defined by the user in the IDL file.
69  * @ingroup TIME
70  */
71  class Time
72  {
73  public:
74 
75  /*!
76  * @brief Default constructor.
77  */
79 
80  /*!
81  * @brief Default destructor.
82  */
84 
85  /*!
86  * @brief Copy constructor.
87  * @param x Reference to the object builtin_interfaces::msg::Time that will be copied.
88  */
90  const Time& x);
91 
92  /*!
93  * @brief Move constructor.
94  * @param x Reference to the object builtin_interfaces::msg::Time that will be copied.
95  */
97  Time&& x) noexcept;
98 
99  /*!
100  * @brief Copy assignment.
101  * @param x Reference to the object builtin_interfaces::msg::Time that will be copied.
102  */
103  eProsima_user_DllExport Time& operator =(
104  const Time& x);
105 
106  /*!
107  * @brief Move assignment.
108  * @param x Reference to the object builtin_interfaces::msg::Time that will be copied.
109  */
110  eProsima_user_DllExport Time& operator =(
111  Time&& x) noexcept;
112 
113  /*!
114  * @brief Comparison operator.
115  * @param x builtin_interfaces::msg::Time object to compare.
116  */
118  const Time& x) const;
119 
120  /*!
121  * @brief Comparison operator.
122  * @param x builtin_interfaces::msg::Time object to compare.
123  */
125  const Time& x) const;
126 
127  /*!
128  * @brief This function sets a value in member sec
129  * @param _sec New value for member sec
130  */
131  eProsima_user_DllExport void sec(
132  int32_t _sec);
133 
134  /*!
135  * @brief This function returns the value of member sec
136  * @return Value of member sec
137  */
138  eProsima_user_DllExport int32_t sec() const;
139 
140  /*!
141  * @brief This function returns a reference to member sec
142  * @return Reference to member sec
143  */
144  eProsima_user_DllExport int32_t& sec();
145 
146  /*!
147  * @brief This function sets a value in member nanosec
148  * @param _nanosec New value for member nanosec
149  */
150  eProsima_user_DllExport void nanosec(
151  uint32_t _nanosec);
152 
153  /*!
154  * @brief This function returns the value of member nanosec
155  * @return Value of member nanosec
156  */
157  eProsima_user_DllExport uint32_t nanosec() const;
158 
159  /*!
160  * @brief This function returns a reference to member nanosec
161  * @return Reference to member nanosec
162  */
163  eProsima_user_DllExport uint32_t& nanosec();
164 
165  /*!
166  * @brief This function returns the maximum serialized size of an object
167  * depending on the buffer alignment.
168  * @param current_alignment Buffer alignment.
169  * @return Maximum serialized size.
170  */
171  eProsima_user_DllExport static size_t getMaxCdrSerializedSize(
172  size_t current_alignment = 0);
173 
174  /*!
175  * @brief This function returns the serialized size of a data depending on the buffer alignment.
176  * @param data Data which is calculated its serialized size.
177  * @param current_alignment Buffer alignment.
178  * @return Serialized size.
179  */
180  eProsima_user_DllExport static size_t getCdrSerializedSize(
181  const builtin_interfaces::msg::Time& data,
182  size_t current_alignment = 0);
183 
184  /*!
185  * @brief This function serializes an object using CDR serialization.
186  * @param cdr CDR serialization object.
187  */
188  eProsima_user_DllExport void serialize(
189  eprosima::fastcdr::Cdr& cdr) const;
190 
191  /*!
192  * @brief This function deserializes an object using CDR serialization.
193  * @param cdr CDR serialization object.
194  */
195  eProsima_user_DllExport void deserialize(
196  eprosima::fastcdr::Cdr& cdr);
197 
198  /*!
199  * @brief This function returns the maximum serialized size of the Key of an object
200  * depending on the buffer alignment.
201  * @param current_alignment Buffer alignment.
202  * @return Maximum serialized size.
203  */
204  eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(
205  size_t current_alignment = 0);
206 
207  /*!
208  * @brief This function tells you if the Key has been defined for this type
209  */
210  eProsima_user_DllExport static bool isKeyDefined();
211 
212  /*!
213  * @brief This function serializes the key members of an object using CDR serialization.
214  * @param cdr CDR serialization object.
215  */
216  eProsima_user_DllExport void serializeKey(
217  eprosima::fastcdr::Cdr& cdr) const;
218 
219  private:
220  int32_t m_sec;
221  uint32_t m_nanosec;
222  };
223  } // namespace msg
224 } // namespace builtin_interfaces
225 
226 #endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
This class represents the structure Time defined by the user in the IDL file.
#define eProsima_user_DllExport