#include <hikogui/dispatch/function_timer.hpp>
|
constexpr bool | empty () const noexcept |
|
template<forward_of< void()> Func> |
std::pair< callback< void()>, bool > | delay_function (utc_nanoseconds time_point, Func &&func) noexcept |
| Add a function to be called at a certain time.
|
|
template<forward_of< void()> Func> |
std::pair< callback< void()>, bool > | repeat_function (std::chrono::nanoseconds period, utc_nanoseconds time_point, Func &&func) noexcept |
| Add a function to be called repeatedly.
|
|
template<forward_of< void()> Func> |
std::pair< callback< void()>, bool > | repeat_function (std::chrono::nanoseconds period, Func &&func) noexcept |
| Add a function to be called repeatedly.
|
|
utc_nanoseconds | current_deadline () const noexcept |
| Get the deadline of the next function to call.
|
|
void | run_all (utc_nanoseconds current_time, auto const &...args) noexcept |
| Run all the function that should have run by the current_time.
|
|
A timer that calls functions.
◆ current_deadline()
utc_nanoseconds v1::function_timer::current_deadline |
( |
| ) |
const |
|
inlinenoexcept |
Get the deadline of the next function to call.
- Returns
- The deadline of the next function to call, or far/max into the future.
◆ delay_function()
template<forward_of< void()> Func>
std::pair< callback< void()>, bool > v1::function_timer::delay_function |
( |
utc_nanoseconds | time_point, |
|
|
Func && | func ) |
|
inlinenoexcept |
Add a function to be called at a certain time.
- Parameters
-
time_point | The time when to call the function. |
callback | The function to be called. |
- Returns
- token, next to call.
◆ repeat_function() [1/2]
template<forward_of< void()> Func>
Add a function to be called repeatedly.
- Parameters
-
period | The period between repeated calls |
callback | The function to be called. |
- Returns
- token, next to call.
◆ repeat_function() [2/2]
template<forward_of< void()> Func>
Add a function to be called repeatedly.
- Parameters
-
period | The period between repeated calls |
time_point | The time when to call the function the first time. |
callback | The function to be called. |
- Returns
- token, next to call.
◆ run_all()
void v1::function_timer::run_all |
( |
utc_nanoseconds | current_time, |
|
|
auto const &... | args ) |
|
inlinenoexcept |
Run all the function that should have run by the current_time.
- Parameters
-
current_time | The current time. |
args | The arguments to pass to the function. |
The documentation for this class was generated from the following file: