Scheduler class.
More...
#include <kanzi/core.ui/scheduler/scheduler.hpp>
|
typedef function< void()> | Task |
| Type for scheduled tasks. More...
|
|
Scheduler class.
Represents an ordered set of tasks.
Type for scheduled tasks.
bool kanzi::Scheduler::submitTask |
( |
string_view |
name, |
|
|
Task |
task |
|
) |
| |
Submits a task for one-shot execution.
- Parameters
-
name | The name of the task. Establishes the task execution order. |
task | The task to submit. |
- Returns
- True, if this function did not replace an existing task.
bool kanzi::Scheduler::insertRecurringTask |
( |
string_view |
name, |
|
|
Task |
task |
|
) |
| |
Submits a task for recurring execution.
- Parameters
-
name | The name of the task. Establishes the task execution order. |
task | The task to submit. |
- Returns
- True, if this function did not replace an existing task.
bool kanzi::Scheduler::removeTask |
( |
string_view |
name | ) |
|
Immediately removes a task from the scheduler.
A task may not remove itself.
- Parameters
-
name | The name of the task to remove. |
- Returns
- True, if a task was removed.
bool kanzi::Scheduler::removeTaskAfterExecution |
( |
string_view |
name | ) |
|
Removes a task from the scheduler after its execution (next or current) ends.
- Parameters
-
name | The 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: