scheduler::TaskTimeout Class Reference

Timeout task class. More...

#include <scheduler.h>

Inheritance diagram for scheduler::TaskTimeout:

scheduler::Task

List of all members.

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.
TaskTimeoutoperator= (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?


Detailed Description

The TaskTimeout class is a task class whose poll() function yields true when the given number of seconds has elapsed since the creation of the task or its last run.

Constructor & Destructor Documentation

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.

Parameters:
[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.


Member Function Documentation

time_t scheduler::TaskTimeout::timeout ( time_t  timeout  )  [inline]

Sets the interval between two runs.

Parameters:
[in] timeout The new interval between two runs.
Returns:
The new interval between two runs.


The documentation for this class was generated from the following file:
Generated on Fri Apr 18 22:03:29 2008 for Epona API by  doxygen 1.5.3