pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
Time.hpp
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.hpp
17 * This header file contains the declaration of the described types in the IDL file.
18 *
19 * This file was generated by the tool fastddsgen.
20 */
21
22#ifndef FAST_DDS_GENERATED__BUILTIN_INTERFACES_MSG_TIME_HPP
23#define FAST_DDS_GENERATED__BUILTIN_INTERFACES_MSG_TIME_HPP
24
25#include <cstdint>
26#include <utility>
27
28#if defined(_WIN32)
29#if defined(EPROSIMA_USER_DLL_EXPORT)
30#define eProsima_user_DllExport __declspec( dllexport )
31#else
32#define eProsima_user_DllExport
33#endif // EPROSIMA_USER_DLL_EXPORT
34#else
35#define eProsima_user_DllExport
36#endif // _WIN32
37
38#if defined(_WIN32)
39#if defined(EPROSIMA_USER_DLL_EXPORT)
40#if defined(TIME_SOURCE)
41#define TIME_DllAPI __declspec( dllexport )
42#else
43#define TIME_DllAPI __declspec( dllimport )
44#endif // TIME_SOURCE
45#else
46#define TIME_DllAPI
47#endif // EPROSIMA_USER_DLL_EXPORT
48#else
49#define TIME_DllAPI
50#endif // _WIN32
51
52namespace builtin_interfaces {
53
54namespace msg {
55
56/*!
57 * @brief This class represents the structure Time defined by the user in the IDL file.
58 * @ingroup Time
59 */
60class Time
61{
62public:
63
64 /*!
65 * @brief Default constructor.
66 */
70
71 /*!
72 * @brief Default destructor.
73 */
77
78 /*!
79 * @brief Copy constructor.
80 * @param x Reference to the object Time that will be copied.
81 */
83 const Time& x)
84 {
85 m_sec = x.m_sec;
86
87 m_nanosec = x.m_nanosec;
88
89 }
90
91 /*!
92 * @brief Move constructor.
93 * @param x Reference to the object Time that will be copied.
94 */
96 Time&& x) noexcept
97 {
98 m_sec = x.m_sec;
99 m_nanosec = x.m_nanosec;
100 }
101
102 /*!
103 * @brief Copy assignment.
104 * @param x Reference to the object Time that will be copied.
105 */
107 const Time& x)
108 {
109
110 m_sec = x.m_sec;
111
112 m_nanosec = x.m_nanosec;
113
114 return *this;
115 }
116
117 /*!
118 * @brief Move assignment.
119 * @param x Reference to the object Time that will be copied.
120 */
122 Time&& x) noexcept
123 {
124
125 m_sec = x.m_sec;
126 m_nanosec = x.m_nanosec;
127 return *this;
128 }
129
130 /*!
131 * @brief Comparison operator.
132 * @param x Time object to compare.
133 */
135 const Time& x) const
136 {
137 return (m_sec == x.m_sec &&
138 m_nanosec == x.m_nanosec);
139 }
140
141 /*!
142 * @brief Comparison operator.
143 * @param x Time object to compare.
144 */
146 const Time& x) const
147 {
148 return !(*this == x);
149 }
150
151 /*!
152 * @brief This function sets a value in member sec
153 * @param _sec New value for member sec
154 */
156 int32_t _sec)
157 {
158 m_sec = _sec;
159 }
160
161 /*!
162 * @brief This function returns the value of member sec
163 * @return Value of member sec
164 */
166 {
167 return m_sec;
168 }
169
170 /*!
171 * @brief This function returns a reference to member sec
172 * @return Reference to member sec
173 */
175 {
176 return m_sec;
177 }
178
179
180 /*!
181 * @brief This function sets a value in member nanosec
182 * @param _nanosec New value for member nanosec
183 */
185 uint32_t _nanosec)
186 {
187 m_nanosec = _nanosec;
188 }
189
190 /*!
191 * @brief This function returns the value of member nanosec
192 * @return Value of member nanosec
193 */
195 {
196 return m_nanosec;
197 }
198
199 /*!
200 * @brief This function returns a reference to member nanosec
201 * @return Reference to member nanosec
202 */
204 {
205 return m_nanosec;
206 }
207
208
209
210private:
211
212 int32_t m_sec{0};
213 uint32_t m_nanosec{0};
214
215};
216
217} // namespace msg
218
219} // namespace builtin_interfaces
220
221#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_HPP_
222
223
#define eProsima_user_DllExport
Definition Header.hpp:37
This class represents the structure Time defined by the user in the IDL file.
Definition Time.idl:3
eProsima_user_DllExport Time & operator=(const Time &x)
Copy assignment.
Definition Time.hpp:106
eProsima_user_DllExport Time(const Time &x)
Copy constructor.
Definition Time.hpp:82
eProsima_user_DllExport void sec(int32_t _sec)
This function sets a value in member sec.
Definition Time.hpp:155
eProsima_user_DllExport uint32_t nanosec() const
This function returns the value of member nanosec.
Definition Time.hpp:194
eProsima_user_DllExport int32_t sec() const
This function returns the value of member sec.
Definition Time.hpp:165
eProsima_user_DllExport Time()
Default constructor.
Definition Time.hpp:67
eProsima_user_DllExport ~Time()
Default destructor.
Definition Time.hpp:74
eProsima_user_DllExport bool operator!=(const Time &x) const
Comparison operator.
Definition Time.hpp:145
eProsima_user_DllExport void nanosec(uint32_t _nanosec)
This function sets a value in member nanosec.
Definition Time.hpp:184
eProsima_user_DllExport Time(Time &&x) noexcept
Move constructor.
Definition Time.hpp:95
eProsima_user_DllExport int32_t & sec()
This function returns a reference to member sec.
Definition Time.hpp:174
eProsima_user_DllExport bool operator==(const Time &x) const
Comparison operator.
Definition Time.hpp:134
eProsima_user_DllExport uint32_t & nanosec()
This function returns a reference to member nanosec.
Definition Time.hpp:203