Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

cThread Class Reference

abstract class to support threads More...

#include <thread.h>

Inheritance diagram for cThread:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 cThread ()
 Constructor.
 cThread (const pthread_t &thread, bool main_thread, tTheadState state)
 Fully qualified constructor.
virtual ~cThread ()
 Destructor.
virtual bool Start ()
 Starts a thread.
virtual bool Wait (void *&rv)
 wait for termination
bool IsRunning ()
 return if the thread is running
bool IsMain ()
 return if it is the main thread

Static Public Member Functions

static cThreadGetThread ()
 Get a thread.

Protected Member Functions

virtual void * Run ()=0
 abstract run method to be implemented by childs
virtual void Exit (void *rv)
 terminate the thread

Static Protected Member Functions

static void * Thread (void *param)
 opens a thread

Protected Attributes

pthread_t m_thread
 thread structure
bool m_main
 true => main thread
tTheadState m_state
 state of the thread

Detailed Description

abstract class to support threads


Member Function Documentation

void cThread::Exit void *  rv  )  [protected, virtual]
 

terminate the thread

Parameters:
rv pointer on return value

cThread * cThread::GetThread  )  [static]
 

Get a thread.

Returns:
pointer on thread

bool cThread::Start  )  [virtual]
 

Starts a thread.

Returns:
success

void * cThread::Thread void *  param  )  [static, protected]
 

opens a thread

Parameters:
param thread to be opened
Returns:
pointer on Run method of this thread

bool cThread::Wait void *&  rv  )  [virtual]
 

wait for termination

Parameters:
rv pointer on address of return value
Returns:
success


The documentation for this class was generated from the following files:
Generated on Mon Apr 26 14:38:52 2010 for New Simulator by  doxygen 1.4.4