32 #include "../System/userdata.h"
41 class ResourceManager_Impl;
58 template<
typename Type>
59 std::shared_ptr<Type>
get_cache(
const std::string &name)
const
61 return get_cache_owner(name).
get_data<Type>();
68 template<
typename Type>
69 void set_cache(
const std::string &name,
const std::shared_ptr<Type> &cache)
71 set_cache_owner(name).
set_data<Type>(cache);
78 UserDataOwner &get_cache_owner(
const std::string &name)
const;
81 std::shared_ptr<ResourceManager_Impl> impl;
Resource manager.
Definition: resource_manager.h:45
std::shared_ptr< Type > get_cache(const std::string &name) const
Definition: resource_manager.h:59
Helper class to store any shared_ptr as user data on an object.
Definition: userdata.h:55
std::shared_ptr< T > get_data()
Definition: userdata.h:85
void set_cache(const std::string &name, const std::shared_ptr< Type > &cache)
Definition: resource_manager.h:69
void set_data(const std::shared_ptr< T > &data)
Definition: userdata.h:72
ResourceManager()
Construct a ResourceManager.