ot::ThreadModule Class Reference
#include <ThreadModule.h>
Inheritance diagram for ot::ThreadModule:


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 |
Detailed Description
Definition at line 70 of file ThreadModule.h.
Constructor & Destructor Documentation
| ot::ThreadModule::ThreadModule | ( | ) |
| ot::ThreadModule::~ThreadModule | ( | ) | [virtual] |
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::ARToolKitModule, ot::DynaSightModule, ot::FastTrakModule, ot::FOBModule, ot::GPSModule, ot::JoystickModule, ot::LinmouseModule, ot::MagicYModule, ot::MulticastInputModule, ot::OpenVideoModule, ot::SpaceMouseModule, ot::UltraTrakModule, and ot::TCPModule.
Definition at line 101 of file ThreadModule.cxx.
References thread.
Referenced by ot::GPSModule::close().
| 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 !
Definition at line 62 of file ThreadModule.cxx.
References mutex.
Referenced by ot::UltraTrakModule::close(), ot::SpaceMouseModule::close(), ot::MulticastInputModule::close(), ot::MagicYModule::close(), ot::JoystickModule::close(), ot::FOBModule::close(), ot::FastTrakModule::close(), ot::DynaSightModule::close(), ot::ARTDataTrackerModule::close(), ot::GPSSource::newData(), ot::GPSInfoSource::newData(), ot::GPSGarminCompass::newData(), ot::GPSGarminAltitude::newData(), ot::GPSDirectionSource::newData(), ot::JoystickModule::pollJoysticks(), ot::SpaceMouseModule::processMessages(), ot::TCPModule::pullEvent(), ot::UltraTrakModule::pushEvent(), ot::SpaceMouseModule::pushEvent(), ot::MulticastInputModule::pushEvent(), ot::MagicYModule::pushEvent(), ot::JoystickModule::pushEvent(), ot::FOBModule::pushEvent(), ot::FastTrakModule::pushEvent(), ot::DynaSightModule::pushEvent(), ot::ARTDataTrackerModule::pushEvent(), ot::UltraTrakModule::run(), ot::TCPModule::run(), ot::MulticastInputModule::run(), ot::MagicYModule::run(), ot::FOBModule::run(), ot::FastTrakModule::run(), ot::DynaSightModule::run(), ot::ARTDataTrackerModule::run(), and ot::FastTrakModule::setButtonIT().
| 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::ARToolKitModule, ot::DynaSightModule, ot::FastTrakModule, ot::FOBModule, ot::GPSModule, ot::JoystickModule, ot::LinmouseModule, ot::MagicYModule, ot::MulticastInputModule, ot::OpenVideoModule, ot::SpaceMouseModule, ot::UltraTrakModule, and ot::TCPModule.
Definition at line 93 of file ThreadModule.h.
| 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::ARToolKitModule, ot::DynaSightModule, ot::FastTrakModule, ot::FOBModule, ot::GPSModule, ot::JoystickModule, ot::LinmouseModule, ot::MagicYModule, ot::MulticastInputModule, ot::OpenVideoModule, ot::SpaceMouseModule, ot::UltraTrakModule, and ot::TCPModule.
Definition at line 90 of file ThreadModule.cxx.
References thread, and thread_func().
Referenced by ot::UltraTrakModule::start(), ot::TCPModule::start(), ot::SpaceMouseModule::start(), ot::OpenVideoModule::start(), ot::MulticastInputModule::start(), ot::MagicYModule::start(), ot::JoystickModule::start(), ot::GPSModule::start(), ot::FOBModule::start(), ot::FastTrakModule::start(), ot::DynaSightModule::start(), and ot::ARTDataTrackerModule::start().
| 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.
Definition at line 97 of file ThreadModule.h.
Referenced by start().
| void ot::ThreadModule::unlock | ( | ) | [protected] |
leaves a critical section.
Use this method to release the protection.
Definition at line 69 of file ThreadModule.cxx.
References mutex.
Referenced by ot::UltraTrakModule::close(), ot::SpaceMouseModule::close(), ot::MulticastInputModule::close(), ot::MagicYModule::close(), ot::JoystickModule::close(), ot::FOBModule::close(), ot::FastTrakModule::close(), ot::DynaSightModule::close(), ot::ARTDataTrackerModule::close(), ot::GPSSource::newData(), ot::GPSInfoSource::newData(), ot::GPSGarminCompass::newData(), ot::GPSGarminAltitude::newData(), ot::GPSDirectionSource::newData(), ot::JoystickModule::pollJoysticks(), ot::SpaceMouseModule::processMessages(), ot::TCPModule::pullEvent(), ot::UltraTrakModule::pushEvent(), ot::SpaceMouseModule::pushEvent(), ot::MulticastInputModule::pushEvent(), ot::MagicYModule::pushEvent(), ot::JoystickModule::pushEvent(), ot::FOBModule::pushEvent(), ot::FastTrakModule::pushEvent(), ot::DynaSightModule::pushEvent(), ot::ARTDataTrackerModule::pushEvent(), ot::UltraTrakModule::run(), ot::TCPModule::run(), ot::MulticastInputModule::run(), ot::MagicYModule::run(), ot::FOBModule::run(), ot::FastTrakModule::run(), ot::DynaSightModule::run(), ot::ARTDataTrackerModule::run(), and ot::FastTrakModule::setButtonIT().
Member Data Documentation
ACE_Thread_Mutex* ot::ThreadModule::mutex [protected] |
Mutex to implement lock, unlock behavior.
Definition at line 79 of file ThreadModule.h.
Referenced by lock(), ThreadModule(), unlock(), and ~ThreadModule().
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.
Definition at line 76 of file ThreadModule.h.
The documentation for this class was generated from the following files: