SUMO - Simulation of Urban MObility
|
Abstract superclass of a task to be run with an index to keep track of pending tasks. More...
#include <FXWorkerThread.h>
Public Member Functions | |
virtual void | run (FXWorkerThread *context)=0 |
Abstract method which in subclasses should contain the computations to be performed. More... | |
void | setIndex (const int newIndex) |
Sets the running index of this task. More... | |
virtual | ~Task () |
Desctructor. More... | |
Private Attributes | |
int | myIndex |
the index of the task, valid only after the task has been added to the pool More... | |
Abstract superclass of a task to be run with an index to keep track of pending tasks.
Definition at line 54 of file FXWorkerThread.h.
|
inlinevirtual |
Desctructor.
Definition at line 57 of file FXWorkerThread.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 FXWorkerThread. the instance of the thread is then made available via the context parameter.
[in] | context | The thread which runs the task |
Referenced by FXWorkerThread::run().
|
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 75 of file FXWorkerThread.h.
References myIndex.
Referenced by FXWorkerThread::Pool::add().
|
private |
the index of the task, valid only after the task has been added to the pool
Definition at line 80 of file FXWorkerThread.h.
Referenced by setIndex().