All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::Scheduler Class Reference

Scheduler class. More...

#include <kanzi/scheduler/scheduler.hpp>

Public Member Functions

bool submitTask (const string &name, Task task)
 Submits a task for one-shot execution. More...
 
bool insertRecurringTask (const string &name, Task task)
 Submits a task for recurring execution. More...
 
bool removeTask (const string &name)
 Immediately removes a task from the scheduler. More...
 
bool removeTaskAfterExecution (const string &name)
 Removes a task from the scheduler after its execution (next or current) ends. More...
 
void executeTasks ()
 Executes all tasks in ascending alphabetical order and removes non-recurring tasks after their execution. More...
 
void debugPrintTasks () const
 Prints the tasks to the log. More...
 

Detailed Description

Scheduler class.

Represents an ordered set of tasks.

Member Function Documentation

bool kanzi::Scheduler::submitTask ( const string &  name,
Task  task 
)

Submits a task for one-shot execution.

Parameters
nameThe name of the task. Establishes the task execution order.
taskThe task to submit.
Returns
True, if this function did not replace an existing task.
bool kanzi::Scheduler::insertRecurringTask ( const string &  name,
Task  task 
)

Submits a task for recurring execution.

Parameters
nameThe name of the task. Establishes the task execution order.
taskThe task to submit.
Returns
True, if this function did not replace an existing task.
bool kanzi::Scheduler::removeTask ( const string &  name)

Immediately removes a task from the scheduler.

A task may not remove itself.

Parameters
nameThe name of the task to remove.
Returns
True, if a task was removed.
bool kanzi::Scheduler::removeTaskAfterExecution ( const string &  name)

Removes a task from the scheduler after its execution (next or current) ends.

Parameters
nameThe name of the task to remove.
Returns
True, if a task was marked for removal.
void kanzi::Scheduler::executeTasks ( )

Executes all tasks in ascending alphabetical order and removes non-recurring tasks after their execution.

Removal of tasks may be interleaved with execution of other tasks.

void kanzi::Scheduler::debugPrintTasks ( ) const

Prints the tasks to the log.


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