PixelLightAPI  .
Protected Member Functions
PLCore::ThreadImpl Class Reference

Abstract base class for platform specific 'Thread' implementations. More...

#include <ThreadImpl.h>

Inheritance diagram for PLCore::ThreadImpl:
Inheritance graph
[legend]

List of all members.

Protected Member Functions

 ThreadImpl (Thread &cThread)
 Constructor.
virtual ~ThreadImpl ()
 Destructor.
ThreadGetThread () const
 Returns a reference to the owning thread.
virtual handle GetID () const =0
 Returns the unique system ID of the thread.
virtual bool IsActive () const =0
 Returns whether the thread is active.
virtual bool Start ()=0
 Starts the execution of the thread.
virtual bool Terminate ()=0
 Stops the execution of the thread.
virtual bool Join ()=0
 Waits until the thread has been stopped.
virtual bool Join (uint64 nTimeout)=0
 Waits until the thread has been stopped.
virtual uint32 GetPriorityClass () const =0
 Returns the priority class the thread is in.
virtual bool SetPriorityClass (uint32 nPriorityClass)=0
 Sets the priority class the thread is in.
virtual uint32 GetPriority () const =0
 Returns the thread priority within the priority class it is in.
virtual bool SetPriority (uint32 nPriority)=0
 Sets the thread priority within the priority class it is in.

Detailed Description

Abstract base class for platform specific 'Thread' implementations.

Note:
  • Implementation of the bridge design pattern, this class is the implementor of the 'Thread' abstraction

Constructor & Destructor Documentation

PLCore::ThreadImpl::ThreadImpl ( Thread cThread) [protected]

Constructor.

Parameters:
[in]cThreadReference to the owning thread
virtual PLCore::ThreadImpl::~ThreadImpl ( ) [protected, virtual]

Destructor.


Member Function Documentation

Thread& PLCore::ThreadImpl::GetThread ( ) const [protected]

Returns a reference to the owning thread.

Returns:
Reference to the owning thread
virtual handle PLCore::ThreadImpl::GetID ( ) const [protected, pure virtual]

Returns the unique system ID of the thread.

Returns:
Thread ID
virtual bool PLCore::ThreadImpl::IsActive ( ) const [protected, pure virtual]

Returns whether the thread is active.

Returns:
'true' if the thread is active
virtual bool PLCore::ThreadImpl::Start ( ) [protected, pure virtual]

Starts the execution of the thread.

Returns:
'true' if the thread could be started
virtual bool PLCore::ThreadImpl::Terminate ( ) [protected, pure virtual]

Stops the execution of the thread.

Returns:
'true' if the thread could be stopped
Remarks:
Terminates the thread ungracefully (does not allow proper thread clean up!). Instead of using this function you should signal the thread and wait until it has quit by itself. The internal platform implementation may or may not accept this violent act. For example, Androids Bionic doesn't support it and a call of this method will have no effect at all.
virtual bool PLCore::ThreadImpl::Join ( ) [protected, pure virtual]

Waits until the thread has been stopped.

Returns:
'true' if the thread has been stopped
virtual bool PLCore::ThreadImpl::Join ( uint64  nTimeout) [protected, pure virtual]

Waits until the thread has been stopped.

Parameters:
[in]nTimeoutTime in milliseconds to wait
Returns:
'true' if the thread has been stopped
virtual uint32 PLCore::ThreadImpl::GetPriorityClass ( ) const [protected, pure virtual]

Returns the priority class the thread is in.

Returns:
The priority class the thread is in (type: Thread::EPriorityClass)
virtual bool PLCore::ThreadImpl::SetPriorityClass ( uint32  nPriorityClass) [protected, pure virtual]

Sets the priority class the thread is in.

Parameters:
[in]nPriorityClassNew priority class the thread is in (type: Thread::EPriorityClass)
Returns:
'true' if all went fine, else 'false'
virtual uint32 PLCore::ThreadImpl::GetPriority ( ) const [protected, pure virtual]

Returns the thread priority within the priority class it is in.

Returns:
The thread priority within the priority class it is in (type: Thread::EPriority)
virtual bool PLCore::ThreadImpl::SetPriority ( uint32  nPriority) [protected, pure virtual]

Sets the thread priority within the priority class it is in.

Parameters:
[in]nPriorityNew thread priority within the priority class it is in (type: Thread::EPriority)
Returns:
'true' if all went fine, else 'false'

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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:16
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported