Eclipse SUMO - Simulation of Urban MObility
|
Abstract superclass of a task to be run with an index to keep track of pending tasks. More...
#include <MFXWorkerThread.h>
Public Member Functions | |
virtual void | run (MFXWorkerThread *context)=0 |
Abstract method which in subclasses should contain the computations to be performed. | |
void | setIndex (const int newIndex) |
Sets the running index of this task. | |
virtual | ~Task () |
Desctructor. | |
Private Attributes | |
int | myIndex |
the index of the task, valid only after the task has been added to the pool | |
Abstract superclass of a task to be run with an index to keep track of pending tasks.
Definition at line 53 of file MFXWorkerThread.h.
|
inlinevirtual |
Desctructor.
Definition at line 56 of file MFXWorkerThread.h.
|
pure virtual |
Abstract method which in subclasses should contain the computations to be performed.
If there is data to be shared among several tasks (but not among several threads) it can be put in the a thread class subclassing the MFXWorkerThread. the instance of the thread is then made available via the context parameter.
[in] | context | The thread which runs the task |
|
inline |
Sets the running index of this task.
Every task receive an index which is unique among all pending tasks of the same thread pool.
[in] | newIndex | the index to assign |
Definition at line 74 of file MFXWorkerThread.h.
References myIndex.
Referenced by MFXWorkerThread::Pool::add().
|
private |
the index of the task, valid only after the task has been added to the pool
Definition at line 79 of file MFXWorkerThread.h.
Referenced by setIndex().