VizKit  3.0
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

#include <VisualThreadingManager.h>

List of all members.

Classes

struct  ThreadItem

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
}

Static Public Member Functions

static void dispose (void)
static bool createThread (ThreadingFuncPtr aThreadingFuncPtr, void *param=NULL, VisualThreading::ThreadDidDieCallback callbackAfterThreadDidDie=NULL)
static size_t getNumberOfCurrentlyRunningThreads (void)
static void update (void)
static void enterCriticalSection (VisualCriticalRegion aCriticalSection)
static void exitCriticalSection (VisualCriticalRegion aCriticalSection)

Private Types

typedef std::vector< ThreadItemThreadVector
typedef ThreadVector::iterator ThreadVectorIterator

Private Member Functions

 VisualThreadingManager ()
 ~VisualThreadingManager ()
 VisualThreadingManager (const VisualThreadingManager &other)
VisualThreadingManageroperator= (const VisualThreadingManager &other)

Static Private Member Functions

static VisualThreadingManagergetInstance (void)

Private Attributes

ThreadVector threadVector
volatile bool terminateAllThreads

Static Private Attributes

static VisualThreadingManagertheVisualThreadingManager = NULL

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 Mar 25 2012 14:27:43 for VizKit by doxygen 1.8.0