VR-Forces 4.2 Class Documentation
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
DtCallbackQueue Class Reference

Simple asynchronous callback queue. More...

Public Types

typedef boost::function< void()> Callback

Public Member Functions

 DtCallbackQueue (unsigned maxTasks)
 CTOR.
 ~DtCallbackQueue ()
void add (Callback)
 Add a job to the queue.
bool pop (Callback &)
 Pop a job from the queue, if it's empty block.
bool runOne ()
 Pop and run one job from front of queue.

Private Types

typedef tbb::mutex Mutex
typedef
tbb::interface5::condition_variable 
Condition
typedef
tbb::interface5::unique_lock
< Mutex
Lock
typedef std::list
< boost::shared_ptr
< tbb::tbb_thread > > 
ThreadList
typedef std::list< CallbackCallbackList

Private Member Functions

void execute ()

Private Attributes

Mutex myMutex
Condition myCondition
bool myShutdownFlag
ThreadList myThreads
CallbackList myCallbacks

Detailed Description

Simple asynchronous callback queue.

Member Typedef Documentation

typedef boost::function<void ()> DtCallbackQueue::Callback
typedef tbb::mutex DtCallbackQueue::Mutex
private
typedef tbb::interface5::condition_variable DtCallbackQueue::Condition
private
typedef tbb::interface5::unique_lock<Mutex> DtCallbackQueue::Lock
private
typedef std::list< boost::shared_ptr<tbb::tbb_thread> > DtCallbackQueue::ThreadList
private
typedef std::list<Callback> DtCallbackQueue::CallbackList
private

Constructor & Destructor Documentation

DtCallbackQueue::DtCallbackQueue ( unsigned  maxTasks)
explicit

CTOR.

Parameters
maxTasksmax number of threads.
DtCallbackQueue::~DtCallbackQueue ( )

Member Function Documentation

void DtCallbackQueue::add ( Callback  )

Add a job to the queue.

bool DtCallbackQueue::pop ( Callback )

Pop a job from the queue, if it's empty block.

Returns
bool false if queue is being deleted.
bool DtCallbackQueue::runOne ( )

Pop and run one job from front of queue.

Returns
true if there was a job to run.
void DtCallbackQueue::execute ( )
private

Member Data Documentation

Mutex DtCallbackQueue::myMutex
mutableprivate
Condition DtCallbackQueue::myCondition
mutableprivate
bool DtCallbackQueue::myShutdownFlag
private
ThreadList DtCallbackQueue::myThreads
private
CallbackList DtCallbackQueue::myCallbacks
private

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

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)