OGRE-Next: Ogre::DefaultWorkQueue Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ogre::DefaultWorkQueue Class Reference

Implementation of a general purpose request / response style background work queue. More...

`#include <OgreDefaultWorkQueueTBB.h>`

Inheritance diagram for Ogre::DefaultWorkQueue:
[legend]

## Public Member Functions
| DefaultWorkQueue (const String &name=BLANKSTRING)
| DefaultWorkQueue (const String &name=BLANKSTRING)
virtual | ~DefaultWorkQueue () noexcept(true)
| ~DefaultWorkQueue () override
void | _registerThreadWithRenderSystem ()
| Register the current thread with the rendersystem.
virtual void | _threadMain ()
| Process the next request on the queue.
void | _threadMain () override
| Main function for each thread spawned.
virtual void | shutdown ()
| Shut down the queue.
void | shutdown () override
| Shut down the queue.
virtual void | startup (bool forceRestart=true)
| Start up the queue with the options that have been set.
void | startup (bool forceRestart=true) override
| Start up the queue with the options that have been set.
Public Member Functions inherited from Ogre::DefaultWorkQueueBase
| DefaultWorkQueueBase (const String &name=BLANKSTRING)
| Constructor.
| ~DefaultWorkQueueBase () override
virtual void | _processNextRequest ()
| Process the next request on the queue.
void | abortAllRequests () override
| Abort all previously issued requests.
void | abortPendingRequestsByChannel (uint16 channel) override
| Abort all previously issued requests in a given channel.
void | abortRequest (RequestID id) override
| Abort a previously issued request.
void | abortRequestsByChannel (uint16 channel) override
| Abort all previously issued requests in a given channel.
RequestID | addRequest (uint16 channel, uint16 requestType, const Any &rData, uint8 retryCount=0, bool forceSynchronous=false, bool idleThread=false) override
| Add a new request to the queue.
void | addRequestHandler (uint16 channel, RequestHandler *rh) override
| Add a request handler instance to the queue.
void | addResponseHandler (uint16 channel, ResponseHandler *rh) override
| Add a response handler instance to the queue.
const String & | getName () const
| Get the name of the work queue.
bool | getRequestsAccepted () const override
| Returns whether requests are being accepted right now.
unsigned long | getResponseProcessingTimeLimit () const override
| Get the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit).
virtual bool | getWorkersCanAccessRenderSystem () const
| Get whether worker threads will be allowed to access render system resources.
virtual size_t | getWorkerThreadCount () const
| Get the number of worker threads that this queue will start when startup() is called.
bool | isPaused () const override
| Return whether the queue is paused ie not sending more work to workers.
virtual bool | isShuttingDown () const
| Returns whether the queue is trying to shut down.
void | processResponses () override
| Process the responses in the queue.
void | removeRequestHandler (uint16 channel, RequestHandler *rh) override
| Remove a request handler.
void | removeResponseHandler (uint16 channel, ResponseHandler *rh) override
| Remove a Response handler.
void | setPaused (bool pause) override
| Set whether to pause further processing of any requests.
void | setRequestsAccepted (bool accept) override
| Set whether to accept new requests or not.
void | setResponseProcessingTimeLimit (unsigned long ms) override
| Set the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit).
virtual void | setWorkersCanAccessRenderSystem (bool access)
| Set whether worker threads will be allowed to access render system resources.
virtual void | setWorkerThreadCount (size_t c)
| Set the number of worker threads that this queue will start when startup() is called (default 1).
Public Member Functions inherited from Ogre::WorkQueue
| WorkQueue ()
virtual | ~WorkQueue ()
virtual uint16 | getChannel (const String &channelName)
| Get a channel ID for a given channel name.

## Additional Inherited Members
Public Types inherited from Ogre::WorkQueue
typedef unsigned long long int | RequestID
| Numeric identifier for a request.

## Detailed Description

Implementation of a general purpose request / response style background work queue.

Remarks
  This default implementation of a work queue starts a thread pool and provides queues to process requests.
  This implementation utilises tbb's task system for the WorkQueue implementation.

## Constructor & Destructor Documentation

## ◆ DefaultWorkQueue() [1/2]

Ogre::DefaultWorkQueue::DefaultWorkQueue | ( | const String & | name = BLANKSTRING | ) |

References Ogre::BLANKSTRING.

## ◆ ~DefaultWorkQueue() [1/2]

Ogre::DefaultWorkQueue::~DefaultWorkQueue | ( |  | ) |
| override

## ◆ DefaultWorkQueue() [2/2]

Ogre::DefaultWorkQueue::DefaultWorkQueue | ( | const String & | name = BLANKSTRING | ) |

References Ogre::BLANKSTRING.

## ◆ ~DefaultWorkQueue() [2/2]

virtual Ogre::DefaultWorkQueue::~DefaultWorkQueue | ( |  | ) |
| virtualnoexcept

## Member Function Documentation

## ◆ _registerThreadWithRenderSystem()

void Ogre::DefaultWorkQueue::_registerThreadWithRenderSystem | ( |  | ) |

Register the current thread with the rendersystem.

References _registerThreadWithRenderSystem().

Referenced by _registerThreadWithRenderSystem().

## ◆ _threadMain() [1/2]

virtual void Ogre::DefaultWorkQueue::_threadMain | ( |  | ) |
| virtual

Process the next request on the queue.

Remarks
  This method is public, but only intended for advanced users to call. The only reason you would call this, is if you were using your own thread to drive the worker processing. The thread calling this method will be the thread used to call the RequestHandler. Main function for each thread spawned.

Implements Ogre::DefaultWorkQueueBase.

References _threadMain().

## ◆ _threadMain() [2/2]

void Ogre::DefaultWorkQueue::_threadMain | ( |  | ) |
| overridevirtual

Main function for each thread spawned.

Implements Ogre::DefaultWorkQueueBase.

Referenced by _threadMain().

## ◆ shutdown() [1/2]

virtual void Ogre::DefaultWorkQueue::shutdown | ( |  | ) |
| virtual

Shut down the queue.

Implements Ogre::WorkQueue.

References shutdown().

## ◆ shutdown() [2/2]

void Ogre::DefaultWorkQueue::shutdown | ( |  | ) |
| overridevirtual

Shut down the queue.

Implements Ogre::WorkQueue.

Referenced by shutdown().

## ◆ startup() [1/2]

virtual void Ogre::DefaultWorkQueue::startup | ( | bool | forceRestart = true | ) |
| virtual

Start up the queue with the options that have been set.

Parameters

  forceRestart | If the queue is already running, whether to shut it down and restart.

Implements Ogre::WorkQueue.

References startup().

## ◆ startup() [2/2]

void Ogre::DefaultWorkQueue::startup | ( | bool | forceRestart = true | ) |
| overridevirtual

Start up the queue with the options that have been set.

Parameters

  forceRestart | If the queue is already running, whether to shut it down and restart.

Implements Ogre::WorkQueue.

Referenced by startup().

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

- OgreDefaultWorkQueueStandard.h
- OgreDefaultWorkQueueTBB.h