OGRE: Ogre::ResourceBackgroundQueue Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::ResourceBackgroundQueue Class Reference
Core » Resources

This class is used to perform Resource operations in a background thread. More...

`#include <OgreResourceBackgroundQueue.h>`

Inheritance diagram for Ogre::ResourceBackgroundQueue:
[legend]

## Public Member Functions
| ResourceBackgroundQueue ()
virtual | ~ResourceBackgroundQueue ()
std::future< void > | initialiseAllResourceGroups ()
| Initialise all resource groups which are yet to be initialised in the background.
std::future< void > | initialiseResourceGroup (const String &name)
| Initialise a resource group in the background.
std::future< void > | load (const ResourcePtr &res)
| Load a single resource in the background.
std::future< void > | loadResourceGroup (const String &name)
| Loads a resource group in the background.
std::future< void > | prepare (const ResourcePtr &res)
| Prepare a single resource in the background.
std::future< void > | prepareResourceGroup (const String &name)
| Prepares a resource group in the background.
std::future< void > | unload (const ResourcePtr &res)
| Unload a single resource in the background.
std::future< void > | unloadResourceGroup (const String &name)
| Unloads a resource group in the background.
Public Member Functions inherited from Ogre::Singleton< ResourceBackgroundQueue >
| ~Singleton (void)

## Static Public Member Functions
static ResourceBackgroundQueue & | getSingleton (void)
| Get the singleton instance.
static ResourceBackgroundQueue * | getSingletonPtr (void)
| Get the singleton instance.
Static Public Member Functions inherited from Ogre::Singleton< ResourceBackgroundQueue >
static ResourceBackgroundQueue & | getSingleton (void)
| Get the singleton instance.
static ResourceBackgroundQueue * | getSingletonPtr (void)
| Get the singleton instance.

## Detailed Description

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.

  The general approach here is that on requesting a background resource process, your request is placed on a queue ready for the background thread to be picked up, and you will get a 'ticket' back, identifying the request. Your call will then return and your thread can proceed, knowing that at some point in the background the operation will be performed. In it's own thread, the resource operation will be performed, and once finished the ticket will be marked as complete.

## Constructor & Destructor Documentation

## ◆ ResourceBackgroundQueue()

Ogre::ResourceBackgroundQueue::ResourceBackgroundQueue | ( |  | ) |

Referenced by getSingleton(), and getSingletonPtr().

## ◆ ~ResourceBackgroundQueue()

virtual Ogre::ResourceBackgroundQueue::~ResourceBackgroundQueue | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ initialiseResourceGroup()

std::future< void > Ogre::ResourceBackgroundQueue::initialiseResourceGroup | ( | const String & | name | ) |

Initialise a resource group in the background.

See also
  ResourceGroupManager::initialiseResourceGroup

Parameters

  name | The name of the resource group to initialise

## ◆ initialiseAllResourceGroups()

std::future< void > Ogre::ResourceBackgroundQueue::initialiseAllResourceGroups | ( |  | ) |

Initialise all resource groups which are yet to be initialised in the background.

See also
  ResourceGroupManager::intialiseResourceGroup

## ◆ prepareResourceGroup()

std::future< void > Ogre::ResourceBackgroundQueue::prepareResourceGroup | ( | const String & | name | ) |

Prepares a resource group in the background.

See also
  ResourceGroupManager::prepareResourceGroup

Parameters

  name | The name of the resource group to prepare

## ◆ loadResourceGroup()

std::future< void > Ogre::ResourceBackgroundQueue::loadResourceGroup | ( | const String & | name | ) |

Loads a resource group in the background.

See also
  ResourceGroupManager::loadResourceGroup

Parameters

  name | The name of the resource group to load

## ◆ unload()

std::future< void > Ogre::ResourceBackgroundQueue::unload | ( | const ResourcePtr & | res | ) |

Unload a single resource in the background.

See also
  ResourceManager::unload

## ◆ unloadResourceGroup()

std::future< void > Ogre::ResourceBackgroundQueue::unloadResourceGroup | ( | const String & | name | ) |

Unloads a resource group in the background.

See also
  ResourceGroupManager::unloadResourceGroup

Parameters

  name | The name of the resource group to load

## ◆ prepare()

std::future< void > Ogre::ResourceBackgroundQueue::prepare | ( | const ResourcePtr & | res | ) |

Prepare a single resource in the background.

See also
  ResourceManager::prepare

## ◆ load()

std::future< void > Ogre::ResourceBackgroundQueue::load | ( | const ResourcePtr & | res | ) |

Load a single resource in the background.

See also
  ResourceManager::load

## ◆ getSingleton()

ResourceBackgroundQueue & Ogre::ResourceBackgroundQueue::getSingleton | ( | void |  | ) |
| static

Get the singleton instance.

References ResourceBackgroundQueue().

## ◆ getSingletonPtr()

ResourceBackgroundQueue * Ogre::ResourceBackgroundQueue::getSingletonPtr | ( | void |  | ) |
| static

Get the singleton instance.

References ResourceBackgroundQueue().

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

- OgreResourceBackgroundQueue.h