#include <Thread.h>
Definition at line 32 of file Thread.h.
Public Member Functions | |
virtual | ~Thread () |
This is the class destructor, it simply calls detach for cleanup purposes. | |
virtual void | start () |
Call this method when you want to start running your thread, however please note that everytime you call this method, the thread will be spawned again as a totally new instance. | |
virtual void | start (Threading::SchedPolicy pol) |
virtual void | run ()=0 |
Very important You must override this method so you can provide the thread process itself whatever you define this method does, in your subclass is what the thread will start doing when you call start() | |
virtual void | operator() () |
bool | isRunning () |
Use this method to verify if your thread is running;. | |
void | setPriority (int prio) |
Use this method to set the priority for the current scheduling policy. | |
UInt64 | numericID () |
This method will return a 32 bit integer representing the current thread. | |
UInt64 | numericID () const |
const bool | started () |
const bool | terminated () |
const bool | running () |
const bool | joinable () |
void | join () |
void | registerFinalizer (FinalizerCallback *f_cb) |
Registers a new finalization callback to be called when thread finalizes. | |
void | registerCancellationCB (FinalizerCallback *f_cb) |
Registers a new cancellation callback to be called in the event of thread cancellation only. | |
void | callFinalizers () |
Calls each finalizer in reverse registration order. | |
void | callCancellationCallbacks () |
Calls each cancellation callback in reverse registration order. | |
void | removeCancellationCBs () |
Removes all cancellation callbacks without executing them. | |
virtual const char * | getClassName () |
Returns the name of the current class. | |
virtual std::string | toString () |
Static Public Member Functions | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Public Attributes | |
SharedVar< bool > | _started |
Status flag which determinates if the run method has been called from the thread after calling start. | |
SharedVar< bool > | _terminated |
Status flag which determinates if the run method has finished its execution. | |
Protected Member Functions | |
Thread () | |
Default constructor. | |
Protected Attributes | |
bool | _detached |
std::deque< FinalizerCallback * > | finalizers |
Doubly-ended queue which stores finalization callbacks. | |
std::deque< FinalizerCallback * > | cancelCBs |
Doubly-ended queue which stores cancellation callbacks. | |
std::string | __cls_name |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
xvr2::Thread::Thread | ( | ) | [protected] |
Default constructor.
virtual xvr2::Thread::~Thread | ( | ) | [virtual] |
This is the class destructor, it simply calls detach for cleanup purposes.
virtual void xvr2::Thread::start | ( | ) | [virtual] |
Call this method when you want to start running your thread, however please note that everytime you call this method, the thread will be spawned again as a totally new instance.
virtual void xvr2::Thread::start | ( | Threading::SchedPolicy | pol | ) | [virtual] |
virtual void xvr2::Thread::run | ( | ) | [pure virtual] |
Very important
You must override this method so you can provide the thread process itself whatever you define this method does, in your subclass is what the thread will start doing when you call start()
Implemented in xvr2::Pipeline< _Tp >.
virtual void xvr2::Thread::operator() | ( | void | ) | [inline, virtual] |
bool xvr2::Thread::isRunning | ( | ) |
Use this method to verify if your thread is running;.
void xvr2::Thread::setPriority | ( | int | prio | ) |
Use this method to set the priority for the current scheduling policy.
UInt64 xvr2::Thread::numericID | ( | ) |
This method will return a 32 bit integer representing the current thread.
UInt64 xvr2::Thread::numericID | ( | ) | const |
const bool xvr2::Thread::started | ( | ) |
const bool xvr2::Thread::terminated | ( | ) |
const bool xvr2::Thread::running | ( | ) |
const bool xvr2::Thread::joinable | ( | ) |
void xvr2::Thread::join | ( | ) |
void xvr2::ThreadFinalizator::registerFinalizer | ( | FinalizerCallback * | f_cb | ) | [inherited] |
Registers a new finalization callback to be called when thread finalizes.
void xvr2::ThreadFinalizator::registerCancellationCB | ( | FinalizerCallback * | f_cb | ) | [inherited] |
Registers a new cancellation callback to be called in the event of thread cancellation only.
void xvr2::ThreadFinalizator::callFinalizers | ( | ) | [inherited] |
Calls each finalizer in reverse registration order.
void xvr2::ThreadFinalizator::callCancellationCallbacks | ( | ) | [inherited] |
Calls each cancellation callback in reverse registration order.
void xvr2::ThreadFinalizator::removeCancellationCBs | ( | ) | [inherited] |
Removes all cancellation callbacks without executing them.
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
virtual std::string xvr2::Object::toString | ( | ) | [virtual, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
bool xvr2::Thread::_detached [protected] |
std::deque<FinalizerCallback *> xvr2::ThreadFinalizator::finalizers [protected, inherited] |
Doubly-ended queue which stores finalization callbacks.
Definition at line 27 of file ThreadFinalizator.h.
std::deque<FinalizerCallback *> xvr2::ThreadFinalizator::cancelCBs [protected, inherited] |
Doubly-ended queue which stores cancellation callbacks.
Definition at line 29 of file ThreadFinalizator.h.
std::string xvr2::Object::__cls_name [protected, inherited] |