AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AScheduler Class Reference

Basic scheduler used for timers. More...

#include <AUI/Util/AScheduler.h>

Public Types

using TimerHandle = _weak<Timer>
 

Public Member Functions

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 ()
 

Detailed Description

Basic scheduler used for timers.

Member Function Documentation

◆ iteration()

bool AScheduler::iteration ( ABitField< ASchedulerIteration > flag = ASchedulerIteration::NONE)

Performs an iteration.

Parameters
flagflags for the iteration. See ASchedulerIteration for more info.
Returns
true, if some action taken, false otherwise

◆ loop()

void AScheduler::loop ( )
overridevirtual

Do message processing loop.

Implements IEventLoop.

◆ notifyProcessMessages()

void AScheduler::notifyProcessMessages ( )
overridevirtual

Notifies this IEventLoop that its thread got a new message to process.

Implements IEventLoop.

◆ timer()

template<typename Duration>
TimerHandle AScheduler::timer ( Duration timeout,
std::function< void()> callback )
inline

Creates a timer.

Parameters
timeouttimeout (i.e. 500ms)
callbackcallback 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.


The documentation for this class was generated from the following files:
Inheritance diagram for AScheduler:
Collaboration diagram for AScheduler: