My Project
|
A thread class. Inherite form this class and overwrite the RunEx() method. To start the thread call the Start() method. More...
#include <Thread.h>
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 |
A thread class. Inherite form this class and overwrite the RunEx() method. To start the thread call the Start() method.
CThread::CThread | ( | ) |
Default constructor.
CThread::~CThread | ( | ) | [virtual] |
Destructor.
std::string CThread::GetId | ( | ) |
Gets the identifier of this thread. This is a unique id.
Gets the status of the thread. That can either THREAD_STOPPED or THREAD_RUNNING.
void CThread::Run | ( | ) | [protected] |
Runs this thread and is calling RunEx().
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.
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().
force | true to force kill the thread. |
DWORD WINAPI CThread::Thread | ( | PVOID | pvoid | ) | [static, protected] |
Threads.
pvoid | The pvoid. |
void CThread::WaitForStop | ( | bool | force = false | ) | [virtual] |
Wait for stop. This function is returning once the thread is stopped.
force | true to force kill the thread. |
bool SallyAPI::System::CThread::m_bPleaseStop [protected] |
ThreadStatus SallyAPI::System::CThread::m_eStatus [protected] |
HANDLE SallyAPI::System::CThread::m_hThread [protected] |
std::string SallyAPI::System::CThread::m_strId [protected] |