MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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:

Public Member Functions

 DtThreadedObject (DtRunnableSP ptr, DtString name=0)
 Constructor, pass it owner ship of a DtThreadable object. More...
 
 ~DtThreadedObject ()
 Warning, destructor calls blocking function: stop(true) More...
 
void start ()
 Starts the thread running, calls its DtThreadable run method A thread can be started again if it is finished running. More...
 
void join ()
 Block the current thread until the threaded object stops running. More...
 
void stop (bool block)
 Signal the object to stop, it may not respond Optionally block execution until it stops Calls the DtThreadable run method. More...
 
bool running () const
 Is the thread running. More...
 
bool started () const
 Has the threaded objected started. More...
 
void setRunnableObject (DtRunnableSP newObject)
 Set the threadable object to be run. More...
 
DtRunnableSP runnableObject () const
 Gets the threadable object. More...
 

Protected Member Functions

void setRunning (bool value)
 Change the running state. More...
 

Protected Attributes

bool myRunningFlag
 
DtRunnableSP myObject
 
std::shared_ptr< DtThread > myThread
 
DtString myThreadName
 
DtMutex myMutex
 

Detailed Description

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

Constructor & Destructor Documentation

MAKLogger::DtThreadedObject::DtThreadedObject ( DtRunnableSP  ptr,
DtString  name = 0 
)

Constructor, pass it owner ship of a DtThreadable object.

Exceptions
DtInvalidInput
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
DtThreadNotStarted
DtRunnableSP MAKLogger::DtThreadedObject::runnableObject ( ) const

Gets the threadable object.

bool MAKLogger::DtThreadedObject::running ( ) const

Is the thread running.

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

Set the threadable object to be run.

Exceptions
DtThreadAlreadyRunning
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
DtRunnableSP MAKLogger::DtThreadedObject::myObject
protected
bool MAKLogger::DtThreadedObject::myRunningFlag
protected
std::shared_ptr<DtThread> MAKLogger::DtThreadedObject::myThread
protected
DtString MAKLogger::DtThreadedObject::myThreadName
protected

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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)