ot::ThreadModule Class Reference

#include <ThreadModule.h>

Inheritance diagram for ot::ThreadModule:

Inheritance graph
[legend]
Collaboration diagram for ot::ThreadModule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ThreadModule ()
virtual ~ThreadModule ()
virtual void start ()
virtual void close ()

Protected Member Functions

void lock ()
void unlock ()
virtual void run ()

Static Protected Member Functions

static void thread_func (void *data)

Protected Attributes

void * thread
ACE_Thread_Mutex * mutex
 Mutex to implement lock, unlock behavior.

Constructor & Destructor Documentation

ot::ThreadModule::ThreadModule  ) 
 

constructor

ot::ThreadModule::~ThreadModule  )  [virtual]
 

destructor


Member Function Documentation

void ot::ThreadModule::close  )  [virtual]
 

closes the module. In this implementation it stops the thread. Be sure to call this method from your subclasses close method to stop the thread !

Reimplemented from ot::Module.

Reimplemented in ot::ARTDataTrackerModule, ot::DynaSightModule, ot::ECGModule, ot::EndoScoutModule, ot::FastTrakModule, ot::FlashpointModule, ot::FOBModule, ot::GPSModule, ot::LinmouseModule, ot::MagicYModule, ot::MedScanModule, ot::MulticastInputModule, ot::NDIModule, ot::OrientationModule, ot::RDSModule, ot::TerasonModule, ot::UltraTrakModule, and ot::TCPModule.

void ot::ThreadModule::lock  )  [protected]
 

enters a critical section. Use this method to protect your operations from another thread. This is not a recursive lock, do not call it several times without unlocking !

virtual void ot::ThreadModule::run  )  [inline, protected, virtual]
 

the work method for the module thread. This is executed by the new module thread. In this class it does nothing but subclasses should override it to add their implementation.

Reimplemented in ot::ARTDataTrackerModule, ot::DynaSightModule, ot::ECGModule, ot::EndoScoutModule, ot::FastTrakModule, ot::FlashpointModule, ot::FOBModule, ot::GPSModule, ot::LinmouseModule, ot::MagicYModule, ot::MedScanModule, ot::MulticastInputModule, ot::NDIModule, ot::OrientationModule, ot::RDSModule, ot::TerasonModule, ot::UltraTrakModule, and ot::TCPModule.

void ot::ThreadModule::start  )  [virtual]
 

This method is called after initialisation is finished and before the main loop is started. In this implementation it starts the thread. Be sure to call this method from your subclasses start method to start the thread !

Reimplemented from ot::Module.

Reimplemented in ot::ARTDataTrackerModule, ot::DynaSightModule, ot::ECGModule, ot::EndoScoutModule, ot::FastTrakModule, ot::FlashpointModule, ot::FOBModule, ot::GPSModule, ot::LinmouseModule, ot::MagicYModule, ot::MedScanModule, ot::MulticastInputModule, ot::NDIModule, ot::OrientationModule, ot::RDSModule, ot::TerasonModule, ot::UltraTrakModule, and ot::TCPModule.

static void ot::ThreadModule::thread_func void *  data  )  [inline, static, protected]
 

static thread function passed to the actual thread. This calls then run on the right instance. Do not use this yourself.

void ot::ThreadModule::unlock  )  [protected]
 

leaves a critical section. Use this method to release the protection.


Member Data Documentation

ACE_Thread_Mutex* ot::ThreadModule::mutex [protected]
 

Mutex to implement lock, unlock behavior.

void* ot::ThreadModule::thread [protected]
 

handle to module specific thread. This is a little bit tricky as we don't use the ACE definition but the same type.


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:29:16 2007 for NaviTrack by  doxygen 1.4.6