AScheduler#
Basic scheduler used for timers.
Header: | #include <AUI/Util/AScheduler.h> |
CMake: | aui_link(my_target PUBLIC aui::core) |
Public Methods#
iteration#
bool AScheduler::iteration(ABitField<ASchedulerIteration> flag = ASchedulerIteration::NONE)
Performs an iteration.
- Arguments
flag
flags for the iteration. See ASchedulerIteration for more info.- Returns
- true, if some action taken, false otherwise
timer#
template<typename Duration >
TimerHandle AScheduler::timer(Duration timeout, std::function<void()> callback)
Creates a timer.
- Arguments
timeout
timeout (i.e. 500ms)callback
callback to be called- Returns
- timer instance which can be used to remove the timer.
Creates a timer with the specified callback. The callback is not called immediately during timer creation.
Examples#
examples/7guis/timer/CMakeLists.txt
7GUIs Timer - Timer example.
cmake_minimum_required(VERSION 3.10)
aui_executable(aui.example.timer)
aui_link(aui.example.timer PRIVATE aui::views)