#include <Thread.h>

Public Types | |
| enum | EPriority { etNormal = 0, etLow = 1, etHigh = 2, etLower = 3, etHigher = 4, etTimeCritical = 5 } |
Public Member Functions | |
| TThread (EPriority ePriority=etNormal) | |
| TThread (IRunnable &rObj, EPriority ePriority=etNormal) | |
| EPriority | getPriority () const |
| void | setPriority (EPriority ePriority) |
| virtual void | kill (Float64 dTimeOut=0) |
| virtual bool | isAlive () const |
| virtual bool | isDead () const |
| virtual void | resume () |
| virtual bool | signalizeStop (Float64 dTimeOut=5.0) |
| virtual bool | start () |
| virtual void | suspend () |
| virtual bool | yield () |
| virtual Retval | postObject (ISynchronizeObject &rObject, bool bWaitForCompletion) |
| virtual bool MQUALIFIER | isInterrupted () const |
| virtual Uint MQUALIFIER | getThreadID () const |
| virtual Retval MQUALIFIER | askForInterface (Uint uiInterfaceID, IZUnknown *&rpIface) |
| virtual void MQUALIFIER | addRef () const |
| virtual void MQUALIFIER | release () const |
Static Public Member Functions | |
| static void | sleep (const Float &rfDelay) |
Protected Member Functions | |
| virtual | ~TThread () |
| virtual void | execute () |
| virtual void | onTerminated () |
| virtual void | onStarted () |
Protected Attributes | |
| bool | m_bInterrupted |
| Flag to check if the thread should terminate. | |
| TThreadMessageQueue & | m_rQueue |
| Message queue of the thread. | |
| TThread::TThread | ( | EPriority | ePriority = etNormal |
) |
Creates a thread
| ePriority | : Thread priority |
Creates a thread using an external object as executing
| rObj | : Object for execution | |
| ePriority | : Thread priority |
| TThread::~TThread | ( | ) | [protected, virtual] |
Destroys the thread
| TThread::EPriority zeus::TThread::getPriority | ( | ) | const [inline] |
returns the priority of the thread
| void TThread::setPriority | ( | EPriority | ePriority | ) |
sets a new priority of the thread
| ePriority | : new priority |
| void TThread::sleep | ( | const Float & | rfDelay | ) | [static] |
Suspends the thread for a given time in seconds
| void TThread::kill | ( | Float64 | dTimeOut = 0 |
) | [virtual] |
Terminates the thread. If time out is not zero, this method will wait, until the thread terminats itself. If timeout occures, the thread will be forced to terminate. This might cause ressource leaks.
| dTimeOut | : Time out |
Reimplemented in zeus::TAbstractSkel, and zeus::TAbstractSkel::TClientHandlerThread.
| bool zeus::TThread::isAlive | ( | ) | const [inline, virtual] |
Inverse of isDead
| bool zeus::TThread::isDead | ( | ) | const [inline, virtual] |
Checks if the thread is dead. The thread is dead if never start() has been called or after its termination using signalizeStop() or kill().
| true | : Thread is not running | |
| false | : Thread still runs |
| void TThread::resume | ( | ) | [virtual] |
This starts a stopped thread.
| bool TThread::signalizeStop | ( | Float64 | dTimeOut = 5.0 |
) | [virtual] |
Sets the interrupped signal.
Reimplemented in zeus::TPeerFinder, and zeus::TPeerProvider.
| bool TThread::start | ( | ) | [virtual] |
Starts the thread.
| true,: | Thread created and successfully started | |
| false,: | Could not start the thread (OS error) |
| void TThread::suspend | ( | ) | [virtual] |
This stopps a thread. Using resume() the thread can be restarted
| bool TThread::yield | ( | ) | [virtual] |
this method causes the OS to switch to an other thread (scheduling).
| true | : yield has been performed | |
| false,: | could not yield thread |
| Retval TThread::postObject | ( | ISynchronizeObject & | rObject, | |
| bool | bWaitForCompletion | |||
| ) | [virtual] |
this sends a message to the queue of the thread
| bool MQUALIFIER zeus::TThread::isInterrupted | ( | ) | const [inline, virtual] |
| Uint MQUALIFIER TThread::getThreadID | ( | ) | const [virtual] |
| virtual Retval MQUALIFIER zeus::TThread::askForInterface | ( | Uint | uiInterfaceID, | |
| IZUnknown *& | rpIface | |||
| ) | [virtual] |
| virtual void MQUALIFIER zeus::TThread::addRef | ( | ) | const [virtual] |
| virtual void MQUALIFIER zeus::TThread::release | ( | ) | const [virtual] |
| void TThread::execute | ( | ) | [protected, virtual] |
This is the internal running method. Do not call this method directly
Reimplemented in zeus::TPeerFinder, zeus::TPeerProvider, zeus::TAbstractSkel, and zeus::TAbstractSkel::TClientHandlerThread.
| virtual void zeus::TThread::onTerminated | ( | ) | [inline, protected, virtual] |
| virtual void zeus::TThread::onStarted | ( | ) | [inline, protected, virtual] |
bool zeus::TThread::m_bInterrupted [protected] |
Flag to check if the thread should terminate.
TThreadMessageQueue& zeus::TThread::m_rQueue [protected] |
Message queue of the thread.