18 #ifndef __H__OCULAR_RESOURCES_RESOURCE_MANAGER__H__
19 #define __H__OCULAR_RESOURCES_RESOURCE_MANAGER__H__
24 #include <unordered_map>
26 #include "ResourceDetails.hpp"
27 #include "ResourceMemoryDetails.hpp"
28 #include "ResourcePriorityBehaviour.hpp"
29 #include "ResourceExplorer.hpp"
30 #include "ResourceLoader.hpp"
31 #include "ResourceLoaderManager.hpp"
32 #include "ResourceSaver.hpp"
33 #include "ResourceSaverManager.hpp"
34 #include "ResourceDefaults.hpp"
127 void unloadAllResources();
362 void isFileTypeSupported(std::string
const& extension,
bool& canLoad,
bool& canSave)
const;
403 std::unordered_map<std::string, std::shared_ptr<ResourceDetails>> m_ResourceMap;
404 std::unordered_map<std::string, File> m_FileMap;
412 ResourcePriorityBehaviour m_PriorityBehaviour;
414 uint64_t m_MemoryLimit;
T * getResource(std::string const &path)
Definition: ResourceManager.hpp:189
Definition: ResourceExplorer.hpp:49
Definition: ResourceSaverManager.hpp:44
ResourceDetails * findLeastFrequentlyUsed()
Definition: ResourceManager.cpp:664
bool forceLoadResource(std::string const &path)
Definition: ResourceManager.cpp:121
ResourceDetails * findSizeAscending()
Definition: ResourceManager.cpp:708
void isFileTypeSupported(std::string const &extension, bool &canLoad, bool &canSave) const
Definition: ResourceManager.cpp:554
void getResourcesOfType(ResourceType type, std::vector< std::string > &resources)
Definition: ResourceManager.cpp:560
unsigned getNumberOfResourceLoaders() const
Definition: ResourceManager.cpp:544
Maintains a resource and usage details.
Definition: ResourceDetails.hpp:44
Definition: ResourceDefaults.hpp:38
unsigned getNumberOfResourceSavers() const
Definition: ResourceManager.cpp:549
void setMemoryLimit(uint64_t maxMemory)
Definition: ResourceManager.cpp:503
ResourceDetails * findLeastRecentlyUsed()
Definition: ResourceManager.cpp:686
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
void registerResourceLoader(std::shared_ptr< AResourceLoader > loader)
Definition: ResourceManager.cpp:529
Resource * getEmptyResource(ResourceType type)
Definition: ResourceManager.cpp:370
void setSourceDirectory(std::string const &directory)
Definition: ResourceManager.cpp:519
std::string getResourceMappingName(File const &file) const
Definition: ResourceManager.cpp:395
bool addResource(std::string const &name, File const &sourceFile, Resource *resource, ResourceType type)
Definition: ResourceManager.cpp:199
bool saveResource(Resource *resource, File const &file)
Definition: ResourceManager.cpp:477
bool forceUnloadResource(std::string const &path)
Definition: ResourceManager.cpp:171
void freeMemorySpace()
Definition: ResourceManager.cpp:602
std::string const & getSourceDirectory() const
Definition: ResourceManager.cpp:524
Resource * getResource(std::string const &path)
Definition: ResourceManager.cpp:229
void setSourceBlacklist(std::list< std::string > const &blacklist)
Definition: ResourceManager.cpp:514
bool doesExist(std::string const &path)
Definition: ResourceManager.cpp:446
Definition: ResourceLoaderManager.hpp:44
Resource * getMissingResource(ResourceType type)
Definition: ResourceManager.cpp:375
File getResourceFile(std::string const &path) const
Definition: ResourceManager.cpp:380
void forceSourceRefresh()
Definition: ResourceManager.cpp:90
Definition: ResourceMemoryDetails.hpp:41
unsigned getNumberOfResources() const
Definition: ResourceManager.cpp:539
void registerResourceSaver(std::shared_ptr< AResourceSaver > loader)
Definition: ResourceManager.cpp:534
ResourceMemoryDetails getMemoryUsage()
Definition: ResourceManager.cpp:224
bool isInMemory(std::string const &path)
Definition: ResourceManager.cpp:426
void setPriorityBehaviour(ResourcePriorityBehaviour behaviour)
Definition: ResourceManager.cpp:509
Definition: ResourceManager.hpp:110
Resource * loadUnmanagedFile(File const &file)
Definition: ResourceManager.cpp:461
ResourceDetails * findSizeDescending()
Definition: ResourceManager.cpp:730
Definition: Resource.hpp:46