VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
DtAsyncJobServer Class Reference

Manages async job objects. More...

Classes

class  JobListScopeGuard

Public Member Functions

 DtAsyncJobServer ()
 CTOR.
virtual ~DtAsyncJobServer ()
 Virtual DTOR.
virtual boost::shared_ptr
< DtAsyncJobMapEntry
addJob (DtAsyncJob *job)
 Add a job to the queue.
virtual void cancelAllJobs ()
 Set all jobs to cancelled.
virtual void cancelAllJobsAndWait ()
 Set all jobs to cancelled and wait for them to complete.
virtual bool empty () const
 Check to see if there are any jobs in the queue.
virtual bool running () const
 Are there currently jobs which are waiting to run or haven't completed?
virtual void printAsyncJobMap ()
 Prints async job IDs and status.
virtual void tick ()
 Called each tick, ticks each job.

Protected Types

typedef tbb::spin_mutex Mutex
typedef std::list< DtAsyncJob * > JobList

Protected Member Functions

virtual size_t getNextId ()
 Get the next id.
virtual void remove (size_t id)
 Remove id immediately.
virtual void jobDestroyed (DtAsyncJob &)
 DtAsyncJob object added previously has been destroyed.

Protected Attributes

DtAsyncJobMap myAsyncJobMap
Mutex myIdGenMutex
size_t myNextId
Mutex myNumTasksMutex
size_t myNumTasks
Mutex myJobListMutex
JobList myCurrentJobs

Friends

class DtAsyncJobMapEntry
class DtAsyncJob

Detailed Description

Manages async job objects.

The server must not be deleted before all of its jobs have completed.

Member Typedef Documentation

typedef tbb::spin_mutex DtAsyncJobServer::Mutex
protected
typedef std::list<DtAsyncJob*> DtAsyncJobServer::JobList
protected

Constructor & Destructor Documentation

DtAsyncJobServer::DtAsyncJobServer ( )

CTOR.

virtual DtAsyncJobServer::~DtAsyncJobServer ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual boost::shared_ptr<DtAsyncJobMapEntry> DtAsyncJobServer::addJob ( DtAsyncJob job)
virtual

Add a job to the queue.

Parameters
jobJob object to add. Make sure it has been allocated with tbb placement new allocator (see DtAsyncJob documentation). Do not save a pointer to the job object, it cannot be accessed outside of the server after it has been added. Use the returned job map entry object.
Returns
Job map entry object used to communicate with job.
virtual void DtAsyncJobServer::cancelAllJobs ( )
virtual

Set all jobs to cancelled.

virtual void DtAsyncJobServer::cancelAllJobsAndWait ( )
virtual

Set all jobs to cancelled and wait for them to complete.

virtual bool DtAsyncJobServer::empty ( ) const
virtual

Check to see if there are any jobs in the queue.

virtual bool DtAsyncJobServer::running ( ) const
virtual

Are there currently jobs which are waiting to run or haven't completed?

virtual void DtAsyncJobServer::printAsyncJobMap ( )
virtual

Prints async job IDs and status.

virtual void DtAsyncJobServer::tick ( )
virtual

Called each tick, ticks each job.

virtual size_t DtAsyncJobServer::getNextId ( )
protectedvirtual

Get the next id.

virtual void DtAsyncJobServer::remove ( size_t  id)
protectedvirtual

Remove id immediately.

virtual void DtAsyncJobServer::jobDestroyed ( DtAsyncJob )
protectedvirtual

DtAsyncJob object added previously has been destroyed.

Friends And Related Function Documentation

friend class DtAsyncJobMapEntry
friend
friend class DtAsyncJob
friend

Member Data Documentation

DtAsyncJobMap DtAsyncJobServer::myAsyncJobMap
protected
Mutex DtAsyncJobServer::myIdGenMutex
mutableprotected
size_t DtAsyncJobServer::myNextId
protected
Mutex DtAsyncJobServer::myNumTasksMutex
mutableprotected
size_t DtAsyncJobServer::myNumTasks
protected
Mutex DtAsyncJobServer::myJobListMutex
mutableprotected
JobList DtAsyncJobServer::myCurrentJobs
protected

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)