#include <scheduler.h>
Inheritance diagram for scheduler::Task:
Public Types | |
enum | { rOK = 0x0, rSlept = 0x1, rRemove = 0x2, rFree = (rRemove | 0x4) } |
Possible return value bits for run(). More... | |
Public Member Functions | |
Task (int type) | |
Constructor setting the task type. | |
Task (Task const &t) | |
Copy constructor. | |
virtual Task & | operator= (Task const &right) |
Assignment operator. | |
virtual | ~Task () |
Destructor. | |
virtual bool | poll ()=0 |
Determines whether the task should be run. | |
virtual int | run ()=0 |
Runs the task. | |
virtual std::string | description () const=0 |
Returns the description of the task. | |
virtual std::string | name () const=0 |
Returns the name of the task. | |
virtual int | type () const |
Returns the task type. | |
virtual int | type (int type) |
Sets the task type. | |
Protected Attributes | |
int | m_type |
The task type. |
This class must not be used directly; instead, you must inherit it and override the abstract functions.
anonymous enum |
virtual bool scheduler::Task::poll | ( | ) | [pure virtual] |
Determines whether the task should be run. This function is called periodically by the Scheduler object to which the class has been added.
Implemented in scheduler::TaskAlways, scheduler::TaskTimeout, and scheduler::TaskStep.
virtual int scheduler::Task::run | ( | ) | [pure virtual] |
virtual std::string scheduler::Task::description | ( | ) | const [pure virtual] |
Returns the description of the task. It can be used by the program to show information about the running task.
virtual std::string scheduler::Task::name | ( | ) | const [pure virtual] |
Returns the name of the task. This name is used by the Scheduler::remove_bytype to remove tasks by type and name.
virtual int scheduler::Task::type | ( | int | type | ) | [inline, virtual] |
Sets the task type.
[in] | type | The new task type. |