#include <scheduler.h>
Public Types | |
typedef std::list< Task * > | list_type |
Type of the list of tasks. | |
Public Member Functions | |
Scheduler () | |
Default constructor. | |
Scheduler (Scheduler const &s) | |
Copy constructor. | |
Scheduler & | operator= (Scheduler const &right) |
Assignment operator. | |
int | register_type () |
Registers a task type. | |
bool | add (Task &task) |
Adds a task. | |
bool | remove (Task &task) |
Removes a task. | |
list_type::size_type | remove_bytype (int type) |
Removes all tasks of a given type. | |
list_type::size_type | remove_byname (int type, std::string const &name) |
Removes all tasks with the given name and type. | |
bool | run () |
Runs tasks. | |
list_type::size_type | run_bytype (int type) |
Runs tasks of the given type. | |
list_type::size_type | run_byname (int type, std::string const &name) |
Runs tasks with the given name and type. | |
list_type const & | tasks () const |
Returns the list of tasks. | |
Task const * | current_task () const |
Returns the current task being run by the scheduler (0 if none). |
|
Adds a task to the list of scheduled tasks.
|
|
Registers a task type.
|
|
Removes a task from the list of scheduled tasks.
|
|
Removes all tasks with the given name and type from the list of scheduled tasks. operator delete is called for each removed task.
|
|
Removes all tasks of a given type from the list of scheduled tasks. operator delete is called for each removed task.
|
|
Iterates once in the list of tasks, calling Task::poll() on each task. For tasks that need to be run, Task::run() is called, and the task is either removed or left alone depending on the return value.
|
|
Iterates once in the list of tasks, calling Task::run() on each task with the given name and type. The task is either removed or left alone depending on the return value. Task::poll() is NOT called to determine whether the task should be run or not.
|
|
Iterates once in the list of tasks, calling Task::run() on each task of the given type. The task is either removed or left alone depending on the return value. Task::poll() is NOT called to determine whether the task should be run or not.
|