Go to the documentation of this file.
28 #ifndef _ResourceManager_H__
29 #define _ResourceManager_H__
63 std::pair<bool, T> ret;
71 ret.second =
mItems.front();
167 const String& group,
bool isManual =
false,
178 virtual void setMemoryBudget(
size_t bytes);
182 virtual size_t getMemoryBudget(
void)
const;
193 virtual void unload(
const String& name);
215 virtual void unloadAll(
bool reloadableOnly =
true);
228 virtual void reloadAll(
bool reloadableOnly =
true);
244 virtual void unloadUnreferencedResources(
bool reloadableOnly =
true);
259 virtual void reloadUnreferencedResources(
bool reloadableOnly =
true);
297 virtual void remove(
const String& name);
331 virtual void removeAll(
void);
347 virtual void removeUnreferencedResources(
bool reloadableOnly =
true);
359 return !getResourceByName(name).isNull();
364 return !getByHandle(handle).isNull();
370 virtual void _notifyResourceTouched(
Resource* res);
375 virtual void _notifyResourceLoaded(
Resource* res);
380 virtual void _notifyResourceUnloaded(
Resource* res);
398 const String& group,
bool isManual =
false,
400 bool backgroundThread =
false);
418 const String& group,
bool isManual =
false,
420 bool backgroundThread =
false);
453 { (void)stream; (void)groupName; }
486 const String& getName()
const;
495 void destroyResourcePool(
const String& name);
497 void destroyAllResourcePools();
537 virtual void checkUsage(
void);
unsigned long long int ResourceHandle
Real mLoadOrder
Loading order relative to other managers, higher is later.
virtual void addItem(const T &i)
Add a new item to the pool.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
ResourceWithGroupMap mResourcesWithGroup
map< ResourceHandle, ResourcePtr >::type ResourceHandleMap
vector< String >::type StringVector
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
HashMap< String, ResourcePtr > ResourceMap
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
ResourceMapIterator getResourceIterator(void)
Returns an iterator over all resources in this manager.
virtual void parseScript(DataStreamPtr &stream, const String &groupName)
Parse the definition of a set of resources from a script file.
#define OGRE_LOCK_AUTO_MUTEX
MapIterator< ResourceHandleMap > ResourceMapIterator
Defines a generic resource handler.
ResourceHandleMap mResourcesByHandle
map< String, ResourcePool * >::type ResourcePoolMap
Abstract class defining the interface used by classes which wish to perform script loading to define ...
AtomicScalar< ResourceHandle > mNextHandle
In bytes.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Abstract class representing a loadable resource (e.g.
Definition of a pool of resources, which users can use to reuse similar resources many times without ...
StringVector mScriptPatterns
Patterns to use to look for scripts if supported (e.g. *.overlay)
virtual bool getVerbose(void)
Gets whether this manager and its resources habitually produce log output.
std::pair< ResourcePtr, bool > ResourceCreateOrRetrieveResult
virtual std::pair< bool, T > removeItem()
Get the next item from the pool.
virtual size_t getMemoryUsage(void) const
Gets the current memory usage, in bytes.
AtomicScalar< size_t > mMemoryUsage
float Real
Software floating point type.
virtual void setVerbose(bool v)
Sets whether this manager and its resources habitually produce log output.
String mResourceType
String identifying the resource type this manager handles.
virtual void clear()
Clear the pool.
virtual const StringVector & getScriptPatterns(void) const
Gets the file patterns which should be used to find scripts for this ResourceManager.
virtual Real getLoadingOrder(void) const
Gets the relative loading order of resources of this type.
Template class describing a simple pool of items.
Interface describing a manual resource loader.
virtual bool resourceExists(ResourceHandle handle)
Returns whether a resource with the given handle exists in this manager.
HashMap< String, ResourceMap > ResourceWithGroupMap
const String & getResourceType(void) const
Gets a string identifying the type of resource this manager handles.
ResourcePoolMap mResourcePoolMap
virtual bool resourceExists(const String &name)
Returns whether the named resource exists in this manager.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15