![]() |
VR-Forces 4.7 Class Documentation
|
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 |
Manages async job objects.
The server must not be deleted before all of its jobs have completed.
|
protected |
|
protected |
| DtAsyncJobServer::DtAsyncJobServer | ( | ) |
CTOR.
|
virtual |
Virtual DTOR.
|
virtual |
Add a job to the queue.
| job | Job 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. |
|
virtual |
Set all jobs to cancelled.
|
virtual |
Set all jobs to cancelled and wait for them to complete.
|
virtual |
Check to see if there are any jobs in the queue.
|
virtual |
Are there currently jobs which are waiting to run or haven't completed?
|
virtual |
Prints async job IDs and status.
|
virtual |
Called each tick, ticks each job.
|
protectedvirtual |
Get the next id.
|
protectedvirtual |
Remove id immediately.
|
protectedvirtual |
DtAsyncJob object added previously has been destroyed.
|
friend |
|
friend |
|
protected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
protected |