Timer implementation, triggers every TimePeriod.
More...
#include <Timer.hpp>
Timer implementation, triggers every TimePeriod.
◆ Timer() [1/2]
| eprosima::safedds::execution::Timer::Timer |
( |
| ) |
|
|
defaultnoexcept |
Inits default Timer with invalid period.
◆ Timer() [2/2]
| eprosima::safedds::execution::Timer::Timer |
( |
const TimePeriod & |
timer_period | ) |
|
|
explicitnoexcept |
Inits Timer given a time period.
- Parameters
-
| [in] | timer_period | Timer trigger frequency. |
◆ is_running()
| bool eprosima::safedds::execution::Timer::is_running |
( |
| ) |
const |
|
noexcept |
Check if timer is running.
- Returns
- bool indicating if timer is running.
◆ is_triggered()
| bool eprosima::safedds::execution::Timer::is_triggered |
( |
| ) |
const |
|
noexcept |
Check if timer has been triggered.
- Returns
- bool indicating if period has elapsed.
◆ is_triggered_and_reset()
| bool eprosima::safedds::execution::Timer::is_triggered_and_reset |
( |
| ) |
|
|
noexcept |
Check if timer has been triggered and reset it if so.
- Returns
- bool indicating if period has elapsed.
◆ next_trigger()
| TimePoint eprosima::safedds::execution::Timer::next_trigger |
( |
| ) |
const |
|
noexcept |
Get the next trigger time point.
- Returns
- TimePoint.
◆ period() [1/2]
| TimePeriod eprosima::safedds::execution::Timer::period |
( |
| ) |
const |
|
noexcept |
Getter for configured timer period.
- Returns
- TimePeriod.
◆ period() [2/2]
| void eprosima::safedds::execution::Timer::period |
( |
const TimePeriod & |
timer_period | ) |
|
|
noexcept |
Setter for timer period.
- Parameters
-
| [in] | timer_period | Timer trigger frequency. |
- Note
- This method won't modify the actual trigger time. The configured period will be effective on the next timer reset.
◆ start() [1/2]
| void eprosima::safedds::execution::Timer::start |
( |
| ) |
|
|
noexcept |
◆ start() [2/2]
| void eprosima::safedds::execution::Timer::start |
( |
const TimePoint & |
new_next_trigger | ) |
|
|
noexcept |
Initializes the timer with the next trigger time point.
- Parameters
-
| [in] | new_next_trigger | Next trigger time point. |
◆ stop()
| void eprosima::safedds::execution::Timer::stop |
( |
| ) |
|
|
noexcept |
The documentation for this class was generated from the following file:
- build/docs/user_manual/main/tmp/include/safedds/execution/Timer.hpp