OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::DefaultWorkQueue Class Reference

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

#include <OgreDefaultWorkQueueTBB.h>

+ Inheritance diagram for Ogre::DefaultWorkQueue:

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. More...
 
virtual void _threadMain ()
 Process the next request on the queue. More...
 
void _threadMain () override
 Main function for each thread spawned. More...
 
virtual void shutdown ()
 Shut down the queue. More...
 
void shutdown () override
 Shut down the queue. More...
 
virtual void startup (bool forceRestart=true)
 Start up the queue with the options that have been set. More...
 
void startup (bool forceRestart=true) override
 Start up the queue with the options that have been set. More...
 
- Public Member Functions inherited from Ogre::DefaultWorkQueueBase
 DefaultWorkQueueBase (const String &name=BLANKSTRING)
 Constructor. More...
 
 ~DefaultWorkQueueBase () override
 
virtual void _processNextRequest ()
 Process the next request on the queue. More...
 
void abortAllRequests () override
 Abort all previously issued requests. More...
 
void abortPendingRequestsByChannel (uint16 channel) override
 Abort all previously issued requests in a given channel. More...
 
void abortRequest (RequestID id) override
 Abort a previously issued request. More...
 
void abortRequestsByChannel (uint16 channel) override
 Abort all previously issued requests in a given channel. More...
 
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. More...
 
void addRequestHandler (uint16 channel, RequestHandler *rh) override
 Add a request handler instance to the queue. More...
 
void addResponseHandler (uint16 channel, ResponseHandler *rh) override
 Add a response handler instance to the queue. More...
 
const StringgetName () const
 Get the name of the work queue. More...
 
bool getRequestsAccepted () const override
 Returns whether requests are being accepted right now. More...
 
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). More...
 
virtual bool getWorkersCanAccessRenderSystem () const
 Get whether worker threads will be allowed to access render system resources. More...
 
virtual size_t getWorkerThreadCount () const
 Get the number of worker threads that this queue will start when startup() is called. More...
 
bool isPaused () const override
 Return whether the queue is paused ie not sending more work to workers. More...
 
virtual bool isShuttingDown () const
 Returns whether the queue is trying to shut down. More...
 
void processResponses () override
 Process the responses in the queue. More...
 
void removeRequestHandler (uint16 channel, RequestHandler *rh) override
 Remove a request handler. More...
 
void removeResponseHandler (uint16 channel, ResponseHandler *rh) override
 Remove a Response handler. More...
 
void setPaused (bool pause) override
 Set whether to pause further processing of any requests. More...
 
void setRequestsAccepted (bool accept) override
 Set whether to accept new requests or not. More...
 
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). More...
 
virtual void setWorkersCanAccessRenderSystem (bool access)
 Set whether worker threads will be allowed to access render system resources. More...
 
virtual void setWorkerThreadCount (size_t c)
 Set the number of worker threads that this queue will start when startup() is called (default 1). More...
 
- 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. More...
 

Additional Inherited Members

- Public Types inherited from Ogre::WorkQueue
typedef unsigned long long int RequestID
 Numeric identifier for a request. More...
 

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)

◆ ~DefaultWorkQueue() [1/2]

Ogre::DefaultWorkQueue::~DefaultWorkQueue ( )
override

◆ DefaultWorkQueue() [2/2]

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

◆ ~DefaultWorkQueue() [2/2]

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

Member Function Documentation

◆ _registerThreadWithRenderSystem()

void Ogre::DefaultWorkQueue::_registerThreadWithRenderSystem ( )

Register the current thread with the rendersystem.

◆ _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.

◆ _threadMain() [2/2]

void Ogre::DefaultWorkQueue::_threadMain ( )
overridevirtual

Main function for each thread spawned.

Implements Ogre::DefaultWorkQueueBase.

◆ shutdown() [1/2]

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

Shut down the queue.

Implements Ogre::WorkQueue.

◆ shutdown() [2/2]

void Ogre::DefaultWorkQueue::shutdown ( )
overridevirtual

Shut down the queue.

Implements Ogre::WorkQueue.

◆ startup() [1/2]

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

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

Parameters
forceRestartIf the queue is already running, whether to shut it down and restart.

Implements Ogre::WorkQueue.

◆ startup() [2/2]

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

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

Parameters
forceRestartIf the queue is already running, whether to shut it down and restart.

Implements Ogre::WorkQueue.


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