timestamp_pos.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_TIME_STAMP_POS_HPP_
13 #define ECL_TIME_STAMP_POS_HPP_
14 
15 /*****************************************************************************
16 ** Platform Check
17 *****************************************************************************/
18 
19 #include <ecl/config.hpp>
20 #if defined(ECL_IS_POSIX)
21 #define ECL_HAS_TIMESTAMP
22 
23 /*****************************************************************************
24 ** Includes
25 *****************************************************************************/
26 
27 #include <time.h>
28 #include <ecl/config/macros.hpp>
29 #include <ecl/config/portable_types.hpp>
30 #include <ecl/exceptions/macros.hpp>
31 #include <ecl/exceptions/standard_exception.hpp>
32 #include "timestamp_base.hpp"
33 
34 /*****************************************************************************
35 ** Namespaces
36 *****************************************************************************/
37 
38 namespace ecl {
39 
40 /*****************************************************************************
41 ** Interface [Time]
42 *****************************************************************************/
43 
90 class ecl_time_PUBLIC TimeStamp : public TimeStampBase {
91 public:
92  /*********************
93  ** Constructors
94  **********************/
104  TimeStamp() ecl_debug_throw_decl(StandardException);
115  TimeStamp (const double& decimal_time_value) ecl_assert_throw_decl(StandardException);
126  TimeStamp (const time_t &seconds, const long &nanoseconds) ecl_assert_throw_decl(StandardException);
136  TimeStamp (const TimeStampBase& base);
137 
138  virtual ~TimeStamp() {}
139 
140  /******************************************
141  ** Stamps
142  *******************************************/
143  using TimeStampBase::stamp;
150  const TimeStamp& stamp() ecl_debug_throw_decl(StandardException);
151 #if defined(ECL_HAS_RT_TIMERS)
152 
159  static const TimeStamp& realtime_now() ecl_debug_throw_decl(StandardException);
160 #endif
161 };
162 
163 
164 
165 }; // namespace ecl
166 
167 #ifdef ECL_HAS_EXCEPTIONS
168 namespace ecl {
169 namespace time {
170 
177 ecl::StandardException throwTimeStampException(const char*loc);
178 
179 } // namespace time
180 }; // namespace ecl
181 
182 #endif /* ECL_HAS_EXCEPTIONS */
183 
184 
185 #endif /* ECL_IS_POSIX */
186 #endif /* ECL_TIME_STAMP_POS_HPP_ */
#define ecl_time_PUBLIC
Standard exception type, provides code location and error string.
const TimeStampBase & stamp(const double &decimal_time_value) ecl_assert_throw_decl(StandardException)
#define ecl_assert_throw_decl(exception)
Assure throw exception declaration.
#define ecl_debug_throw_decl(exception)
Debug mode throw exception declaration.


xbot_driver
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:27:38