TC::MT::Thread Class Reference
[Multithreading]

Interface defining thread which then can start an ThreadObject. More...

#include <TCMTThread.h>

Inheritance diagram for TC::MT::Thread:

Inheritance graph
[legend]
Collaboration diagram for TC::MT::Thread:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ThreadPriority {
  PRIORITY_LOWEST,
  PRIORITY_LOW,
  PRIORITY_NORMAL,
  PRIORITY_HIGH,
  PRIORITY_HIGHEST
}
 The priorities we can give the thread. More...
enum  ThreadState {
  STATE_NEW,
  STATE_RUNNING,
  STATE_TERMINATED
}
 enumeration the different states the thread can have More...

Public Member Functions

virtual ~Thread ()
virtual bool Start (ThreadObjectPtr object_to_start)=0
 Executes the Run method of the ThreadObject in the context of the thread.
virtual bool Join ()=0
 Join causes the calling thread to wait for the threads completion,.
virtual bool IsRunning () const =0
virtual bool IsTerminated () const =0
virtual bool SetPriority (ThreadPriority priority)=0
 Set the priority of the thread.
virtual ThreadPriority GetPriority () const =0
virtual bool SendThreadMessage (MessagePtr message)=0
 Sending Messages between threads.
virtual Message::ReturnValue WaitThreadMessage (MessagePtr &message)=0
 Wait for a message received in this thread.
virtual Message::ReturnValue WaitThreadMessage (MessagePtr &message, uint32 timeout)=0
 Wait for a message received in this thread.


Detailed Description

Interface defining thread which then can start an ThreadObject.

Definition at line 67 of file TCMTThread.h.


Member Enumeration Documentation

The priorities we can give the thread.

Enumerator:
PRIORITY_LOWEST 
PRIORITY_LOW 
PRIORITY_NORMAL 
PRIORITY_HIGH 
PRIORITY_HIGHEST 

Definition at line 71 of file TCMTThread.h.

enumeration the different states the thread can have

Enumerator:
STATE_NEW  thread object exists but thread hasn't started yet.
STATE_RUNNING  thread is running.
STATE_TERMINATED  thread has terminated but storage has not been reclaimed (i.e. waiting to be joined).

Definition at line 81 of file TCMTThread.h.


Constructor & Destructor Documentation

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

Definition at line 94 of file TCMTThread.h.


Member Function Documentation

virtual bool TC::MT::Thread::Start ( ThreadObjectPtr  object_to_start  )  [pure virtual]

Executes the Run method of the ThreadObject in the context of the thread.

Parameters:
object_to_start Pointer to the object which to start
Returns:
if successfully started

virtual bool TC::MT::Thread::Join (  )  [pure virtual]

Join causes the calling thread to wait for the threads completion,.

Returns:
if successfully waited for completion

virtual bool TC::MT::Thread::IsRunning (  )  const [pure virtual]

Returns:
true if thread is running

virtual bool TC::MT::Thread::IsTerminated (  )  const [pure virtual]

Returns:
true if thread is allready terminated

virtual bool TC::MT::Thread::SetPriority ( ThreadPriority  priority  )  [pure virtual]

Set the priority of the thread.

virtual ThreadPriority TC::MT::Thread::GetPriority (  )  const [pure virtual]

Returns:
The thread's priority.

virtual bool TC::MT::Thread::SendThreadMessage ( MessagePtr  message  )  [pure virtual]

Sending Messages between threads.

Send a message to specified thread. The message can be received with WaitThreadMessage The receiver thread has to delete the message

Parameters:
message The message to send to the thread
Returns:
true if send successful

virtual Message::ReturnValue TC::MT::Thread::WaitThreadMessage ( MessagePtr message  )  [pure virtual]

Wait for a message received in this thread.

Parameters:
message The message received or 0 if no
Returns:
true if received a message

virtual Message::ReturnValue TC::MT::Thread::WaitThreadMessage ( MessagePtr message,
uint32  timeout 
) [pure virtual]

Wait for a message received in this thread.

Parameters:
message The message received or 0 if no
timeout Maximum time to wait for the message in milliseconds
Returns:
true if received a message


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

Copyright (c) Thomas Goessler 2003 - 2008