Go to the documentation of this file.
13 #ifndef ASSETSCOLLECTION_H
14 #define ASSETSCOLLECTION_H
35 template <
class T,
class Key>
54 template<
class T,
class Key = std::
string>
95 T *add = asset_create<T>(
name);
110 return asset !=
m_assets.end() ? asset->second :
nullptr;
124 replace(existing->second, asset);
125 return existing->second;
183 std::vector<Key>
keys()
const {
185 std::for_each(
m_assets.cbegin(),
m_assets.cend(), [&k] (
const auto &asset) { k.push_back(asset.first); });
198 virtual void replace(T *existing, T *update) = 0;
static event_registration c
virtual void replace(T *existing, T *update)=0
std::set< Key > m_undefined
void asset_destroy(T *asset)
Plugin animator file specs[Config] name
virtual ~AssetsCollection()
T * first(std::function< bool(const T *)> op)
T * find(const Key &name)
T * asset_create(const Key &key)
std::vector< Key > keys() const
const std::set< Key > & undefined() const
void each(std::function< void(T *)> op)
T * define(const Key &name, T *asset)
std::map< Key, T * > m_assets