latest version v1.9 - last update 10 Apr 2010 |
#include <ltiThread.h>
Public Member Functions | |
thread () | |
virtual | ~thread () |
virtual void | start () |
virtual void | stop () |
virtual void | join () |
bool | isAlive () const |
bool | representsCalledThread () const |
virtual const char * | getTypeName () const |
Protected Member Functions | |
virtual void | run ()=0 |
virtual void | cleanUp () |
representiation of a system thread (currently a posix thread for Unix systems, and WIN32 thread for windows systems)
If you need a thread, just inherit from this class and reimplement the member run:
class myThread : public thread { protected: void run() { // your thread's job here! } }; ... // somewhere else in your code: myThread aThread; aThread.start(); // do your threads job... // continue with other things (your thread runs in parallel...)
lti::thread::thread | ( | ) |
default constructor
virtual lti::thread::~thread | ( | ) | [virtual] |
virtual void lti::thread::cleanUp | ( | ) | [inline, protected, virtual] |
method to be called when finishing regulary or cancelling the thread; something like a destructor for the run() method
Reimplemented in lti::gtkServer::guiThread.
virtual const char* lti::thread::getTypeName | ( | ) | const [virtual] |
returns the name of this type
Reimplemented from lti::object.
bool lti::thread::isAlive | ( | ) | const |
test if the thread is alive
virtual void lti::thread::join | ( | ) | [virtual] |
wait for thread termination
bool lti::thread::representsCalledThread | ( | ) | const |
virtual void lti::thread::run | ( | ) | [protected, pure virtual] |
method to be called when starting the thread; contains the job the thread has to execute
Implemented in lti::gtkServer::guiThread.
virtual void lti::thread::start | ( | ) | [virtual] |
start thread
Reimplemented in lti::gtkServer::guiThread.
virtual void lti::thread::stop | ( | ) | [virtual] |
forces the thread to stop executing.
overload this function to cleanup things run leaves after cancellation.
Reimplemented in lti::gtkServer::guiThread.