[#CScheduler] = CScheduler :mrdocs: Schedules deferred and recurring background tasks. == Synopsis Declared in `<scheduler.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class CScheduler; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:CScheduler/Function.adoc[`Function`] | Callable type for scheduled tasks. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:CScheduler/2constructor.adoc[`CScheduler`] [.small]#[constructor]# | Constructs an idle scheduler with an empty task queue. | xref:CScheduler/2destructor.adoc[`~CScheduler`] [.small]#[destructor]# | Destroys the scheduler; the service thread must already be stopped. | xref:CScheduler/AreThreadsServicingQueue.adoc[`AreThreadsServicingQueue`] | Returns true if there are threads actively running in serviceQueue() | xref:CScheduler/MockForward.adoc[`MockForward`] | Mock the scheduler to fast forward in time. Iterates through items on taskQueue and reschedules them to be delta_seconds sooner. | xref:CScheduler/StopWhenDrained.adoc[`StopWhenDrained`] | Tell any threads running serviceQueue to stop when there is no work left to be done | xref:CScheduler/getQueueInfo.adoc[`getQueueInfo`] | Returns number of tasks waiting to be serviced, and first and last task times | xref:CScheduler/schedule.adoc[`schedule`] | Call func at/after time t | xref:CScheduler/scheduleEvery.adoc[`scheduleEvery`] | Repeat f until the scheduler is stopped. First run is after delta has passed once. | xref:CScheduler/scheduleFromNow.adoc[`scheduleFromNow`] | Call f once after the delta has passed | xref:CScheduler/serviceQueue.adoc[`serviceQueue`] | scheduler Services the queue 'forever'. Should be run in a thread. | xref:CScheduler/stop.adoc[`stop`] | Tell any threads running serviceQueue to stop as soon as the current task is done |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:CScheduler/m_service_thread.adoc[`m_service_thread`] | Thread running serviceQueue(), if the scheduler was started on its own thread. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#