OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
This class is used to perform Resource operations in a background thread. More...
#include <OgreResourceBackgroundQueue.h>
Classes | |
class | Listener |
This abstract listener interface lets you get notifications of completed background processes instead of having to poll ticket statuses. More... | |
Public Member Functions | |
ResourceBackgroundQueue () | |
virtual | ~ResourceBackgroundQueue () |
void | abortRequest (BackgroundProcessTicket ticket) |
Aborts background process. More... | |
bool | canHandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ) override |
Implementation for WorkQueue::RequestHandler. More... | |
bool | canHandleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ) override |
Implementation for WorkQueue::ResponseHandler. More... | |
WorkQueue::Response * | handleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ) override |
Implementation for WorkQueue::RequestHandler. More... | |
void | handleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ) override |
Implementation for WorkQueue::ResponseHandler. More... | |
virtual void | initialise (void) |
Initialise the background queue system. More... | |
virtual BackgroundProcessTicket | initialiseAllResourceGroups (Listener *listener=0) |
Initialise all resource groups which are yet to be initialised in the background. More... | |
virtual BackgroundProcessTicket | initialiseResourceGroup (const String &name, Listener *listener=0) |
Initialise a resource group in the background. More... | |
virtual bool | isProcessComplete (BackgroundProcessTicket ticket) |
Returns whether a previously queued process has completed or not. More... | |
virtual BackgroundProcessTicket | load (const String &resType, const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *loadParams=0, Listener *listener=0) |
Load a single resource in the background. More... | |
virtual BackgroundProcessTicket | loadResourceGroup (const String &name, Listener *listener=0) |
Loads a resource group in the background. More... | |
virtual BackgroundProcessTicket | prepare (const String &resType, const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *loadParams=0, Listener *listener=0) |
Prepare a single resource in the background. More... | |
virtual BackgroundProcessTicket | prepareResourceGroup (const String &name, Listener *listener=0) |
Prepares a resource group in the background. More... | |
virtual void | shutdown (void) |
Shut down the background queue system. More... | |
virtual BackgroundProcessTicket | unload (const String &resType, const String &name, Listener *listener=0) |
Unload a single resource in the background. More... | |
virtual BackgroundProcessTicket | unload (const String &resType, ResourceHandle handle, Listener *listener=0) |
Unload a single resource in the background. More... | |
virtual BackgroundProcessTicket | unloadResourceGroup (const String &name, Listener *listener=0) |
Unloads a resource group in the background. More... | |
Public Member Functions inherited from Ogre::Singleton< ResourceBackgroundQueue > | |
Singleton (void) | |
~Singleton (void) | |
Public Member Functions inherited from Ogre::WorkQueue::RequestHandler | |
RequestHandler () | |
virtual | ~RequestHandler () |
Public Member Functions inherited from Ogre::WorkQueue::ResponseHandler | |
ResponseHandler () | |
virtual | ~ResponseHandler () |
Static Public Member Functions | |
static ResourceBackgroundQueue & | getSingleton (void) |
Get the singleton instance. More... | |
static ResourceBackgroundQueue * | getSingletonPtr (void) |
Get the singleton instance. More... | |
Static Public Member Functions inherited from Ogre::Singleton< ResourceBackgroundQueue > | |
static ResourceBackgroundQueue & | getSingleton (void) |
Get the singleton instance. More... | |
static ResourceBackgroundQueue * | getSingletonPtr (void) |
Get the singleton instance. More... | |
This class is used to perform Resource operations in a background thread.
All these requests are now queued via Root::getWorkQueue in order to share the thread pool amongst all background tasks. You should therefore refer to that class for configuring the behaviour of the threads themselves, this class merely provides an interface that is specific to resource loading around this common functionality.
Ogre::ResourceBackgroundQueue::ResourceBackgroundQueue | ( | ) |
|
virtual |
|
virtual |
Initialise the background queue system.
|
virtual |
Shut down the background queue system.
|
virtual |
Initialise a resource group in the background.
name | The name of the resource group to initialise |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Initialise all resource groups which are yet to be initialised in the background.
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Prepares a resource group in the background.
name | The name of the resource group to prepare |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Loads a resource group in the background.
name | The name of the resource group to load |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Unload a single resource in the background.
resType | The type of the resource (from ResourceManager::getResourceType()) |
name | The name of the Resource |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Unload a single resource in the background.
resType | The type of the resource (from ResourceManager::getResourceType()) |
handle | Handle to the resource |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Unloads a resource group in the background.
name | The name of the resource group to load |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Prepare a single resource in the background.
resType | The type of the resource (from ResourceManager::getResourceType()) |
name | The name of the Resource |
group | The resource group to which this resource will belong |
isManual | Is the resource to be manually loaded? If so, you should provide a value for the loader parameter |
loader | The manual loader which is to perform the required actions when this resource is loaded; only applicable when you specify true for the previous parameter. NOTE: must be thread safe!! |
loadParams | Optional pointer to a list of name/value pairs containing loading parameters for this type of resource. Remember that this must have a lifespan longer than the return of this call! |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Load a single resource in the background.
resType | The type of the resource (from ResourceManager::getResourceType()) |
name | The name of the Resource |
group | The resource group to which this resource will belong |
isManual | Is the resource to be manually loaded? If so, you should provide a value for the loader parameter |
loader | The manual loader which is to perform the required actions when this resource is loaded; only applicable when you specify true for the previous parameter. NOTE: must be thread safe!! |
loadParams | Optional pointer to a list of name/value pairs containing loading parameters for this type of resource. Remember that this must have a lifespan longer than the return of this call! |
listener | Optional callback interface, take note of warnings in the header and only use if you understand them. |
|
virtual |
Returns whether a previously queued process has completed or not.
This method of checking that a background process has completed is the 'polling' approach. Each queued method takes an optional listener parameter to allow you to register a callback instead, which is arguably more efficient.
ticket | The ticket which was returned when the process was queued |
void Ogre::ResourceBackgroundQueue::abortRequest | ( | BackgroundProcessTicket | ticket | ) |
Aborts background process.
|
overridevirtual |
Implementation for WorkQueue::RequestHandler.
Reimplemented from Ogre::WorkQueue::RequestHandler.
|
overridevirtual |
Implementation for WorkQueue::RequestHandler.
Implements Ogre::WorkQueue::RequestHandler.
|
overridevirtual |
Implementation for WorkQueue::ResponseHandler.
Reimplemented from Ogre::WorkQueue::ResponseHandler.
|
overridevirtual |
Implementation for WorkQueue::ResponseHandler.
Implements Ogre::WorkQueue::ResponseHandler.
|
static |
Get the singleton instance.
|
static |
Get the singleton instance.