Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::ThreadManager Class Reference

#include <ThreadManager.h>

List of all members.

Static Public Member Functions

static void create ()
 This creates the singleton instance of the ThreadManager.
static void terminate ()
 This destroys the singleton instance of the ThreadManager.
static ThreadgetCurrentThread ()
 Returns the current Thread object associated with the calling thread.
static RunLoopPtr::Shared getCurrentRunLoop ()
 Convenience function for retrieving the current thread's run loop.
static Waitable::WaitResult wait (std::vector< Waitable * > &waitObjects, std::vector< Waitable * > &signaledObjects, uint32 timeoutInMilliseconds)
 Allows you to wait on 1 or more wait objects till one of them becomes signaled.
static Waitable::WaitResult wait (std::vector< Waitable * > &waitObjects, std::vector< Waitable * > &signaledObjects)
static void addThread (Thread *thread)
static void removeThread (Thread *thread)

Protected Member Functions

void internal_addThread (Thread *thread)
void internal_removeThread (Thread *thread)

Protected Attributes

std::map< uint32, Thread * > threads_
Mutex mtx_
ThreadManagerPeerpeer_

Static Protected Attributes

static ThreadManagerthreadManagerInstance


Member Function Documentation

static void VCF::ThreadManager::addThread Thread thread  )  [static]
 

static void VCF::ThreadManager::create  )  [static]
 

This creates the singleton instance of the ThreadManager.

static RunLoopPtr::Shared VCF::ThreadManager::getCurrentRunLoop  )  [static]
 

Convenience function for retrieving the current thread's run loop.

Equivalent to calling

    RunLoop* runLoop = ThreadManager::getCurrentThread()->getRunLoop();

Returns:
RunLoop - the run loop instance of the current thread.
See also:
Thread::getRunLoop

static Thread* VCF::ThreadManager::getCurrentThread  )  [static]
 

Returns the current Thread object associated with the calling thread.

Depending on the platform, this gets the calling thread's ID and looks up the associated Thread object that is registered with the ThreadManager.

For Win32 - see GetCurrentThreadId() For Unix/Posix systems - see pthread_self For Mac OSX - see MPCurrentTaskID

void VCF::ThreadManager::internal_addThread Thread thread  )  [protected]
 

void VCF::ThreadManager::internal_removeThread Thread thread  )  [protected]
 

static void VCF::ThreadManager::removeThread Thread thread  )  [static]
 

static void VCF::ThreadManager::terminate  )  [static]
 

This destroys the singleton instance of the ThreadManager.

static Waitable::WaitResult VCF::ThreadManager::wait std::vector< Waitable * > &  waitObjects,
std::vector< Waitable * > &  signaledObjects
[static]
 

static Waitable::WaitResult VCF::ThreadManager::wait std::vector< Waitable * > &  waitObjects,
std::vector< Waitable * > &  signaledObjects,
uint32  timeoutInMilliseconds
[static]
 

Allows you to wait on 1 or more wait objects till one of them becomes signaled.

The duration of the wait is specified in milliseconds.

When the function returns, the signaledObjects will contain a list of signaled objects

Parameters:
std::vector<Waitable*> a vector of Waitable* objects to
std::vector<Waitable*> 
uint32 the duration to wait before returning from the call. If the duration is exceeded the return value will be Waitable::wrTimedOut
Returns:
Waitable::WaitResult


Member Data Documentation

Mutex VCF::ThreadManager::mtx_ [protected]
 

ThreadManagerPeer* VCF::ThreadManager::peer_ [protected]
 

ThreadManager* VCF::ThreadManager::threadManagerInstance [static, protected]
 

std::map<uint32, Thread*> VCF::ThreadManager::threads_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information