VizKit  3.3.7
Classes | Public Types | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
VizKit::VisualThreadingManager Class Reference

VisualThreadingManager holds identifiers for currently running threads. More...

#include <VisualThreadingManager.h>

List of all members.

Classes

struct  ThreadItem
 Adds a thread to the manager. More...

Public Types

enum  VisualCriticalRegion {
  downloadQueueSingletonMutex = 0, downloadQueueAccessMutex = 1, addRequestDownloadQueueAccess = 2, stopRequestDownloadQueueAccess = 3,
  notificationQueueSingletonMutex = 4, notificationQueueAccessMutex = 5, inputNotificationQueueAccessMutex = 6, timeStoreSingletonMutex = 7,
  timeStoreAccessMutex = 8, currentTimeAccessMutex = 9, appProcAccessMutex = 10, appCookieAccessMutex = 11,
  appVersionAccessMutex = 12, visualizerAPIVersionAccessMutex = 13, trackPlayPositionAccessMutex = 14, audioDataTimestampIDAccessMutex = 15,
  audioMetaDataAccessMutex = 16, audioMetaDataHistoryIndexAccessMutex = 17, visualItemIdentifierAccessMutex = 18
}
 Identifiers of critical regions in VizKit. More...

Static Public Member Functions

static void dispose (void)
 Disposes the VisualThreadingManager.
static bool createThread (ThreadingFuncPtr aThreadingFuncPtr, void *param=NULL, VisualThreading::ThreadDidDieCallback callbackAfterThreadDidDie=NULL)
 Creates a new thread by calling task function.
static size_t getNumberOfCurrentlyRunningThreads (void)
 Returns the number of currently running threads.
static void update (void)
 Updates the current internal statistics by asking for the status of registered threads.
static void enterCriticalSection (VisualCriticalRegion aCriticalSection)
 Entering a critical section.
static void exitCriticalSection (VisualCriticalRegion aCriticalSection)
 Exiting a critical section.

Private Types

typedef std::vector< ThreadItemThreadVector
 An ThreadVector is a vector of running threads.
typedef ThreadVector::iterator ThreadVectorIterator
 An ThreadVectorIterator is an iterator of a ThreadVector.

Private Member Functions

 VisualThreadingManager ()
 The constructor.
 ~VisualThreadingManager ()
 The destructor.
 VisualThreadingManager (const VisualThreadingManager &other)
 Copy constructor.
VisualThreadingManageroperator= (const VisualThreadingManager &other)
 Assignment operator.

Static Private Member Functions

static VisualThreadingManagergetInstance (void)
 Constructs a VisualThreadingManager.

Private Attributes

ThreadVector threadVector
 The vector with the running threads.
volatile bool terminateAllThreads
 Signal to stop all threads.

Static Private Attributes

static VisualThreadingManagertheVisualThreadingManager = NULL
 VisualThreadingManager is a singleton class.

Detailed Description

VisualThreadingManager holds identifiers for currently running threads.


Member Typedef Documentation

An ThreadVector is a vector of running threads.

typedef ThreadVector::iterator VizKit::VisualThreadingManager::ThreadVectorIterator [private]

An ThreadVectorIterator is an iterator of a ThreadVector.


Member Enumeration Documentation

Identifiers of critical regions in VizKit.

Enumerator:
downloadQueueSingletonMutex 

VisualDownloadQueue initialization.

downloadQueueAccessMutex 

VisualDownloadQueue access or iteration.

addRequestDownloadQueueAccess 

Add to download queue.

stopRequestDownloadQueueAccess 

Remove from download queue.

notificationQueueSingletonMutex 

VisualNotificationQueue initialization.

notificationQueueAccessMutex 

VisualNotificationQueue access or iteration.

inputNotificationQueueAccessMutex 

VisualNotificationQueue access or iteration.

timeStoreSingletonMutex 

Initialization of VisualTiming.

timeStoreAccessMutex 

Access of or iteration over internal map of VisualTiming.

currentTimeAccessMutex 

Access of VisualTiming's currentTime variable.

appProcAccessMutex 

Access of app proc.

appCookieAccessMutex 

Access of app cookie.

appVersionAccessMutex 

Access of app version.

visualizerAPIVersionAccessMutex 

Access of visualizer API version.

trackPlayPositionAccessMutex 

Access of track play position.

audioDataTimestampIDAccessMutex 

Access of audio data timestamp id.

audioMetaDataAccessMutex 

Access of audio meta data.

audioMetaDataHistoryIndexAccessMutex 

Access of audio meta data history index.

visualItemIdentifierAccessMutex 

Access of visual item identifier.


Constructor & Destructor Documentation

The constructor.

VisualThreadingManager is a singleton class. The constructor is private. New instance of class can only be created internally.

The destructor.

VisualThreadingManager is a singleton class. The destructor is private. Instance of class can only be destructed internally.

Copy constructor.

Parameters:
otherAnother VisualNetwork.
Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.

Member Function Documentation

bool VisualThreadingManager::createThread ( ThreadingFuncPtr  aThreadingFuncPtr,
void *  param = NULL,
VisualThreading::ThreadDidDieCallback  callbackAfterThreadDidDie = NULL 
) [static]

Creates a new thread by calling task function.

Parameters:
aThreadingFuncPtrPointer to function that should be started in new thread.
paramOptional name for function-thread. Useful for debugging purposes.
callbackAfterThreadDidDieCallback that is called after the created thread did finished execution.
Returns:
True on success, false on failure.
void VisualThreadingManager::dispose ( void  ) [static]

Disposes the VisualThreadingManager.

Entering a critical section.

Parameters:
aCriticalSectionIdentifier of critical section / critical region.

Exiting a critical section.

Parameters:
aCriticalSectionIdentifier of critical section / critical region.

Constructs a VisualThreadingManager.

The VisualThreadingManager acts as a singleton. Returns a pointer to the initialised VisualThreadingManager.

Returns:
A pointer to the singleton instance.

Returns the number of currently running threads.

Returns:
The number of currently running threads.
VisualThreadingManager& VizKit::VisualThreadingManager::operator= ( const VisualThreadingManager other) [private]

Assignment operator.

Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.
void VisualThreadingManager::update ( void  ) [static]

Updates the current internal statistics by asking for the status of registered threads.


Member Data Documentation

Signal to stop all threads.

VisualThreadingManager is a singleton class.

Pointer to private instance is handled internally.

The vector with the running threads.


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

Generated on Sun May 3 2015 20:26:31 for VizKit by doxygen 1.8.0