#include <scheduler.h>

Public Member Functions | |
| TaskTimeout (time_t timeout, modules::Module *module, std::string const &name="", std::string const &desc="") | |
| Constructor. | |
| TaskTimeout (TaskTimeout const &t) | |
| Copy constructor. | |
| TaskTimeout & | operator= (TaskTimeout const &right) |
| Assignment operator. | |
| virtual bool | poll () |
| Returns true and resets the last time the task was run if the interval has elapsed. | |
| time_t | timeout () const |
| Returns the interval between two runs. | |
| time_t | timeout (time_t timeout) |
| Sets the interval between two runs. | |
| time_t | last_run () const |
| Returns the last time the task was run. | |
Protected Attributes | |
| time_t | m_timeout |
| Interval between two runs. | |
| time_t | m_lastrun |
| When was the task run for the last time? | |
| scheduler::TaskTimeout::TaskTimeout | ( | time_t | timeout, | |
| modules::Module * | module, | |||
| std::string const & | name = "", |
|||
| std::string const & | desc = "" | |||
| ) | [inline] |
This constructor sets the task type and the timeout.
| [in] | timeout | The interval between two runs, in seconds (the first run being done when this amount of time expires). |
| [in] | module | The module this task belongs to. |
| [in] | name | The name of the task, used by some functions who act on tasks by name. Set that if you don't intend to override the name() function. |
| [in] | desc | An arbitrary description of the task. Set that if you don't intend to * override the description() function. |
| time_t scheduler::TaskTimeout::timeout | ( | time_t | timeout | ) | [inline] |
Sets the interval between two runs.
| [in] | timeout | The new interval between two runs. |
1.5.3