OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
resourcesystem.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_RESOURCE_RESOURCESYSTEM_H
2 #define OPENMW_COMPONENTS_RESOURCE_RESOURCESYSTEM_H
3 
4 #include <memory>
5 #include <vector>
6 
7 namespace VFS
8 {
9  class Manager;
10 }
11 
12 namespace Resource
13 {
14 
15  class SceneManager;
16  class ImageManager;
17  class NifFileManager;
18  class KeyframeManager;
19  class ResourceManager;
20 
25  {
26  public:
27  ResourceSystem(const VFS::Manager* vfs);
29 
34 
37  void updateCache(double referenceTime);
38 
41  void addResourceManager(ResourceManager* resourceMgr);
44  void removeResourceManager(ResourceManager* resourceMgr);
45 
47  void setExpiryDelay(double expiryDelay);
48 
50  const VFS::Manager* getVFS() const;
51 
52  private:
53  std::auto_ptr<SceneManager> mSceneManager;
54  std::auto_ptr<ImageManager> mImageManager;
55  std::auto_ptr<NifFileManager> mNifFileManager;
56  std::auto_ptr<KeyframeManager> mKeyframeManager;
57 
58  // Store the base classes separately to get convenient access to the common interface
59  // Here users can register their own resourcemanager as well
60  std::vector<ResourceManager*> mResourceManagers;
61 
63 
65  void operator = (const ResourceSystem&);
66  };
67 
68 }
69 
70 #endif
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:24
void updateCache(double referenceTime)
Definition: resourcesystem.cpp:65
std::auto_ptr< SceneManager > mSceneManager
Definition: resourcesystem.hpp:53
Handles loading and caching of scenes, e.g. .nif files or .osg files.
Definition: scenemanager.hpp:37
KeyframeManager * getKeyframeManager()
Definition: resourcesystem.cpp:50
std::auto_ptr< ImageManager > mImageManager
Definition: resourcesystem.hpp:54
~ResourceSystem()
Definition: resourcesystem.cpp:26
ImageManager * getImageManager()
Definition: resourcesystem.cpp:40
std::auto_ptr< NifFileManager > mNifFileManager
Definition: resourcesystem.hpp:55
Managing of keyframe resources.
Definition: keyframemanager.hpp:19
ResourceSystem(const VFS::Manager *vfs)
Definition: resourcesystem.cpp:11
Handles loading/caching of Images.
Definition: imagemanager.hpp:23
const VFS::Manager * mVFS
Definition: resourcesystem.hpp:62
void removeResourceManager(ResourceManager *resourceMgr)
Definition: resourcesystem.cpp:76
std::vector< ResourceManager * > mResourceManagers
Definition: resourcesystem.hpp:60
void addResourceManager(ResourceManager *resourceMgr)
Definition: resourcesystem.cpp:71
const VFS::Manager * getVFS() const
Definition: resourcesystem.cpp:83
SceneManager * getSceneManager()
Definition: resourcesystem.cpp:35
std::auto_ptr< KeyframeManager > mKeyframeManager
Definition: resourcesystem.hpp:56
void operator=(const ResourceSystem &)
Handles caching of NIFFiles.
Definition: niffilemanager.hpp:15
The main class responsible for loading files from a virtual file system.
Definition: manager.hpp:20
Base class for managers that require a virtual file system and object cache.
Definition: resourcemanager.hpp:17
void setExpiryDelay(double expiryDelay)
How long to keep objects in cache after no longer being referenced.
Definition: resourcesystem.cpp:55
NifFileManager * getNifFileManager()
Definition: resourcesystem.cpp:45