My Project
SallyAPI::System::CThread Class Reference

A thread class. Inherite form this class and overwrite the RunEx() method. To start the thread call the Start() method. More...

#include <Thread.h>

Inheritance diagram for SallyAPI::System::CThread:
SallyAPI::Config::CReloadThemeImage SallyAPI::Facebook::CFacebookThread SallyAPI::GUI::CThreadStarter SallyAPI::GUI::CTimer SallyAPI::Network::CHttpSendRequestThread SallyAPI::Sound::CPlaySound SallyAPI::Speech::CSpeechThread SallyAPI::System::CSmartThreadPollManagerThread SallyAPI::System::CSmartThreadPool

List of all members.

Public Member Functions

 CThread ()
 Default constructor.
virtual ~CThread ()
 Destructor.
ThreadStatus GetStatus ()
 Gets the status of the thread. That can either THREAD_STOPPED or THREAD_RUNNING.
virtual void Start ()
 Starts executing the thread. If it is already running, nothing is happening.
virtual void Stop (bool force=false)
 Stops the thread if it is running. This function is returning immediately. To check if the thread is really ended, call GetStatus().
virtual void WaitForStop (bool force=false)
 Wait for stop. This function is returning once the thread is stopped.
std::string GetId ()
 Gets the identifier of this thread. This is a unique id.

Protected Member Functions

virtual void RunEx ()=0
void Run ()
 Runs this thread and is calling RunEx().

Static Protected Member Functions

static DWORD WINAPI Thread (PVOID pvoid)
 Threads.

Protected Attributes

ThreadStatus m_eStatus
HANDLE m_hThread
bool m_bPleaseStop
SallyAPI::System::CCritSection m_Lock
std::string m_strId

Detailed Description

A thread class. Inherite form this class and overwrite the RunEx() method. To start the thread call the Start() method.

Author:
Christian Knobloch
Date:
19.04.2010

Constructor & Destructor Documentation

Default constructor.

Author:
Christian Knobloch
Date:
19.04.2010
CThread::~CThread ( ) [virtual]

Destructor.

Author:
Christian Knobloch
Date:
19.04.2010

Member Function Documentation

std::string CThread::GetId ( )

Gets the identifier of this thread. This is a unique id.

Author:
Christian Knobloch
Date:
09.07.2011
Returns:
The identifier.

Gets the status of the thread. That can either THREAD_STOPPED or THREAD_RUNNING.

Author:
Christian Knobloch
Date:
19.04.2010
Returns:
The status.
void CThread::Run ( ) [protected]

Runs this thread and is calling RunEx().

Author:
Christian Knobloch
Date:
19.04.2010
virtual void SallyAPI::System::CThread::RunEx ( ) [protected, pure virtual]
void CThread::Start ( ) [virtual]

Starts executing the thread. If it is already running, nothing is happening.

Author:
Christian Knobloch
Date:
19.04.2010
void CThread::Stop ( bool  force = false) [virtual]

Stops the thread if it is running. This function is returning immediately. To check if the thread is really ended, call GetStatus().

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
forcetrue to force kill the thread.
DWORD WINAPI CThread::Thread ( PVOID  pvoid) [static, protected]

Threads.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
pvoidThe pvoid.
Returns:
.
void CThread::WaitForStop ( bool  force = false) [virtual]

Wait for stop. This function is returning once the thread is stopped.

Author:
Christian Knobloch
Date:
19.04.2010
Parameters:
forcetrue to force kill the thread.

Member Data Documentation

std::string SallyAPI::System::CThread::m_strId [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines