32 #include "../api_core.h"
33 #include "../System/userdata.h"
42 class ResourceManager_Impl;
59 template<
typename Type>
60 std::shared_ptr<Type>
get_cache(
const std::string &name)
const
62 return get_cache_owner(name).get_data<Type>();
69 template<
typename Type>
70 void set_cache(
const std::string &name,
const std::shared_ptr<Type> &cache)
72 set_cache_owner(name).set_data<Type>(cache);
79 UserDataOwner &get_cache_owner(
const std::string &name)
const;
82 std::shared_ptr<ResourceManager_Impl> impl;
void set_cache(const std::string &name, const std::shared_ptr< Type > &cache)
Definition: resource_manager.h:70
std::shared_ptr< Type > get_cache(const std::string &name) const
Definition: resource_manager.h:60
Resource manager.
Definition: resource_manager.h:45
Helper class to store any shared_ptr as user data on an object.
Definition: userdata.h:55