xoreos  0.0.5
Public Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Common::Thread Class Referenceabstract

A class that creates its own thread. More...

#include <thread.h>

Inheritance diagram for Common::Thread:
Inheritance graph
[legend]
Collaboration diagram for Common::Thread:
Collaboration graph
[legend]

Public Member Functions

 Thread ()
 
virtual ~Thread ()
 
bool createThread (const UString &name="")
 
bool destroyThread ()
 

Protected Attributes

boost::atomic< bool > _killThread
 

Private Member Functions

virtual void threadMethod ()=0
 

Static Private Member Functions

static int threadHelper (void *obj)
 

Private Attributes

SDL_Thread * _thread
 
Common::UString _name
 
boost::atomic< bool > _threadRunning
 

Detailed Description

A class that creates its own thread.

Definition at line 44 of file thread.h.

Constructor & Destructor Documentation

◆ Thread()

Common::Thread::Thread ( )

Definition at line 37 of file thread.cpp.

◆ ~Thread()

Common::Thread::~Thread ( )
virtual

Definition at line 40 of file thread.cpp.

References destroyThread().

Here is the call graph for this function:

Member Function Documentation

◆ createThread()

bool Common::Thread::createThread ( const UString name = "")

Definition at line 44 of file thread.cpp.

References _name, _thread, _threadRunning, Common::UString::c_str(), Common::UString::empty(), threadHelper(), and warning().

Referenced by Sound::SoundManager::init(), Events::RequestManager::init(), Graphics::GraphicsManager::init(), and Engines::GameThread::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroyThread()

bool Common::Thread::destroyThread ( )

Definition at line 64 of file thread.cpp.

References _killThread, _name, _thread, _threadRunning, Common::UString::c_str(), and warning().

Referenced by Sound::SoundManager::deinit(), Events::RequestManager::deinit(), Graphics::GraphicsManager::deinit(), Engines::GameThread::~GameThread(), and ~Thread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ threadHelper()

int Common::Thread::threadHelper ( void *  obj)
staticprivate

Definition at line 106 of file thread.cpp.

References _threadRunning, and threadMethod().

Referenced by createThread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ threadMethod()

virtual void Common::Thread::threadMethod ( )
privatepure virtual

Implemented in Sound::SoundManager, Events::RequestManager, Graphics::Aurora::AnimationThread, and Engines::GameThread.

Referenced by threadHelper().

Here is the caller graph for this function:

Member Data Documentation

◆ _killThread

boost::atomic<bool> Common::Thread::_killThread
protected

◆ _name

Common::UString Common::Thread::_name
private

Definition at line 57 of file thread.h.

Referenced by createThread(), and destroyThread().

◆ _thread

SDL_Thread* Common::Thread::_thread
private

Definition at line 56 of file thread.h.

Referenced by createThread(), and destroyThread().

◆ _threadRunning

boost::atomic<bool> Common::Thread::_threadRunning
private

Definition at line 59 of file thread.h.

Referenced by createThread(), destroyThread(), and threadHelper().


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