|
Code_TYMPAN
4.4.0
Industrial site acoustic simulation
|
Task of a threads collection. More...
#include <threading.h>


Public Member Functions | |
| OTask () | |
| Default constructor. More... | |
| virtual | ~OTask () |
| Destructor : waits for the end of the task to destroy it. More... | |
| bool | isRunning () const |
| Return true if the task is running, false otherwise. More... | |
| bool | isCompleted () const |
| Return true if the task is completed, false otherwise. More... | |
| bool | isCanceled () const |
| Return true if the task has been cancelled, false otherwise. More... | |
| virtual void | main ()=0 |
| Main routine of the task. This pure virtual method should be overloaded into an inherited class to describe the task to do. More... | |
| void | reset () |
| Reset the task status (_running=false and _completed=false) More... | |
| OTask () | |
| Default constructor. More... | |
| virtual | ~OTask () |
| Destructor : waits for the end of the task to destroy it. More... | |
| bool | isRunning () const |
| bool | isCompleted () const |
| bool | isCanceled () const |
| virtual void | main ()=0 |
| void | reset () |
Public Member Functions inherited from IRefCount | |
| IRefCount () | |
| virtual | ~IRefCount () |
| virtual int | incRef () |
| virtual int | decRef () |
| int | getRefCount () const |
Protected Attributes | |
| bool | _running |
| Running flag. More... | |
| bool | _completed |
| Completed flag. More... | |
| bool | _canceled |
| Cancel flag. More... | |
Protected Attributes inherited from IRefCount | |
| int | m_refCount |
| The reference counter. More... | |
Friends | |
| class | OSlaveThread |
| class | OThreadPool |
Task of a threads collection.
This abstract class encapsulates a primitive task which can be run in a threads collections. It is necessary to overload it by the implementation of a pure virtual methode OTask::main which defines the task to run. A task is pushed into the threads collection with the OThreadPool::push method, which starts as soon as a thread is available. A task can't be cancelled after its run.
Definition at line 167 of file threading.h.
| OTask::OTask | ( | ) |
Default constructor.
Definition at line 67 of file threading.cpp.
|
virtual |
Destructor : waits for the end of the task to destroy it.
Definition at line 69 of file threading.cpp.

| OTask::OTask | ( | ) |
Default constructor.
|
virtual |
Destructor : waits for the end of the task to destroy it.
| bool OTask::isCanceled | ( | ) | const |
Return true if the task has been cancelled, false otherwise.
Definition at line 89 of file threading.cpp.

| bool OTask::isCanceled | ( | ) | const |
| bool OTask::isCompleted | ( | ) | const |
Return true if the task is completed, false otherwise.
Definition at line 83 of file threading.cpp.

| bool OTask::isCompleted | ( | ) | const |
| bool OTask::isRunning | ( | ) | const |
Return true if the task is running, false otherwise.
Definition at line 77 of file threading.cpp.
| bool OTask::isRunning | ( | ) | const |
|
pure virtual |
| void OTask::reset | ( | void | ) |
Reset the task status (_running=false and _completed=false)
Definition at line 95 of file threading.cpp.

| void OTask::reset | ( | ) |
|
friend |
Definition at line 217 of file threading.h.
|
friend |
Definition at line 218 of file threading.h.
|
protected |
Cancel flag.
Definition at line 215 of file threading.h.
|
protected |
Completed flag.
Definition at line 212 of file threading.h.
|
protected |
Running flag.
Definition at line 209 of file threading.h.