Public Member Functions | Protected Attributes
Thread Class Reference

#include <Thread.h>

Inheritance diagram for Thread:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void cancel ()
void join ()
virtual void run ()=0
void setCancelSettings ()
void start (const char *name=0)
void testCancel ()
virtual ~Thread ()

Protected Attributes

TThread m_Thread

Detailed Description

Encapsulates the platform-specific details of a thread.

Every thread of execution in an application is created by instantiating an object of a class derived from the Thread class. These classes must implement the run() method, which specifies the code of the thread.

You may store data local to the thread in the instances of the derived classes, but then you have to make sure, that the instance exists during the whole time of execution. In other words: Do not create local variables of a thread class!

Note:
Currently, this implementation only supports POSIX threads.
Todo:
Add support for other thread libraries.

Some error codes: ESRCH 3 EINVAL 22 EDEADLK 35 EAGAIN 11 e.g. when the is "sleep"ing!

Definition at line 41 of file Thread.h.


Constructor & Destructor Documentation

virtual Thread::~Thread ( ) [inline, virtual]

Definition at line 46 of file Thread.h.


Member Function Documentation

void Thread::cancel ( )

Stops the threads.

Definition at line 60 of file Thread.cpp.

void Thread::join ( )

Wait for the thread to terminate.

Definition at line 102 of file Thread.cpp.

virtual void Thread::run ( ) [pure virtual]

Code to execute in a new thread. Derived classes have to override this method to specify the code that will be executed in a new thread.

Sets the cancel settings of the thread.

Definition at line 114 of file Thread.cpp.

void Thread::start ( const char *  name = 0)

Start the execution of the thread. This method spawns a new thread which executes the run() method of the instance.

Definition at line 38 of file Thread.cpp.

Test, if the thread was canceled.

Definition at line 121 of file Thread.cpp.


Member Data Documentation

Platform-specific handle for a thread.

Definition at line 87 of file Thread.h.


The documentation for this class was generated from the following files:


robbie_architecture
Author(s): Viktor Seib
autogenerated on Mon Oct 6 2014 02:53:09