#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.
|
|
|
Returns the description of the task. It can be used by the program to show information about the running task.
|
|
Returns the name of the task. This name is used by the Scheduler::remove_bytype to remove tasks by type and name.
|
|
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. |
|
Runs the task. Override this function to do whatever you want there.
|
|
Sets the task type.
|