31#include "../System/userdata.h"
40 class ResourceManager_Impl;
50 template<
typename Type>
51 std::shared_ptr<Type>
get_cache(
const std::string &name)
const
53 return get_cache_owner(name).
get_data<Type>();
56 template<
typename Type>
57 void set_cache(
const std::string &name,
const std::shared_ptr<Type> &cache)
59 set_cache_owner(name).
set_data<Type>(cache);
63 UserDataOwner &get_cache_owner(
const std::string &name)
const;
66 std::shared_ptr<ResourceManager_Impl> impl;
Resource manager.
Definition: resource_manager.h:44
std::shared_ptr< Type > get_cache(const std::string &name) const
Definition: resource_manager.h:51
void set_cache(const std::string &name, const std::shared_ptr< Type > &cache)
Definition: resource_manager.h:57
ResourceManager()
Construct a ResourceManager.
Helper class to store any shared_ptr as user data on an object.
Definition: userdata.h:54
std::shared_ptr< T > get_data()
Definition: userdata.h:84
void set_data(const std::shared_ptr< T > &data)
Definition: userdata.h:71