Basic scheduler used for timers.
#include <AUI/Util/AScheduler.h>
|
using | TimerHandle = _weak<Timer> |
|
|
bool | iteration (ABitField< ASchedulerIteration > flag=ASchedulerIteration::NONE) |
| Performs an iteration.
|
|
void | notifyProcessMessages () override |
| Notifies this IEventLoop that its thread got a new message to process.
|
|
void | loop () override |
| Do message processing loop.
|
|
template<typename Duration> |
void | enqueue (Duration timeout, std::function< void()> callback) |
|
template<typename Duration> |
TimerHandle | timer (Duration timeout, std::function< void()> callback) |
| Creates a timer.
|
|
void | removeTimer (const TimerHandle &t) |
|
bool | emptyTasks () const noexcept |
|
void | stop () |
|
◆ iteration()#
bool AScheduler::iteration |
( |
ABitField< ASchedulerIteration > | flag = ASchedulerIteration::NONE | ) |
|
- Parameters
-
flag | flags for the iteration. See ASchedulerIteration for more info. |
- Returns
- true, if some action taken, false otherwise
◆ loop()#
void AScheduler::loop |
( |
| ) |
|
|
overridevirtual |
◆ notifyProcessMessages()#
void AScheduler::notifyProcessMessages |
( |
| ) |
|
|
overridevirtual |
◆ timer()#
template<typename Duration>
TimerHandle AScheduler::timer |
( |
Duration | timeout, |
|
|
std::function< void()> | callback ) |
|
inline |
- Parameters
-
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.