OgreResourceGroupManager.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef _ResourceGroupManager_H__
29 #define _ResourceGroupManager_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreSingleton.h"
33 #include "OgreCommon.h"
34 #include "OgreDataStream.h"
35 #include "OgreResource.h"
36 #include "OgreArchive.h"
37 #include "OgreIteratorWrappers.h"
38 #include <ctime>
39 #include "OgreHeaderPrefix.h"
40 
41 // If X11/Xlib.h gets included before this header (for example it happens when
42 // including wxWidgets and FLTK), Status is defined as an int which we don't
43 // want as we have an enum named Status.
44 #ifdef Status
45 #undef Status
46 #endif
47 
48 namespace Ogre {
49 
87  {
88  public:
90 
100  virtual void resourceGroupScriptingStarted(const String& groupName, size_t scriptCount) = 0;
108  virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0;
109 
112  virtual void scriptParseEnded(const String& scriptName, bool skipped) = 0;
114  virtual void resourceGroupScriptingEnded(const String& groupName) = 0;
115 
121  virtual void resourceGroupPrepareStarted(const String& groupName, size_t resourceCount)
122  { (void)groupName; (void)resourceCount; }
123 
127  virtual void resourcePrepareStarted(const ResourcePtr& resource)
128  { (void)resource; }
129 
132  virtual void resourcePrepareEnded(void) {}
138  virtual void worldGeometryPrepareStageStarted(const String& description)
139  { (void)description; }
140 
145  virtual void worldGeometryPrepareStageEnded(void) {}
147  virtual void resourceGroupPrepareEnded(const String& groupName)
148  { (void)groupName; }
149 
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;
179  virtual void resourceCreated(const ResourcePtr& resource)
180  { (void)resource; }
184  virtual void resourceRemove(const ResourcePtr& resource)
185  { (void)resource; }
186  };
187 
194  {
195  public:
197 
199  virtual DataStreamPtr resourceLoading(const String &name, const String &group, Resource *resource) = 0;
200 
206  virtual void resourceStreamOpened(const String &name, const String &group, Resource *resource, DataStreamPtr& dataStream) = 0;
207 
210  virtual bool resourceCollision(Resource *resource, ResourceManager *resourceManager) = 0;
211  };
212 
261  class _OgreExport ResourceGroupManager : public Singleton<ResourceGroupManager>, public ResourceAlloc
262  {
263  public:
264  OGRE_AUTO_MUTEX; // public to allow external locking
275  {
280  };
287  {
291  bool recursive;
292  };
295 
296  protected:
299 
303 
306 
308 
311 
316  {
317  enum Status
318  {
319  UNINITIALSED = 0,
320  INITIALISING = 1,
321  INITIALISED = 2,
322  LOADING = 3,
323  LOADED = 4
324  };
328  OGRE_MUTEX(statusMutex);
342  // Group by loading order of the type (defined by ResourceManager)
343  // (e.g. skeletons and materials before meshes)
350  // in global pool flag - if true the resource will be loaded even a different group was requested in the load method as a parameter.
352 
353  void addToIndex(const String& filename, Archive* arch);
354  void removeFromIndex(const String& filename, Archive* arch);
356 
357  };
361 
364 
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);
401  void fireResourceGroupLoadEnded(const String& groupName);
403  void fireResourceGroupPrepareStarted(const String& groupName, size_t resourceCount);
409  void fireResourceGroupPrepareEnded(const String& groupName);
411  void fireResourceCreated(const ResourcePtr& resource);
413  void fireResourceRemove(const ResourcePtr& resource);
415  time_t resourceModifiedTime(ResourceGroup* group, const String& filename);
416 
421  bool resourceExists(ResourceGroup* group, const String& filename);
422 
425  public:
428 
466  void createResourceGroup(const String& name, const bool inGlobalPool = true);
467 
468 
508  void initialiseResourceGroup(const String& name);
509 
514 
532  void prepareResourceGroup(const String& name, bool prepareMainResources = true,
533  bool prepareWorldGeom = true);
534 
552  void loadResourceGroup(const String& name, bool loadMainResources = true,
553  bool loadWorldGeom = true);
554 
570  void unloadResourceGroup(const String& name, bool reloadableOnly = true);
571 
584  bool reloadableOnly = true);
585 
595  void clearResourceGroup(const String& name);
596 
602  void destroyResourceGroup(const String& name);
603 
612 
620  bool isResourceGroupLoaded(const String& name);
621 
622  /*** Verify if a resource group exists
623  @param name The name of the resource group to look for
624  */
625  bool resourceGroupExists(const String& name);
626 
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);
656 
691  void declareResource(const String& name, const String& resourceType,
692  const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
693  const NameValuePairList& loadParameters = NameValuePairList());
733  void declareResource(const String& name, const String& resourceType,
734  const String& groupName, ManualResourceLoader* loader,
735  const NameValuePairList& loadParameters = NameValuePairList());
746  void undeclareResource(const String& name, const String& groupName);
747 
767  DataStreamPtr openResource(const String& resourceName,
768  const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
769  bool searchGroupsIfNotFound = true, Resource* resourceBeingLoaded = 0);
770 
783  const String& groupName = DEFAULT_RESOURCE_GROUP_NAME);
784 
793  StringVectorPtr listResourceNames(const String& groupName, bool dirs = false);
794 
801  FileInfoListPtr listResourceFileInfo(const String& groupName, bool dirs = false);
802 
814  StringVectorPtr findResourceNames(const String& groupName, const String& pattern,
815  bool dirs = false);
816 
821  bool resourceExists(const String& group, const String& filename);
822 
826  bool resourceExistsInAnyGroup(const String& filename);
827 
834  const String& findGroupContainingResource(const String& filename);
835 
845  FileInfoListPtr findResourceFileInfo(const String& group, const String& pattern,
846  bool dirs = false);
847 
849  time_t resourceModifiedTime(const String& group, const String& filename);
855 
862  StringVectorPtr findResourceLocation(const String& groupName, const String& pattern);
863 
878  DataStreamPtr createResource(const String& filename, const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
879  bool overwrite = false, const String& locationPattern = StringUtil::BLANK);
880 
890  void deleteResource(const String& filename, const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
891  const String& locationPattern = StringUtil::BLANK);
892 
902  void deleteMatchingResources(const String& filePattern, const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
903  const String& locationPattern = StringUtil::BLANK);
904 
911 
918  void setWorldResourceGroupName(const String& groupName) {mWorldGroupName = groupName;}
919 
921  const String& getWorldResourceGroupName(void) const { return mWorldGroupName; }
922 
937  const String& worldGeometry, SceneManager* sceneManager);
938 
944 
953 
955  void shutdownAll(void);
956 
957 
967  void _registerResourceManager(const String& resourceType, ResourceManager* rm);
968 
975  void _unregisterResourceManager(const String& resourceType);
976 
980  { return ResourceManagerIterator(
981  mResourceManagerMap.begin(), mResourceManagerMap.end()); }
982 
988 
993 
998 
1003 
1008 
1013 
1016  void _notifyResourceGroupChanged(const String& oldGroup, Resource* res);
1017 
1023 
1031  void _notifyWorldGeometryStageStarted(const String& description);
1040 
1054 
1059  const LocationList& getResourceLocationList(const String& groupName);
1060 
1065 
1098 
1099  };
1102 }
1103 
1104 #include "OgreHeaderSuffix.h"
1105 
1106 #endif
OgreHeaderSuffix.h
Ogre::ResourceGroupManager::resourceGroupExists
bool resourceGroupExists(const String &name)
Ogre::ResourceGroupListener::worldGeometryPrepareStageStarted
virtual void worldGeometryPrepareStageStarted(const String &description)
This event is fired when a stage of preparing linked world geometry is about to start.
Definition: OgreResourceGroupManager.h:138
Ogre::ResourceGroupManager::ResourceGroup::name
String name
Group name.
Definition: OgreResourceGroupManager.h:330
Ogre::ResourceGroupManager::undeclareResource
void undeclareResource(const String &name, const String &groupName)
Undeclare a resource.
Ogre::ResourceGroupManager::_unregisterScriptLoader
void _unregisterScriptLoader(ScriptLoader *su)
Internal method for unregistering a ScriptLoader.
Ogre::ResourceGroupManager::ResourceGroup::resourceIndexCaseSensitive
ResourceLocationIndex resourceIndexCaseSensitive
Index of resource names to locations, built for speedy access (case sensitive archives)
Definition: OgreResourceGroupManager.h:336
Ogre::ResourceGroupManager::createResourceGroup
void createResourceGroup(const String &name, const bool inGlobalPool=true)
Create a resource group.
Ogre::ResourceGroupManager::_findScriptLoader
ScriptLoader * _findScriptLoader(const String &pattern)
Method used to directly query for registered script loaders.
Ogre::ResourceGroupListener::resourceRemove
virtual void resourceRemove(const ResourcePtr &resource)
This event is fired when a resource is about to be removed.
Definition: OgreResourceGroupManager.h:184
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:59
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME
static String INTERNAL_RESOURCE_GROUP_NAME
Internal resource group name (should be used by OGRE internal only)
Definition: OgreResourceGroupManager.h:268
Ogre::ResourceGroupManager::resourceLocationExists
bool resourceLocationExists(const String &name, const String &resGroup=DEFAULT_RESOURCE_GROUP_NAME)
Verify if a resource location exists for the given group.
Ogre::ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS
static size_t RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS
The number of reference counts held per resource by the resource system.
Definition: OgreResourceGroupManager.h:272
Ogre::ResourceGroupManager::fireResourceGroupScriptingStarted
void fireResourceGroupScriptingStarted(const String &groupName, size_t scriptCount)
Internal event firing method.
Ogre::ResourceGroupManager::removeResourceGroupListener
void removeResourceGroupListener(ResourceGroupListener *l)
Removes a ResourceGroupListener.
Ogre::map
Definition: OgrePrerequisites.h:534
OgreSingleton.h
Ogre::ResourceGroupManager::ResourceDeclaration
Nested struct defining a resource declaration.
Definition: OgreResourceGroupManager.h:275
Ogre::ResourceGroupManager::LoadUnloadResourceList
list< ResourcePtr >::type LoadUnloadResourceList
List of resources which can be loaded / unloaded.
Definition: OgreResourceGroupManager.h:313
Ogre::ResourceGroupManager::findResourceFileInfo
FileInfoListPtr findResourceFileInfo(const String &group, const String &pattern, bool dirs=false)
Find all files or directories matching a given pattern in a group and get some detailed information a...
Ogre::ResourceGroupManager::listResourceFileInfo
FileInfoListPtr listResourceFileInfo(const String &groupName, bool dirs=false)
List all files in a resource group with accompanying information.
Ogre::ResourceGroupManager::deleteResource
void deleteResource(const String &filename, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME, const String &locationPattern=StringUtil::BLANK)
Delete a single resource file.
Ogre::ResourceGroupManager::mScriptLoaderOrderMap
ScriptLoaderOrderMap mScriptLoaderOrderMap
Definition: OgreResourceGroupManager.h:302
Ogre::ResourceGroupManager::createDeclaredResources
void createDeclaredResources(ResourceGroup *grp)
Create all the pre-declared resources.
Ogre::ResourceGroupManager::getWorldResourceGroupName
const String & getWorldResourceGroupName(void) const
Gets the resource group that 'world' resources will use.
Definition: OgreResourceGroupManager.h:921
Ogre::StringVector
vector< String >::type StringVector
Definition: OgreStringVector.h:45
Ogre::ResourceGroupManager::ResourceDeclaration::resourceName
String resourceName
Definition: OgreResourceGroupManager.h:276
Ogre::ResourceGroupManager::mCurrentGroup
ResourceGroup * mCurrentGroup
Stored current group - optimisation for when bulk loading a group.
Definition: OgreResourceGroupManager.h:424
Ogre::ResourceGroupManager::setLoadingListener
void setLoadingListener(ResourceLoadingListener *listener)
Sets a new loading listener.
Ogre::ResourceGroupManager::ResourceGroup
Resource group entry.
Definition: OgreResourceGroupManager.h:316
Ogre::ResourceGroupManager::declareResource
void declareResource(const String &name, const String &resourceType, const String &groupName, ManualResourceLoader *loader, const NameValuePairList &loadParameters=NameValuePairList())
Declares a resource to be a part of a resource group, allowing you to load and unload it as part of t...
Ogre::ResourceGroupManager::mResourceGroupListenerList
ResourceGroupListenerList mResourceGroupListenerList
Definition: OgreResourceGroupManager.h:305
Ogre::ResourceGroupManager::fireResourceLoadStarted
void fireResourceLoadStarted(const ResourcePtr &resource)
Internal event firing method.
Ogre::ResourceGroupManager::getResourceGroup
ResourceGroup * getResourceGroup(const String &name)
Get resource group.
Ogre::ResourceGroupManager::ResourceLocation
Resource location entry.
Definition: OgreResourceGroupManager.h:287
Ogre::ResourceGroupManager::ResourceGroup::worldGeometrySceneManager
SceneManager * worldGeometrySceneManager
Scene manager to use with linked world geometry.
Definition: OgreResourceGroupManager.h:349
Ogre::ResourceGroupManager::ResourceGroup::Status
Status
Definition: OgreResourceGroupManager.h:318
Ogre::ResourceGroupManager::getSingleton
static ResourceGroupManager & getSingleton(void)
Override standard Singleton retrieval.
Ogre::ResourceLoadingListener::resourceLoading
virtual DataStreamPtr resourceLoading(const String &name, const String &group, Resource *resource)=0
This event is called when a resource beings loading.
Ogre::ResourceGroupManager::deleteGroup
void deleteGroup(ResourceGroup *grp)
Delete a group for shutdown - don't notify ResourceManagers.
Ogre::ResourceGroupManager::_notifyAllResourcesRemoved
void _notifyAllResourcesRemoved(ResourceManager *manager)
Internal method called by ResourceManager when all resources for that manager are removed.
Ogre::ResourceGroupManager::isResourceGroupInitialised
bool isResourceGroupInitialised(const String &name)
Checks the status of a resource group.
Ogre::ResourceGroupManager::fireResourceCreated
void fireResourceCreated(const ResourcePtr &resource)
Internal event firing method.
Ogre::ResourceGroupManager::isResourceGroupInGlobalPool
bool isResourceGroupInGlobalPool(const String &name)
Checks the status of a resource group.
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Definition: OgreResourceGroupManager.h:270
Ogre::ResourceGroupManager::mLoadingListener
ResourceLoadingListener * mLoadingListener
Definition: OgreResourceGroupManager.h:307
Ogre::ResourceGroupManager::ResourceDeclaration::resourceType
String resourceType
Definition: OgreResourceGroupManager.h:277
Ogre::ResourceGroupManager::unloadResourceGroup
void unloadResourceGroup(const String &name, bool reloadableOnly=true)
Unloads a resource group.
Ogre::ResourceGroupManager::fireResourceGroupPrepareStarted
void fireResourceGroupPrepareStarted(const String &groupName, size_t resourceCount)
Internal event firing method.
Ogre::ResourceGroupManager::shutdownAll
void shutdownAll(void)
Shutdown all ResourceManagers, performed as part of clean-up.
Ogre::ResourceGroupManager::_notifyResourceGroupChanged
void _notifyResourceGroupChanged(const String &oldGroup, Resource *res)
Internal method to notify the group manager that a resource has changed group (only applicable for au...
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::ResourceGroupManager::mResourceManagerMap
ResourceManagerMap mResourceManagerMap
Map of resource types (strings) to ResourceManagers, used to notify them to load / unload group conte...
Definition: OgreResourceGroupManager.h:298
Ogre::ResourceGroupManager::_notifyResourceRemoved
void _notifyResourceRemoved(ResourcePtr &res)
Internal method called by ResourceManager when a resource is removed.
Ogre::ResourceGroupListener::resourceGroupPrepareStarted
virtual void resourceGroupPrepareStarted(const String &groupName, size_t resourceCount)
This event is fired when a resource group begins preparing.
Definition: OgreResourceGroupManager.h:121
Ogre::ResourceGroupManager::_registerResourceManager
void _registerResourceManager(const String &resourceType, ResourceManager *rm)
Internal method for registering a ResourceManager (which should be a singleton).
Ogre::ResourceGroupListener
This abstract class defines an interface which is called back during resource group loading to indica...
Definition: OgreResourceGroupManager.h:87
Ogre::ResourceGroupManager::fireResourceGroupScriptingEnded
void fireResourceGroupScriptingEnded(const String &groupName)
Internal event firing method.
Ogre::ResourceGroupManager::ResourceDeclarationList
list< ResourceDeclaration >::type ResourceDeclarationList
List of resource declarations.
Definition: OgreResourceGroupManager.h:282
Ogre::NameValuePairList
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:550
Ogre::ResourceLoadingListener::resourceStreamOpened
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.
Ogre::ResourceGroupManager::mResourceGroupMap
ResourceGroupMap mResourceGroupMap
Definition: OgreResourceGroupManager.h:360
Ogre::ResourceGroupManager::ResourceGroup::removeFromIndex
void removeFromIndex(const String &filename, Archive *arch)
Ogre::ResourceGroupManager::ScriptLoaderOrderMap
multimap< Real, ScriptLoader * >::type ScriptLoaderOrderMap
Map of loading order (Real) to ScriptLoader, used to order script parsing.
Definition: OgreResourceGroupManager.h:301
Ogre::ResourceGroupManager::fireResourceGroupLoadStarted
void fireResourceGroupLoadStarted(const String &groupName, size_t resourceCount)
Internal event firing method.
Ogre::ResourceGroupManager::ResourceGroup::worldGeometry
String worldGeometry
Linked world geometry, as passed to setWorldGeometry.
Definition: OgreResourceGroupManager.h:347
Ogre::StringUtil::BLANK
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Ogre::ResourceGroupManager::loadResourceGroup
void loadResourceGroup(const String &name, bool loadMainResources=true, bool loadWorldGeom=true)
Loads a resource group.
Ogre::ResourceGroupManager::ResourceLocation::recursive
bool recursive
Whether this location was added recursively.
Definition: OgreResourceGroupManager.h:291
Ogre::ResourceGroupManager::initialiseAllResourceGroups
void initialiseAllResourceGroups(void)
Initialise all resource groups which are yet to be initialised.
OgreHeaderPrefix.h
Ogre::ResourceGroupManager::isResourceGroupLoaded
bool isResourceGroupLoaded(const String &name)
Checks the status of a resource group.
Ogre::list
Definition: OgrePrerequisites.h:506
Ogre::ResourceGroupManager::ResourceGroup::resourceDeclarations
ResourceDeclarationList resourceDeclarations
Pre-declared resources, ready to be created.
Definition: OgreResourceGroupManager.h:340
Ogre::ResourceGroupListener::scriptParseEnded
virtual void scriptParseEnded(const String &scriptName, bool skipped)=0
This event is fired when the script has been fully parsed.
Ogre::ResourceGroupManager::LocationList
list< ResourceLocation * >::type LocationList
List of possible file locations.
Definition: OgreResourceGroupManager.h:294
Ogre::ResourceGroupListener::~ResourceGroupListener
virtual ~ResourceGroupListener()
Definition: OgreResourceGroupManager.h:89
Ogre::SceneManager
Manages the organisation and rendering of a 'scene' i.e.
Definition: OgreSceneManager.h:144
Ogre::ResourceGroupManager::_notifyWorldGeometryStageEnded
void _notifyWorldGeometryStageEnded(void)
Notify this manager that one stage of world geometry loading has been completed.
Ogre::ResourceLoadingListener
Definition: OgreResourceGroupManager.h:194
Ogre::ResourceGroupManager::dropGroupContents
void dropGroupContents(ResourceGroup *grp)
Drops contents of a group, leave group there, notify ResourceManagers.
OgrePrerequisites.h
Ogre::ResourceGroupListener::resourceGroupLoadEnded
virtual void resourceGroupLoadEnded(const String &groupName)=0
This event is fired when a resource group finished loading.
Ogre::ResourceGroupListener::worldGeometryStageEnded
virtual void worldGeometryStageEnded(void)=0
This event is fired when a stage of loading linked world geometry has been completed.
Ogre::ResourceGroupManager::fireResourceGroupLoadEnded
void fireResourceGroupLoadEnded(const String &groupName)
Internal event firing method.
Ogre::ResourceGroupManager::fireResourcePrepareEnded
void fireResourcePrepareEnded(void)
Internal event firing method.
Ogre::ResourceGroupManager::getSingletonPtr
static ResourceGroupManager * getSingletonPtr(void)
Override standard Singleton retrieval.
Ogre::ResourceGroupManager::getLoadingListener
ResourceLoadingListener * getLoadingListener()
Returns the current loading listener.
Ogre::ResourceGroupManager::getResourceLocationList
const LocationList & getResourceLocationList(const String &groupName)
Get the list of resource locations for the specified group name.
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:65
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
Definition: OgreResourceGroupManager.h:266
Ogre::ResourceGroupManager::ResourceGroup::inGlobalPool
bool inGlobalPool
Definition: OgreResourceGroupManager.h:351
Ogre::ResourceGroupManager::ResourceGroup::OGRE_AUTO_MUTEX
OGRE_AUTO_MUTEX
General mutex for dealing with group content.
Definition: OgreResourceGroupManager.h:326
Ogre::ResourceGroupListener::resourceLoadStarted
virtual void resourceLoadStarted(const ResourcePtr &resource)=0
This event is fired when a declared resource is about to be loaded.
Ogre::ResourceGroupManager::destroyResourceGroup
void destroyResourceGroup(const String &name)
Destroys a resource group, clearing it first, destroying the resources which are part of it,...
Ogre::ResourceGroupListener::resourceGroupScriptingStarted
virtual void resourceGroupScriptingStarted(const String &groupName, size_t scriptCount)=0
This event is fired when a resource group begins parsing scripts.
Ogre::ResourceGroupManager::addResourceLocation
void addResourceLocation(const String &name, const String &locType, const String &resGroup=DEFAULT_RESOURCE_GROUP_NAME, bool recursive=false, bool readOnly=true)
Method to add a resource location to for a given resource group.
Ogre::ResourceGroupManager::fireResourceLoadEnded
void fireResourceLoadEnded(void)
Internal event firing method.
Ogre::ResourceGroupManager::fireResourceRemove
void fireResourceRemove(const ResourcePtr &resource)
Internal event firing method.
Ogre::ResourceGroupManager::ResourceGroup::LoadResourceOrderMap
map< Real, LoadUnloadResourceList * >::type LoadResourceOrderMap
Created resources which are ready to be loaded / unloaded.
Definition: OgreResourceGroupManager.h:344
Ogre::ResourceGroupManager::ResourceGroupMap
map< String, ResourceGroup * >::type ResourceGroupMap
Map from resource group names to groups.
Definition: OgreResourceGroupManager.h:359
Ogre::ResourceGroupManager::clearResourceGroup
void clearResourceGroup(const String &name)
Clears a resource group.
OgreResource.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::ResourceGroupManager::getResourceManagerIterator
ResourceManagerIterator getResourceManagerIterator()
Get an iterator over the registered resource managers.
Definition: OgreResourceGroupManager.h:979
Ogre::ResourceGroupManager::listResourceLocations
StringVectorPtr listResourceLocations(const String &groupName)
List all resource locations in a resource group.
OgreCommon.h
Ogre::ResourceGroupManager::openResource
DataStreamPtr openResource(const String &resourceName, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME, bool searchGroupsIfNotFound=true, Resource *resourceBeingLoaded=0)
Open a single resource by name and return a DataStream pointing at the source of the data.
Ogre::ResourceManager
Defines a generic resource handler.
Definition: OgreResourceManager.h:123
Ogre::ResourceGroupManager::removeResourceLocation
void removeResourceLocation(const String &name, const String &resGroup=DEFAULT_RESOURCE_GROUP_NAME)
Removes a resource location from the search path.
Ogre::ResourceGroupManager::findGroupContainingResource
const String & findGroupContainingResource(const String &filename)
Find the group in which a resource exists.
Ogre::ResourceGroupManager::deleteMatchingResources
void deleteMatchingResources(const String &filePattern, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME, const String &locationPattern=StringUtil::BLANK)
Delete all matching resource files.
Ogre::ResourceGroupManager::setWorldResourceGroupName
void setWorldResourceGroupName(const String &groupName)
Sets the resource group that 'world' resources will use.
Definition: OgreResourceGroupManager.h:918
Ogre::ResourceGroupListener::worldGeometryStageStarted
virtual void worldGeometryStageStarted(const String &description)=0
This event is fired when a stage of loading linked world geometry is about to start.
Ogre::ResourceGroupManager::_notifyResourceCreated
void _notifyResourceCreated(ResourcePtr &res)
Internal method called by ResourceManager when a resource is created.
Ogre::ResourceGroupManager::~ResourceGroupManager
virtual ~ResourceGroupManager()
Ogre::ResourceGroupManager::OGRE_AUTO_MUTEX
OGRE_AUTO_MUTEX
Definition: OgreResourceGroupManager.h:264
Ogre::ResourceGroupManager::getResourceDeclarationList
ResourceDeclarationList getResourceDeclarationList(const String &groupName)
Get the list of resource declarations for the specified group name.
Ogre::ResourceGroupManager::findResourceLocation
StringVectorPtr findResourceLocation(const String &groupName, const String &pattern)
Find all resource location names matching a given pattern in a resource group.
Ogre::ResourceGroupManager::createResource
DataStreamPtr createResource(const String &filename, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME, bool overwrite=false, const String &locationPattern=StringUtil::BLANK)
Create a new resource file in a given group.
Ogre::ResourceGroupManager::resourceExists
bool resourceExists(ResourceGroup *group, const String &filename)
Find out if the named file exists in a group.
Ogre::multimap
Definition: OgrePrerequisites.h:548
Ogre::ScriptLoader
Abstract class defining the interface used by classes which wish to perform script loading to define ...
Definition: OgreScriptLoader.h:60
Ogre::SharedPtr< Resource >
Ogre::ResourceGroupManager::ResourceLocation::archive
Archive * archive
Pointer to the archive which is the destination.
Definition: OgreResourceGroupManager.h:289
Ogre::ResourceGroupListener::resourcePrepareEnded
virtual void resourcePrepareEnded(void)
This event is fired when the resource has been prepared.
Definition: OgreResourceGroupManager.h:132
Ogre::ResourceGroupListener::resourcePrepareStarted
virtual void resourcePrepareStarted(const ResourcePtr &resource)
This event is fired when a declared resource is about to be prepared.
Definition: OgreResourceGroupManager.h:127
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::ResourceGroupManager::fireScriptEnded
void fireScriptEnded(const String &scriptName, bool skipped)
Internal event firing method.
Ogre::ResourceGroupManager::fireResourcePrepareStarted
void fireResourcePrepareStarted(const ResourcePtr &resource)
Internal event firing method.
OgreIteratorWrappers.h
Ogre::ResourceGroupManager::listResourceNames
StringVectorPtr listResourceNames(const String &groupName, bool dirs=false)
List all file or directory names in a resource group.
Ogre::ResourceGroupManager::ResourceDeclaration::loader
ManualResourceLoader * loader
Definition: OgreResourceGroupManager.h:278
Ogre::Resource
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:80
Ogre::ResourceGroupManager::ResourceGroupListenerList
vector< ResourceGroupListener * >::type ResourceGroupListenerList
Definition: OgreResourceGroupManager.h:304
Ogre::ResourceGroupManager::ResourceGroup::addToIndex
void addToIndex(const String &filename, Archive *arch)
Ogre::ResourceGroupManager::ResourceGroup::groupStatus
Status groupStatus
Group status.
Definition: OgreResourceGroupManager.h:332
Ogre::ResourceGroupManager::unloadUnreferencedResourcesInGroup
void unloadUnreferencedResourcesInGroup(const String &name, bool reloadableOnly=true)
Unload all resources which are not referenced by any other object.
Ogre::ResourceGroupManager::ResourceLocationIndex
map< String, Archive * >::type ResourceLocationIndex
Resource index entry, resourcename->location.
Definition: OgreResourceGroupManager.h:310
Ogre::ResourceGroupManager::ResourceManagerMap
map< String, ResourceManager * >::type ResourceManagerMap
Definition: OgreResourceGroupManager.h:283
Ogre::ResourceGroupManager::resourceModifiedTime
time_t resourceModifiedTime(const String &group, const String &filename)
Retrieve the modification time of a given file.
Ogre::ResourceGroupManager::linkWorldGeometryToResourceGroup
void linkWorldGeometryToResourceGroup(const String &group, const String &worldGeometry, SceneManager *sceneManager)
Associates some world geometry with a resource group, causing it to be loaded / unloaded with the res...
Ogre::ResourceGroupManager::ResourceManagerIterator
MapIterator< ResourceManagerMap > ResourceManagerIterator
Definition: OgreResourceGroupManager.h:284
Ogre::ResourceGroupManager::findResourceNames
StringVectorPtr findResourceNames(const String &groupName, const String &pattern, bool dirs=false)
Find all file or directory names matching a given pattern in a resource group.
Ogre::ResourceGroupManager::_notifyWorldGeometryStageStarted
void _notifyWorldGeometryStageStarted(const String &description)
Notify this manager that one stage of world geometry loading has been started.
Ogre::ResourceGroupManager::ResourceGroupManager
ResourceGroupManager()
Ogre::Archive
Archive-handling class.
Definition: OgreArchive.h:89
Ogre::ResourceGroupManager::fireScriptStarted
void fireScriptStarted(const String &scriptName, bool &skipScript)
Internal event firing method.
Ogre::ResourceGroupManager::ResourceGroup::resourceIndexCaseInsensitive
ResourceLocationIndex resourceIndexCaseInsensitive
Index of resource names to locations, built for speedy access (case insensitive archives)
Definition: OgreResourceGroupManager.h:338
Ogre::ResourceGroupManager::ResourceGroup::loadResourceOrderMap
LoadResourceOrderMap loadResourceOrderMap
Definition: OgreResourceGroupManager.h:345
Ogre::ResourceGroupListener::resourceCreated
virtual void resourceCreated(const ResourcePtr &resource)
This event is fired when a resource was just created.
Definition: OgreResourceGroupManager.h:179
Ogre::ResourceGroupManager::ResourceGroup::removeFromIndex
void removeFromIndex(Archive *arch)
Ogre::ResourceGroupManager::declareResource
void declareResource(const String &name, const String &resourceType, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME, const NameValuePairList &loadParameters=NameValuePairList())
Declares a resource to be a part of a resource group, allowing you to load and unload it as part of t...
Ogre::ResourceGroupManager::_registerScriptLoader
void _registerScriptLoader(ScriptLoader *su)
Internal method for registering a ScriptLoader.
Ogre::ResourceGroupListener::scriptParseStarted
virtual void scriptParseStarted(const String &scriptName, bool &skipThisScript)=0
This event is fired when a script is about to be parsed.
Ogre::ResourceGroupListener::worldGeometryPrepareStageEnded
virtual void worldGeometryPrepareStageEnded(void)
This event is fired when a stage of preparing linked world geometry has been completed.
Definition: OgreResourceGroupManager.h:145
Ogre::ResourceGroupManager::prepareResourceGroup
void prepareResourceGroup(const String &name, bool prepareMainResources=true, bool prepareWorldGeom=true)
Prepares a resource group.
Ogre::ResourceGroupListener::resourceLoadEnded
virtual void resourceLoadEnded(void)=0
This event is fired when the resource has been loaded.
Ogre::ResourceGroupManager::parseResourceGroupScripts
void parseResourceGroupScripts(ResourceGroup *grp)
Parses all the available scripts found in the resource locations for the given group,...
Ogre::ResourceLoadingListener::~ResourceLoadingListener
virtual ~ResourceLoadingListener()
Definition: OgreResourceGroupManager.h:196
Ogre::ResourceGroupManager::getResourceGroups
StringVector getResourceGroups(void)
Get a list of the currently defined resource groups.
Ogre::ResourceGroupManager::fireResourceGroupPrepareEnded
void fireResourceGroupPrepareEnded(const String &groupName)
Internal event firing method.
Ogre::ResourceGroupManager::resourceModifiedTime
time_t resourceModifiedTime(ResourceGroup *group, const String &filename)
Internal modification time retrieval.
Ogre::ResourceGroupManager::ResourceDeclaration::parameters
NameValuePairList parameters
Definition: OgreResourceGroupManager.h:279
Ogre::vector
Definition: OgrePrerequisites.h:492
Ogre::ResourceLoadingListener::resourceCollision
virtual bool resourceCollision(Resource *resource, ResourceManager *resourceManager)=0
This event is called when a resource collides with another existing one in a resource manager.
Ogre::ResourceGroupManager::ResourceGroup::locationList
LocationList locationList
List of possible locations to search.
Definition: OgreResourceGroupManager.h:334
Ogre::ManualResourceLoader
Interface describing a manual resource loader.
Definition: OgreResource.h:515
Ogre::ResourceGroupManager::unlinkWorldGeometryFromResourceGroup
void unlinkWorldGeometryFromResourceGroup(const String &group)
Clear any link to world geometry from a resource group.
Ogre::ResourceGroupListener::resourceGroupLoadStarted
virtual void resourceGroupLoadStarted(const String &groupName, size_t resourceCount)=0
This event is fired when a resource group begins loading.
Ogre::ResourceGroupManager::openResources
DataStreamListPtr openResources(const String &pattern, const String &groupName=DEFAULT_RESOURCE_GROUP_NAME)
Open all resources matching a given pattern (which can contain the character '*' as a wildcard),...
Ogre::ResourceGroupManager::resourceExists
bool resourceExists(const String &group, const String &filename)
Find out if the named file exists in a group.
Ogre::ResourceGroupManager::ResourceGroup::OGRE_MUTEX
OGRE_MUTEX(statusMutex)
Status-specific mutex, separate from content-changing mutex.
Ogre::ResourceGroupManager::mWorldGroupName
String mWorldGroupName
Group name for world resources.
Definition: OgreResourceGroupManager.h:363
OgreDataStream.h
Ogre::ResourceGroupManager::_getResourceManager
ResourceManager * _getResourceManager(const String &resourceType)
Internal method for getting a registered ResourceManager.
Ogre::ResourceGroupManager::_unregisterResourceManager
void _unregisterResourceManager(const String &resourceType)
Internal method for unregistering a ResourceManager.
Ogre::ResourceGroupManager::addCreatedResource
void addCreatedResource(ResourcePtr &res, ResourceGroup &group)
Adds a created resource to a group.
Ogre::ResourceGroupManager::resourceExistsInAnyGroup
bool resourceExistsInAnyGroup(const String &filename)
Find out if the named file exists in any group.
Ogre::ResourceGroupManager::findGroupContainingResourceImpl
ResourceGroup * findGroupContainingResourceImpl(const String &filename)
Internal find method for auto groups.
Ogre::ResourceGroupManager
This singleton class manages the list of resource groups, and notifying the various resource managers...
Definition: OgreResourceGroupManager.h:262
OgreArchive.h
Ogre::ResourceGroupListener::resourceGroupPrepareEnded
virtual void resourceGroupPrepareEnded(const String &groupName)
This event is fired when a resource group finished preparing.
Definition: OgreResourceGroupManager.h:147
Ogre::ResourceGroupListener::resourceGroupScriptingEnded
virtual void resourceGroupScriptingEnded(const String &groupName)=0
This event is fired when a resource group finished parsing scripts.
Ogre::ResourceGroupManager::initialiseResourceGroup
void initialiseResourceGroup(const String &name)
Initialises a resource group.
Ogre::ResourceGroupManager::addResourceGroupListener
void addResourceGroupListener(ResourceGroupListener *l)
Adds a ResourceGroupListener which will be called back during resource loading events.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.