A Threaded object runs a DtRunnable object in a separate thread.
More...
Public Member Functions |
| | DtThreadedObject (DtRunnableSP ptr) |
| | Constructor, pass it owner ship of a DtThreadable object.
|
| | ~DtThreadedObject () |
| | Warning, destructor calls blocking function: stop(true)
|
| void | start () |
| | Starts the thread running, calls its DtThreadable run method A thread can be started again if it is finished running.
|
| void | join () |
| | Block the current thread until the threaded object stops running.
|
| void | stop (bool block) |
| | Signal the object to stop, it may not respond Optionally block execution until it stops Calls the DtThreadable run method.
|
| bool | running () const |
| | Is the thread running.
|
| bool | started () const |
| | Has the threaded objected started.
|
| void | setRunnableObject (DtRunnableSP newObject) |
| | Set the threadable object to be run.
|
| DtRunnableSP | runnableObject () const |
| | Gets the threadable object.
|
Protected Member Functions |
| void | setRunning (bool value) |
| | Change the running state.
|
Detailed Description
A Threaded object runs a DtRunnable object in a separate thread.
Constructor & Destructor Documentation
| MAKLogger::DtThreadedObject::DtThreadedObject |
( |
DtRunnableSP |
ptr | ) |
|
Constructor, pass it owner ship of a DtThreadable object.
- Exceptions
-
| MAKLogger::DtThreadedObject::~DtThreadedObject |
( |
| ) |
|
Warning, destructor calls blocking function: stop(true)
Member Function Documentation
| void MAKLogger::DtThreadedObject::join |
( |
| ) |
|
Block the current thread until the threaded object stops running.
- Exceptions
-
| DtRunnableSP MAKLogger::DtThreadedObject::runnableObject |
( |
| ) |
const |
Gets the threadable object.
| bool MAKLogger::DtThreadedObject::running |
( |
| ) |
const |
| void MAKLogger::DtThreadedObject::setRunnableObject |
( |
DtRunnableSP |
newObject | ) |
|
Set the threadable object to be run.
- Exceptions
-
| void MAKLogger::DtThreadedObject::setRunning |
( |
bool |
value | ) |
|
|
protected |
Change the running state.
| void MAKLogger::DtThreadedObject::start |
( |
| ) |
|
Starts the thread running, calls its DtThreadable run method A thread can be started again if it is finished running.
| bool MAKLogger::DtThreadedObject::started |
( |
| ) |
const |
Has the threaded objected started.
| void MAKLogger::DtThreadedObject::stop |
( |
bool |
block | ) |
|
Signal the object to stop, it may not respond Optionally block execution until it stops Calls the DtThreadable run method.
Member Data Documentation
| DtMutex MAKLogger::DtThreadedObject::myMutex |
|
mutableprotected |
| bool MAKLogger::DtThreadedObject::myRunningFlag |
|
protected |
| DtBoost::shared_ptr<DtThread> MAKLogger::DtThreadedObject::myThread |
|
protected |
The documentation for this class was generated from the following file: