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.
◆ EpochEnforcer()
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.
◆ advance_next()
template<typename CLOCK = std::chrono::steady_clock>
◆ duration()
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 148 of file EpochEnforcer.h.
◆ duration_ds()
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 135 of file EpochEnforcer.h.
◆ duration_ns()
template<typename CLOCK = std::chrono::steady_clock>
Returns a duration in nanoseconds.
- Returns
- the duration of the timer in nanoseconds
Definition at line 111 of file EpochEnforcer.h.
◆ duration_s()
template<typename CLOCK = std::chrono::steady_clock>
Returns a duration in seconds.
- Returns
- the duration of the timer in seconds
Definition at line 123 of file EpochEnforcer.h.
◆ has_reached_next()
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 81 of file EpochEnforcer.h.
◆ is_done()
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 102 of file EpochEnforcer.h.
◆ set_duration()
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.
◆ set_period()
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.
◆ sleep_until_next()
template<typename CLOCK = std::chrono::steady_clock>
◆ start()
template<typename CLOCK = std::chrono::steady_clock>
Starts the timer.
Affects future duration calls.
Definition at line 35 of file EpochEnforcer.h.
◆ max_
template<typename CLOCK = std::chrono::steady_clock>
◆ next_
template<typename CLOCK = std::chrono::steady_clock>
◆ period_
template<typename CLOCK = std::chrono::steady_clock>
◆ start_
template<typename CLOCK = std::chrono::steady_clock>
The documentation for this class was generated from the following file: