Public Member Functions | Protected Member Functions | Protected Attributes
MAKLogger::DtThreadedObject Class Reference

A Threaded object runs a DtRunnable object in a separate thread. More...

+ Collaboration diagram for MAKLogger::DtThreadedObject:

List of all members.

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.

Protected Attributes

bool myRunningFlag
DtRunnableSP myObject
DtBoost::shared_ptr< DtThread > myThread
DtMutex myMutex

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:
DtInvalidInput

Member Function Documentation

void MAKLogger::DtThreadedObject::join ( )

Block the current thread until the threaded object stops running.

Exceptions:
DtThreadNotStarted
void MAKLogger::DtThreadedObject::setRunnableObject ( DtRunnableSP  newObject)

Set the threadable object to be run.

Exceptions:
DtThreadAlreadyRunning
void MAKLogger::DtThreadedObject::start ( )

Starts the thread running, calls its DtThreadable run method A thread can be started again if it is finished running.


The documentation for this class was generated from the following file:

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)