13 #ifndef ASSETSCOLLECTION_H
14 #define ASSETSCOLLECTION_H
17 #include <unordered_map>
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;