last update 20 Sep 2009 |
#include <cvrThread.h>
Inherited by cvr::guiServer::guiServer::guiThread.
Public Member Functions | |
thread () | |
virtual | ~thread () |
virtual void | start () |
virtual void | stop () |
virtual void | join () |
bool | isAlive () const |
bool | representsCalledThread () 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 method 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...)
cvr::thread::thread | ( | ) |
Default constructor.
virtual cvr::thread::~thread | ( | ) | [virtual] |
virtual void cvr::thread::cleanUp | ( | ) | [inline, protected, virtual] |
bool cvr::thread::isAlive | ( | ) | const |
virtual void cvr::thread::join | ( | ) | [virtual] |
bool cvr::thread::representsCalledThread | ( | ) | const |
virtual void cvr::thread::run | ( | ) | [protected, pure virtual] |
Thread execution method.
The whole thread object is somehow just a representation for this method, since the created thread will just call it, (which means will execute the overloaded run() method of the derived class). The thread will also persist as long as this method does, i.e. the thread will stop when the method finishes.
virtual void cvr::thread::start | ( | ) | [virtual] |
virtual void cvr::thread::stop | ( | ) | [virtual] |