Main Page   Class Hierarchy   Compound List   Compound Members  

ArPeriodicTask Class Reference

A periodic task base class. More...

#include <ArPeriodicTask.h>

List of all members.

Public Methods

 ArPeriodicTask ()
 Constructor.

virtual ~ArPeriodicTask ()
 Destructor.

virtual bool invoke ()
 Invoke the task.

virtual void runTask ()=0
 Function to override for the task.

void setRunning (bool yesno)
 Function to set the task's running variable.

bool isRunning ()
 Function to tell if the task is running.


Detailed Description

A periodic task base class.

This class is a base class for running periodic tasks that need to be run in their own thread. Since the tasks are periodic and dont need to be run constantly, they dont need their own thread all the time. Since threads can be a restricted resource, there is this periodic task. The user simply needs to derive their own class from ArPeriodicTask and override the runTask() function. The function is guarenteed to be run in its own thread. It can run as long as it wants and when its done the thread will be released to be used by another ArPeriodicTask that may need it. To run the task, simply call invoke() on it. The invoke() can be called multiple times.

See also ArTaskPool.


The documentation for this class was generated from the following files:
Generated on Tue Nov 12 17:43:59 2002 for Aria by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001