DigitalSpaces::DIOGREResourceManager Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

DIOGREResourcecreate (const char *name, const char *group, bool isManual=false)
 Creates a new blank resource, but does not immediately load it.
void setMemoryBudget (unsigned int bytes)
 Set a limit on the amount of memory this resource handler may use.
unsigned int getMemoryBudget ()
 Get the limit on the amount of memory this resource handler may use.
void unload (const char *name)
 Unloads a single resource by name.
void unload (unsigned long handle)
 Unloads a single resource by handle.
void unloadAll ()
 Unloads all resources.
void reloadAll ()
 Caused all currently loaded resources to be reloaded.
void remove (DIOGREResource *r)
 Remove a single resource.
void remove (const char *name)
 Remove a single resource by name.
void remove (unsigned long handle)
 Remove a single resource by handle.
void removeAll ()
 Removes all resources.
DIOGREResourcegetByName (const char *name)
 Retrieves a pointer to a resource by name, or null if the resource does not exist.
DIOGREResourcegetByHandle (unsigned long handle)
 Retrieves a pointer to a resource by handle, or null if the resource does not exist.
bool resourceExists (const char *name)
 Returns whether the named resource exists in this manager.
bool resourceExists (unsigned long handle)
 Returns whether a resource with the given handle exists in this manager.
DIOGREResourceload (const char *name, const char *group, bool isManual=false)
 Generic load method, used to create a Resource specific to this ResourceManager without using one of the specialised 'load' methods (containing per-Resource-type parameters).
void getScriptPatterns (DIStringList1 *patterns)
 Gets the file patterns which should be used to find scripts for this ResourceManager.
void parseScript (void *stream, unsigned int stream_size, const char *groupName)
 Parse the definition of a set of resources from a script file.
float getLoadingOrder ()
 Gets the relative loading order of resources of this type.
const char * getResourceType ()
 Gets a string identifying the type of resource this manager handles.

Member Function Documentation

DIOGREResource* DigitalSpaces::DIOGREResourceManager::create ( const char *  name,
const char *  group,
bool  isManual = false 
)

Creates a new blank resource, but does not immediately load it.

Remarks:
Resource managers handle disparate types of resources, so if you want to get at the detailed interface of this resource, you'll have to cast the result to the subclass you know you're creating.
Parameters:
name The unique name of the resource
group The name of the resource group to attach this new resource to
isManual Is this resource manually loaded? If so, you should really populate the loader parameter in order that the load process can call the loader back when loading is required.

void DigitalSpaces::DIOGREResourceManager::setMemoryBudget ( unsigned int  bytes  ) 

Set a limit on the amount of memory this resource handler may use.

Remarks:
If, when asked to load a new resource, the manager believes it will exceed this memory budget, it will temporarily unload a resource to make room for the new one. This unloading is not permanent and the Resource is not destroyed; it simply needs to be reloaded when next used.

unsigned int DigitalSpaces::DIOGREResourceManager::getMemoryBudget (  ) 

Get the limit on the amount of memory this resource handler may use.

void DigitalSpaces::DIOGREResourceManager::unload ( const char *  name  ) 

Unloads a single resource by name.

Remarks:
Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded.
See also:
ResourceGroupManager for unloading of resource groups.

void DigitalSpaces::DIOGREResourceManager::unload ( unsigned long  handle  ) 

Unloads a single resource by handle.

Remarks:
Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded.
See also:
ResourceGroupManager for unloading of resource groups.

void DigitalSpaces::DIOGREResourceManager::unloadAll (  ) 

Unloads all resources.

Remarks:
Unloaded resources are not removed, they simply free up their memory as much as they can and wait to be reloaded.
See also:
ResourceGroupManager for unloading of resource groups.

void DigitalSpaces::DIOGREResourceManager::reloadAll (  ) 

Caused all currently loaded resources to be reloaded.

Remarks:
All resources currently being held in this manager which are also marked as currently loaded will be unloaded, then loaded again.

void DigitalSpaces::DIOGREResourceManager::remove ( DIOGREResource r  ) 

Remove a single resource.

Remarks:
Removes a single resource, meaning it will be removed from the list of valid resources in this manager, also causing it to be unloaded.
Note:
The word 'Destroy' is not used here, since if any other pointers are referring to this resource, it will persist until they have finished with it; however to all intents and purposes it no longer exists and will likely get destroyed imminently.

If you do have shared pointers to resources hanging around after the ResourceManager is destroyed, you may get problems on destruction of these resources if they were relying on the manager (especially if it is a plugin). If you find you get problems on shutdown in the destruction of resources, try making sure you release all your shared pointers before you shutdown OGRE.

void DigitalSpaces::DIOGREResourceManager::remove ( const char *  name  ) 

Remove a single resource by name.

Remarks:
Removes a single resource, meaning it will be removed from the list of valid resources in this manager, also causing it to be unloaded.
Note:
The word 'Destroy' is not used here, since if any other pointers are referring to this resource, it will persist until they have finished with it; however to all intents and purposes it no longer exists and will likely get destroyed imminently.

If you do have shared pointers to resources hanging around after the ResourceManager is destroyed, you may get problems on destruction of these resources if they were relying on the manager (especially if it is a plugin). If you find you get problems on shutdown in the destruction of resources, try making sure you release all your shared pointers before you shutdown OGRE.

void DigitalSpaces::DIOGREResourceManager::remove ( unsigned long  handle  ) 

Remove a single resource by handle.

Remarks:
Removes a single resource, meaning it will be removed from the list of valid resources in this manager, also causing it to be unloaded.
Note:
The word 'Destroy' is not used here, since if any other pointers are referring to this resource, it will persist until they have finished with it; however to all intents and purposes it no longer exists and will likely get destroyed imminently.

If you do have shared pointers to resources hanging around after the ResourceManager is destroyed, you may get problems on destruction of these resources if they were relying on the manager (especially if it is a plugin). If you find you get problems on shutdown in the destruction of resources, try making sure you release all your shared pointers before you shutdown OGRE.

void DigitalSpaces::DIOGREResourceManager::removeAll (  ) 

Removes all resources.

Note:
The word 'Destroy' is not used here, since if any other pointers are referring to these resources, they will persist until they have been finished with; however to all intents and purposes the resources no longer exist and will get destroyed imminently.

If you do have shared pointers to resources hanging around after the ResourceManager is destroyed, you may get problems on destruction of these resources if they were relying on the manager (especially if it is a plugin). If you find you get problems on shutdown in the destruction of resources, try making sure you release all your shared pointers before you shutdown OGRE.

DIOGREResource* DigitalSpaces::DIOGREResourceManager::getByName ( const char *  name  ) 

Retrieves a pointer to a resource by name, or null if the resource does not exist.

DIOGREResource* DigitalSpaces::DIOGREResourceManager::getByHandle ( unsigned long  handle  ) 

Retrieves a pointer to a resource by handle, or null if the resource does not exist.

bool DigitalSpaces::DIOGREResourceManager::resourceExists ( const char *  name  ) 

Returns whether the named resource exists in this manager.

bool DigitalSpaces::DIOGREResourceManager::resourceExists ( unsigned long  handle  ) 

Returns whether a resource with the given handle exists in this manager.

DIOGREResource* DigitalSpaces::DIOGREResourceManager::load ( const char *  name,
const char *  group,
bool  isManual = false 
)

Generic load method, used to create a Resource specific to this ResourceManager without using one of the specialised 'load' methods (containing per-Resource-type parameters).

Parameters:
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
loadParams Optional pointer to a list of name/value pairs containing loading parameters for this type of resource.

void DigitalSpaces::DIOGREResourceManager::getScriptPatterns ( DIStringList1 patterns  ) 

Gets the file patterns which should be used to find scripts for this ResourceManager.

Remarks:
Some resource managers can read script files in order to define resources ahead of time. These resources are added to the available list inside the manager, but none are loaded initially. This allows you to load the items that are used on demand, or to load them all as a group if you wish (through ResourceGroupManager).
This method lets you determine the file pattern which will be used to identify scripts intended for this manager.
Returns:
A list of file patterns, in the order they should be searched in.
See also:
isScriptingSupported, parseScript

void DigitalSpaces::DIOGREResourceManager::parseScript ( void *  stream,
unsigned int  stream_size,
const char *  groupName 
)

Parse the definition of a set of resources from a script file.

Remarks:
Some resource managers can read script files in order to define resources ahead of time. These resources are added to the available list inside the manager, but none are loaded initially. This allows you to load the items that are used on demand, or to load them all as a group if you wish (through ResourceGroupManager).
Parameters:
stream Weak reference to a data stream which is the source of the script
groupName The name of the resource group that resources which are parsed are to become a member of. If this group is loaded or unloaded, then the resources discovered in this script will be loaded / unloaded with it.

float DigitalSpaces::DIOGREResourceManager::getLoadingOrder (  ) 

Gets the relative loading order of resources of this type.

Remarks:
There are dependencies between some kinds of resource in terms of loading order, and this value enumerates that. Higher values load later during bulk loading tasks.

const char* DigitalSpaces::DIOGREResourceManager::getResourceType (  ) 

Gets a string identifying the type of resource this manager handles.


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

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6