28 #ifndef _ResourceGroupManager_H__
29 #define _ResourceGroupManager_H__
100 virtual void resourceGroupScriptingStarted(
const String& groupName,
size_t scriptCount) = 0;
108 virtual void scriptParseStarted(
const String& scriptName,
bool& skipThisScript) = 0;
112 virtual void scriptParseEnded(
const String& scriptName,
bool skipped) = 0;
114 virtual void resourceGroupScriptingEnded(
const String& groupName) = 0;
122 { (void)groupName; (void)resourceCount; }
139 { (void)description; }
155 virtual void resourceGroupLoadStarted(
const String& groupName,
size_t resourceCount) = 0;
159 virtual void resourceLoadStarted(
const ResourcePtr& resource) = 0;
162 virtual void resourceLoadEnded(
void) = 0;
168 virtual void worldGeometryStageStarted(
const String& description) = 0;
173 virtual void worldGeometryStageEnded(
void) = 0;
175 virtual void resourceGroupLoadEnded(
const String& groupName) = 0;
355 void removeFromIndex(
Archive* arch);
387 void fireResourceGroupScriptingStarted(
const String& groupName,
size_t scriptCount);
389 void fireScriptStarted(
const String& scriptName,
bool &skipScript);
391 void fireScriptEnded(
const String& scriptName,
bool skipped);
393 void fireResourceGroupScriptingEnded(
const String& groupName);
395 void fireResourceGroupLoadStarted(
const String& groupName,
size_t resourceCount);
397 void fireResourceLoadStarted(
const ResourcePtr& resource);
399 void fireResourceLoadEnded(
void);
401 void fireResourceGroupLoadEnded(
const String& groupName);
403 void fireResourceGroupPrepareStarted(
const String& groupName,
size_t resourceCount);
405 void fireResourcePrepareStarted(
const ResourcePtr& resource);
407 void fireResourcePrepareEnded(
void);
409 void fireResourceGroupPrepareEnded(
const String& groupName);
411 void fireResourceCreated(
const ResourcePtr& resource);
413 void fireResourceRemove(
const ResourcePtr& resource);
466 void createResourceGroup(
const String& name,
const bool inGlobalPool =
true);
508 void initialiseResourceGroup(
const String& name);
513 void initialiseAllResourceGroups(
void);
532 void prepareResourceGroup(
const String& name,
bool prepareMainResources =
true,
533 bool prepareWorldGeom =
true);
552 void loadResourceGroup(
const String& name,
bool loadMainResources =
true,
553 bool loadWorldGeom =
true);
570 void unloadResourceGroup(
const String& name,
bool reloadableOnly =
true);
583 void unloadUnreferencedResourcesInGroup(
const String& name,
584 bool reloadableOnly =
true);
595 void clearResourceGroup(
const String& name);
602 void destroyResourceGroup(
const String& name);
611 bool isResourceGroupInitialised(
const String& name);
620 bool isResourceGroupLoaded(
const String& name);
625 bool resourceGroupExists(
const String& name);
648 void addResourceLocation(
const String& name,
const String& locType,
649 const String& resGroup = DEFAULT_RESOURCE_GROUP_NAME,
bool recursive =
false,
bool readOnly =
true);
651 void removeResourceLocation(
const String& name,
652 const String& resGroup = DEFAULT_RESOURCE_GROUP_NAME);
654 bool resourceLocationExists(
const String& name,
655 const String& resGroup = DEFAULT_RESOURCE_GROUP_NAME);
691 void declareResource(
const String& name,
const String& resourceType,
692 const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
733 void declareResource(
const String& name,
const String& resourceType,
746 void undeclareResource(
const String& name,
const String& groupName);
768 const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
769 bool searchGroupsIfNotFound =
true,
Resource* resourceBeingLoaded = 0);
783 const String& groupName = DEFAULT_RESOURCE_GROUP_NAME);
821 bool resourceExists(
const String& group,
const String& filename);
826 bool resourceExistsInAnyGroup(
const String& filename);
834 const String& findGroupContainingResource(
const String& filename);
849 time_t resourceModifiedTime(
const String& group,
const String& filename);
890 void deleteResource(
const String& filename,
const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
902 void deleteMatchingResources(
const String& filePattern,
const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
936 void linkWorldGeometryToResourceGroup(
const String& group,
943 void unlinkWorldGeometryFromResourceGroup(
const String& group);
952 bool isResourceGroupInGlobalPool(
const String& name);
955 void shutdownAll(
void);
975 void _unregisterResourceManager(
const String& resourceType);
981 mResourceManagerMap.begin(), mResourceManagerMap.end()); }
1016 void _notifyResourceGroupChanged(
const String& oldGroup,
Resource* res);
1031 void _notifyWorldGeometryStageStarted(
const String& description);
1039 void _notifyWorldGeometryStageEnded(
void);
1053 ResourceDeclarationList getResourceDeclarationList(
const String& groupName);
1059 const LocationList& getResourceLocationList(
const String& groupName);
virtual void resourcePrepareEnded(void)
This event is fired when the resource has been prepared.
ResourceGroup * mCurrentGroup
Stored current group - optimisation for when bulk loading a group.
map< Real, LoadUnloadResourceList * >::type LoadResourceOrderMap
Created resources which are ready to be loaded / unloaded.
virtual void resourcePrepareStarted(const ResourcePtr &resource)
This event is fired when a declared resource is about to be prepared.
virtual ~ResourceGroupListener()
virtual bool resourceCollision(Resource *resource, ResourceManager *resourceManager)=0
This event is called when a resource collides with another existing one in a resource manager...
virtual void worldGeometryPrepareStageEnded(void)
This event is fired when a stage of preparing linked world geometry has been completed.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
void setWorldResourceGroupName(const String &groupName)
Sets the resource group that 'world' resources will use.
list< ResourceLocation * >::type LocationList
List of possible file locations.
Template class for creating single-instance global classes.
map< String, ResourceManager * >::type ResourceManagerMap
Manages the organisation and rendering of a 'scene' i.e.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
MapIterator< ResourceManagerMap > ResourceManagerIterator
ResourceManagerMap mResourceManagerMap
Map of resource types (strings) to ResourceManagers, used to notify them to load / unload group conte...
ScriptLoaderOrderMap mScriptLoaderOrderMap
OGRE_AUTO_MUTEX
General mutex for dealing with group content.
map< String, ResourceGroup * >::type ResourceGroupMap
Map from resource group names to groups.
Interface describing a manual resource loader.
virtual void worldGeometryPrepareStageStarted(const String &description)
This event is fired when a stage of preparing linked world geometry is about to start.
ResourceGroupListenerList mResourceGroupListenerList
ResourceLocationIndex resourceIndexCaseSensitive
Index of resource names to locations, built for speedy access (case sensitive archives) ...
virtual void resourceRemove(const ResourcePtr &resource)
This event is fired when a resource is about to be removed.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
static String INTERNAL_RESOURCE_GROUP_NAME
Internal resource group name (should be used by OGRE internal only)
ResourceDeclarationList resourceDeclarations
Pre-declared resources, ready to be created.
virtual void resourceGroupPrepareEnded(const String &groupName)
This event is fired when a resource group finished preparing.
virtual void resourceCreated(const ResourcePtr &resource)
This event is fired when a resource was just created.
virtual void resourceStreamOpened(const String &name, const String &group, Resource *resource, DataStreamPtr &dataStream)=0
This event is called when a resource stream has been opened, but not processed yet.
Abstract class defining the interface used by classes which wish to perform script loading to define ...
LocationList locationList
List of possible locations to search.
String mWorldGroupName
Group name for world resources.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
list< ResourcePtr >::type LoadUnloadResourceList
List of resources which can be loaded / unloaded.
Status groupStatus
Group status.
bool recursive
Whether this location was added recursively.
vector< ResourceGroupListener * >::type ResourceGroupListenerList
Archive * archive
Pointer to the archive which is the destination.
vector< String >::type StringVector
ResourceGroupMap mResourceGroupMap
virtual ~ResourceLoadingListener()
ResourceLocationIndex resourceIndexCaseInsensitive
Index of resource names to locations, built for speedy access (case insensitive archives) ...
list< ResourceDeclaration >::type ResourceDeclarationList
List of resource declarations.
ResourceManagerIterator getResourceManagerIterator()
Get an iterator over the registered resource managers.
map< String, Archive * >::type ResourceLocationIndex
Resource index entry, resourcename->location.
multimap< Real, ScriptLoader * >::type ScriptLoaderOrderMap
Map of loading order (Real) to ScriptLoader, used to order script parsing.
Abstract class representing a loadable resource (e.g.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
virtual DataStreamPtr resourceLoading(const String &name, const String &group, Resource *resource)=0
This event is called when a resource beings loading.
SceneManager * worldGeometrySceneManager
Scene manager to use with linked world geometry.
Nested struct defining a resource declaration.
String worldGeometry
Linked world geometry, as passed to setWorldGeometry.
LoadResourceOrderMap loadResourceOrderMap
This singleton class manages the list of resource groups, and notifying the various resource managers...
ManualResourceLoader * loader
Defines a generic resource handler.
static size_t RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS
The number of reference counts held per resource by the resource system.
This abstract class defines an interface which is called back during resource group loading to indica...
ResourceLoadingListener * mLoadingListener
NameValuePairList parameters
const String & getWorldResourceGroupName(void) const
Gets the resource group that 'world' resources will use.
virtual void resourceGroupPrepareStarted(const String &groupName, size_t resourceCount)
This event is fired when a resource group begins preparing.