38 template <
typename Resource,
typename Id,
typename OnLoad>
44 template <
typename Resource,
typename Id,
typename OnLoad>
48 if (m_resources.count(
id) != 0)
62 ResourcePtr ptr = m_onLoad(
id);
67 m_resources[id] = ptr;
77 template <
typename Resource,
typename Id,
typename OnLoad>
80 delete m_resources[id];
81 m_resources.erase(
id);
84 template <
typename Resource,
typename Id,
typename OnLoad>
87 for (MapIterator it = m_resources.begin(); it != m_resources.end(); ++it)
94 template <
typename Resource,
typename Id,
typename OnLoad>
97 MapConstIterator it = m_resources.find(
id);
99 if (it != m_resources.end())
105 throw std::invalid_argument(
"Resource not loaded");
109 template <
typename Resource,
typename Id,
typename OnLoad>
112 MapIterator it = m_resources.find(
id);
114 if (it != m_resources.end())
120 throw std::invalid_argument(
"Resource not loaded");