snooze_pos.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_TIME_SNOOZE_POS_HPP_
13 #define ECL_TIME_SNOOZE_POS_HPP_
14 
15 /*****************************************************************************
16 ** Platform Check
17 *****************************************************************************/
18 
19 #include <ecl/config.hpp>
20 #if defined(ECL_IS_POSIX)
21 
22 /*****************************************************************************
23 ** Includes
24 *****************************************************************************/
25 
26 #include "duration.hpp"
27 #include <ecl/config/macros.hpp>
28 #include <ecl/time_lite/types.hpp>
29 #include "macros.hpp"
30 
31 /*****************************************************************************
32 ** Namespaces
33 *****************************************************************************/
34 
35 namespace ecl {
36 
37 /*****************************************************************************
38 ** Classes [Snooze]
39 *****************************************************************************/
40 
93 class ecl_time_PUBLIC Snooze {
94 public:
95  /*********************
96  ** C&D's
97  **********************/
104  Snooze();
118  Snooze (const Duration &time, const bool& validate = false );
119  virtual ~Snooze() {}
120 
121  /*********************
122  ** Usage Methods
123  **********************/
137  void period(const Duration &time, const bool& validate = false);
145  Duration period() { return Duration(time_period.tv_sec,time_period.tv_nsec); }
153  void initialise();
164  void operator()();
165 
166 protected:
167  /*********************
168  ** Internal Methods
169  **********************/
176  void add_period();
183  void validate();
184 
185  /*********************
186  ** Internal Variables
187  **********************/
188  TimeStructure time_value;
189  TimeStructure time_period;
190  long wrap_value_ns;
191  bool validate_times;
192 
193 };
194 
195 } // namespace ecl
196 
197 #endif /* ECL_IS_POSIX */
198 #endif /* ECL_TIME_SNOOZE_POS_HPP_ */
Embedded control libraries.
Cross-platform header inclusions for the duration typedefs.
TimeStamp Duration
Convenience typedef to associate timestamps with the concept of durations.
Definition: duration.hpp:41
#define ecl_time_PUBLIC
Definition: macros.hpp:37


ecl_time
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:29