OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
resourcemanager.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_RESOURCE_MANAGER_H
2 #define OPENMW_COMPONENTS_RESOURCE_MANAGER_H
3 
4 #include <osg/ref_ptr>
5 
6 namespace VFS
7 {
8  class Manager;
9 }
10 
11 namespace Resource
12 {
13  class ObjectCache;
14 
18  {
19  public:
20  ResourceManager(const VFS::Manager* vfs);
21  virtual ~ResourceManager();
22 
24  virtual void updateCache(double referenceTime);
25 
27  void setExpiryDelay (double expiryDelay);
28 
29  const VFS::Manager* getVFS() const;
30 
31  protected:
33  osg::ref_ptr<Resource::ObjectCache> mCache;
34  double mExpiryDelay;
35  };
36 
37 }
38 
39 #endif
osg::ref_ptr< Resource::ObjectCache > mCache
Definition: resourcemanager.hpp:33
virtual ~ResourceManager()
Definition: resourcemanager.cpp:16
ResourceManager(const VFS::Manager *vfs)
Definition: resourcemanager.cpp:8
const VFS::Manager * getVFS() const
Definition: resourcemanager.cpp:31
virtual void updateCache(double referenceTime)
Clear cache entries that have not been referenced for longer than expiryDelay.
Definition: resourcemanager.cpp:20
void setExpiryDelay(double expiryDelay)
How long to keep objects in cache after no longer being referenced.
Definition: resourcemanager.cpp:26
double mExpiryDelay
Definition: resourcemanager.hpp:34
const VFS::Manager * mVFS
Definition: resourcemanager.hpp:32
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