Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::IntervalTimer Class Reference

Manage interval timers - like the javascript setIntervalTimer API. More...

#include <IntervalTimer.h>

Classes

class  Adder
 Adder adds the given function object to the (for now default; later optionally explicit) IntervalTimer manager, and when its destroyed, the timer is removed. More...
 
class  Manager
 
struct  RegisteredTask
 

Public Types

using TimerCallback = Function< void()>
 

Detailed Description

Manage interval timers - like the javascript setIntervalTimer API.

o Add and remove timers. o Support one-shot timers. o Timers run on arbitrary thread. o Can shut down manager at any time. o Can support multiple 'managers' - but then you have to add explicitly. Or use Adder object to add to default/global IdleTimer manager.

Note
Easiest way to use is IntervalTimer::Adder - see constructor example below
https://stackoverflow.com/questions/33234403/using-setinterval-in-c

note TODO:

Definition at line 40 of file IntervalTimer.h.

Member Typedef Documentation

◆ TimerCallback

Note: these timers CAN throw, and SHOULD throw if interrupted, but the Idle Manager will 'eat' those exceptions.

Precondition
TimerCallback must be cancelable!

Definition at line 48 of file IntervalTimer.h.


The documentation for this class was generated from the following file: