VR-Link API Documentation for HLA 1516
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

Abstract Threading Class Provides a system independent thread object. More...

+ Collaboration diagram for DtThread:

List of all members.

Public Member Functions

 DtThread (DtThreadStart *)
 Constructor.
virtual ~DtThread ()
 Destructor.
virtual DtThreadStatus start ()
 Over-ride run to implement thread execution.
DtThreadStatus startInCurrentThread ()
 Execute within the current thread ( does not start a new thread )
void stop (bool blocking)
 Signals Thread to stop.
bool hasStarted () const
 Has the thread been started.
bool isRunning () const
 Is thread still active? This is true once the thread has actually started executing.
DtThreadStatus join () const
 Wait for thread to finish (blocking).
DtThreadHandle threadId () const
 Get the thread's ID.
void run ()

Static Public Member Functions

static DtThreadId GetCurrentThreadHandle ()
 Return a unique id for the current thread (useful for thread-specific mapping)

Protected Member Functions

bool stopped ()
 Has stop() been called?

Protected Attributes

DtThreadHandle myThreadID
 System Independent Thread Handle.

Private Member Functions

 DtThread (const DtThread &orig)
 Copy Ctor and Assign Op. undefined for threads.
DtThreadoperator= (const DtThread &orig)

Private Attributes

volatile bool myTimeToStop
 Stop Flag.
bool myRunning
 Active status Flag.
DtThreadStartmyThreadStart
DtMutex myMutex
 Shared lock for protecting critical sections.

Detailed Description

Abstract Threading Class Provides a system independent thread object.


Constructor & Destructor Documentation

Constructor.

virtual DtThread::~DtThread ( ) [virtual]

Destructor.

DtThread::DtThread ( const DtThread orig) [private]

Copy Ctor and Assign Op. undefined for threads.


Member Function Documentation

Return a unique id for the current thread (useful for thread-specific mapping)

bool DtThread::hasStarted ( ) const

Has the thread been started.

This true for all times after start() has been called including when the thread has stopped on it's own. The running flag will be set to false after a thread has stopped.

bool DtThread::isRunning ( ) const

Is thread still active? This is true once the thread has actually started executing.

Immediately after start this will still return false. When

Wait for thread to finish (blocking).

DtThread& DtThread::operator= ( const DtThread orig) [private]
void DtThread::run ( )
virtual DtThreadStatus DtThread::start ( ) [virtual]

Over-ride run to implement thread execution.

Execute within the current thread ( does not start a new thread )

void DtThread::stop ( bool  blocking)

Signals Thread to stop.

  • Stopped() will return true after call to Stop()
  • User-defined Run method must test Stopped() to accept stop command
bool DtThread::stopped ( ) [protected]

Has stop() been called?

  • Run() should test Stopped() and halt when true
DtThreadHandle DtThread::threadId ( ) const [inline]

Get the thread's ID.


Member Data Documentation

DtMutex DtThread::myMutex [mutable, private]

Shared lock for protecting critical sections.

  • lock is mutable since it may be used in const members
bool DtThread::myRunning [private]

Active status Flag.

System Independent Thread Handle.

volatile bool DtThread::myTimeToStop [private]

Stop Flag.


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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)