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

AxPipe::CThreadMain< T > Class Template Reference

a Template class that will create a thread for a method virtual int Main() More...

#include <CSync.h>

Inheritance diagram for AxPipe::CThreadMain< T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CThreadMain ()
 Create thread and set priority.

virtual ~CThreadMain ()
 Wait for the worker thread to terminate, then close handles etc.

void Run ()
 Start the thread running.

void Wait ()
 Wait for the worker thread to end - called from outside worker thread, Obviously.


Private Member Functions

virtual int Main ()
 The main() of the thread, derived classes must override.


Static Private Member Functions

DWORD WINAPI Main (LPVOID lpParam)
 static helper to get back into the class after starting the thread Calls the virtual Main(), returns the result of that as the thread exit code.


Private Attributes

DWORD m_dwThreadId
 The ThreadId of the started thread.

HANDLE m_hThread
 Handle to the worker thread.


Detailed Description

template<class T>
class AxPipe::CThreadMain< T >

a Template class that will create a thread for a method virtual int Main()

Definition at line 89 of file CSync.h.


Constructor & Destructor Documentation

template<class T>
AxPipe::CThreadMain< T >::CThreadMain  )  [inline]
 

Create thread and set priority.

The thread will not start, it is created initially suspended. Use CThreadMain::Run() to start it.

Definition at line 115 of file CSync.h.


Member Function Documentation

template<class T>
virtual int AxPipe::CThreadMain< T >::Main  )  [inline, private, virtual]
 

The main() of the thread, derived classes must override.

A separate thread will be started, calling this function and returning it's return value as the thread exit code.

Returns:
The thread exit code

Reimplemented in AxPipe::CThread< T >, AxPipe::CThreadSource< T >, and AxPipe::CThread< CSink >.

Definition at line 106 of file CSync.h.

template<class T>
DWORD WINAPI AxPipe::CThreadMain< T >::Main LPVOID  lpParam  )  [inline, static, private]
 

static helper to get back into the class after starting the thread Calls the virtual Main(), returns the result of that as the thread exit code.

Parameters:
lpParam the 'this' pointer of the class containing the worker thread.

Definition at line 96 of file CSync.h.


The documentation for this class was generated from the following file:
Generated on Mon Feb 2 13:19:29 2004 for AxPipe by doxygen 1.3.5