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

Thread Class Reference

#include <thread.h>

Collaboration diagram for Thread:

Collaboration graph
[legend]
List of all members.

Detailed Description

Thread abstraction class.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  THREADEVENT

Public Member Functions

 Thread (ThreadMethod *pkMethod, void *pData, ThreadCallback *pkCallback=0, TaskManager *pkTaskManager=0)
virtual ~Thread ()
ThreadMethodGetThreadMethod ()
void * GetUserData ()
int GetThreadID () const
bool operator< (const Thread &rkThread) const
bool operator== (const Thread &rkThread) const

Public Attributes

bool m_bTerminate
bool m_bTerminated
bool m_bStarted

Protected Attributes

pthread_t m_kThread
void * m_pUserData
int m_iThreadID
TaskManagerm_pkTaskManager
ThreadMethodm_pkMethod
ThreadCallbackm_pkCallback

Static Protected Attributes

int s_iThreadCounter


Member Enumeration Documentation

enum THREADEVENT
 

Events


Constructor & Destructor Documentation

Thread ThreadMethod pkMethod,
void *  pData,
ThreadCallback pkCallback = 0,
TaskManager pkTaskManager = 0
 

Create and start new thread

Parameters:
pkMethod Thread method object
pData User-specified data
pkCallback Callback object recieving thread event notifications
pkTaskManager Task manager owning thread (if any, null otherwise)

virtual ~Thread  )  [virtual]
 

Terminate thread


Member Function Documentation

ThreadMethod* GetThreadMethod  )  [inline]
 

Returns:
Thread method

void* GetUserData  )  [inline]
 

Returns:
User data

int GetThreadID  )  const [inline]
 

Returns:
Thread ID

bool operator< const Thread rkThread  )  const [inline]
 

Needed for dll export of STL containers with UDTs under Win32

bool operator== const Thread rkThread  )  const [inline]
 

Needed for dll export of STL containers with UDTs under Win32


Member Data Documentation

pthread_t m_kThread [protected]
 

Thread identifier/data

void* m_pUserData [protected]
 

User-specified data

int m_iThreadID [protected]
 

Thread ID

TaskManager* m_pkTaskManager [protected]
 

Task manager

ThreadMethod* m_pkMethod [protected]
 

Thread method object

ThreadCallback* m_pkCallback [protected]
 

Callback

int s_iThreadCounter [static, protected]
 

Static counter of all thread objects

bool m_bTerminate
 

Terminate flag

bool m_bTerminated
 

Flag indicating thread has terminated

bool m_bStarted
 

Flag inficating thread has started


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:16 2004 for NeoEngine by doxygen 1.3.5