Ogre::WorkQueue::RequestHandler Class Referenceabstract

Interface definition for a handler of requests. More...

`#include <OgreWorkQueue.h>`

Inheritance diagram for Ogre::WorkQueue::RequestHandler:
[legend]

## Public Member Functions

| RequestHandler ()
virtual | ~RequestHandler ()
virtual bool | canHandleRequest (const Request *req, const WorkQueue *srcQ)
| Return whether this handler can process a given request. More...
virtual Response * | handleRequest (const Request *req, const WorkQueue *srcQ)=0
| The handler method every subclass must implement. More...

## Detailed Description

Interface definition for a handler of requests.

Remarks
  User classes are expected to implement this interface in order to process requests on the queue. It's important to realise that the calls to this class may be in a separate thread to the main render context, and as such it may not be possible to make rendersystem or other GPU-dependent calls in this handler. You can only do so if the queue was created with 'workersCanAccessRenderSystem' set to true, and OGRE_THREAD_SUPPORT=1, but this puts extra strain on the thread safety of the render system and is not recommended. It is best to perform CPU-side work in these handlers and let the response handler transfer results to the GPU in the main render thread.

Definition at line 161 of file OgreWorkQueue.h.

## Constructor & Destructor Documentation

## RequestHandler()

Ogre::WorkQueue::RequestHandler::RequestHandler | ( |  | ) |

Definition at line 164 of file OgreWorkQueue.h.

## ~RequestHandler()

virtual Ogre::WorkQueue::RequestHandler::~RequestHandler | ( |  | ) |

virtual

Definition at line 165 of file OgreWorkQueue.h.

## Member Function Documentation

## canHandleRequest()

virtual bool Ogre::WorkQueue::RequestHandler::canHandleRequest | ( | const Request * | req,
|  | const WorkQueue * | srcQ
| ) |  |

virtual

Return whether this handler can process a given request.

Remarks
  Defaults to true, but if you wish to add several handlers each of which deal with different types of request, you can override this method.

Reimplemented in Ogre::Terrain, Ogre::TerrainGroup, Ogre::ResourceBackgroundQueue, Ogre::Page, and Ogre::TerrainLodManager.

Definition at line 173 of file OgreWorkQueue.h.

References Ogre::WorkQueue::Request::getAborted().

## handleRequest()

virtual Response* Ogre::WorkQueue::RequestHandler::handleRequest | ( | const Request * | req,
|  | const WorkQueue * | srcQ
| ) |  |

pure virtual

The handler method every subclass must implement.

If a failure is encountered, return a Response with a failure result rather than raise an exception.

Parameters

  req | The Request structure, which is effectively owned by the handler during this call. It must be attached to the returned Response regardless of success or failure.
  srcQ | The work queue that this request originated from

Returns
  Pointer to a Response object - the caller is responsible for deleting the object.

Implemented in Ogre::Terrain, Ogre::TerrainGroup, Ogre::ResourceBackgroundQueue, Ogre::Page, Ogre::TerrainPagedWorldSection, Ogre::Volume::ChunkHandler, Ogre::PMWorker, and Ogre::TerrainLodManager.

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

- OgreWorkQueue.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.