Enforces a periodic epoch.
More...
#include <EpochEnforcer.h>
|
std::chrono::time_point< CLOCK > | max_ |
| the end of the timer duration More...
|
|
std::chrono::time_point< CLOCK > | next_ |
| the next epoch to sleep to More...
|
|
std::chrono::nanoseconds | period_ |
| the period of the epochs More...
|
|
std::chrono::time_point< CLOCK > | start_ |
| the start of the timer duration More...
|
|
template<typename CLOCK = std::chrono::steady_clock>
class madara::utility::EpochEnforcer< CLOCK >
Enforces a periodic epoch.
Definition at line 17 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Constructor.
- Parameters
-
period | the period between epochs in seconds |
max_duration | the maximum duration in seconds |
Definition at line 25 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
template<typename CLOCK = std::chrono::steady_clock>
template<typename PERIOD = std::chrono::nanoseconds>
Returns a duration in user-specified period.
- Returns
- the duration of the timer in period
Definition at line 149 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Returns a duration in seconds (double format)
- Returns
- the duration of the timer in seconds
Definition at line 136 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Returns a duration in nanoseconds.
- Returns
- the duration of the timer in nanoseconds
Definition at line 112 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Returns a duration in seconds.
- Returns
- the duration of the timer in seconds
Definition at line 124 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Checks if current time is at or past next.
- Returns
- true if current time is greater than or equal to next epoch
Definition at line 82 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Checks to see if max duration is finished.
- Returns
- true if max duration is exceeded, false otherwise
Definition at line 103 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Sets the maximum duration for the enforcer.
- Parameters
-
duration | the maximum duration of the period epochs |
Definition at line 45 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
Sets the period for the enforcer.
- Parameters
-
period | the period of the epochs |
Definition at line 58 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
template<typename CLOCK = std::chrono::steady_clock>
Starts the timer.
Affects future duration calls.
Definition at line 35 of file EpochEnforcer.h.
template<typename CLOCK = std::chrono::steady_clock>
template<typename CLOCK = std::chrono::steady_clock>
template<typename CLOCK = std::chrono::steady_clock>
template<typename CLOCK = std::chrono::steady_clock>
The documentation for this class was generated from the following file: