32#include <unordered_map>
33#include <boost/utility.hpp>
39 using std::static_pointer_cast;
40 using std::dynamic_pointer_cast;
43 using lib::RecursiveLock_NoWait;
52 boost::hash_combine(
hash, idi.
org);
77 using IdHashtable = std::unordered_map<size_t, PAsset, IdentityHash>;
89 ,
public Sync<RecursiveLock_NoWait>
110 return dynamic_pointer_cast<KIND,Asset> (
find (
hash));
147 IdHashtable::iterator i =
table.begin();
148 IdHashtable::iterator e =
table.end();
150 i->second->dependants.clear();
161 IdHashtable::const_iterator i =
table.begin();
162 IdHashtable::const_iterator e =
table.end();
164 output.push_back (i->second);
172 static const PAsset NULLP;
173 IdHashtable::const_iterator i =
table.find (
hash);
174 if (i ==
table.end())
Steam-Layer Interface: Assets.
Helper to abstract creation and lifecycle of a dependency.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Facility for monitor object based locking.
Superinterface describing especially bookkeeping properties.
Implementation of the registry holding all Asset instances known to the Asset Manager subsystem.
void put(ID< Asset > hash, PAsset &ptr)
lib::P< KIND > get(ID< KIND > hash) const
void asList(list< PcAsset > &output) const
intended for diagnostics
const PAsset & find(size_t hash) const
bool del(ID< Asset > hash)
void put(ID< KIND > hash, lib::P< KIND > &ptr)
void clear()
removes all registered assets and does something similar to Asset::unlink() on each to break cyclic d...
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Any copy and copy construction prohibited.
Per type specific configuration of instances created as service dependencies.
Lumiera error handling (C++ interface).
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error.
The asset subsystem of the Steam-Layer.
size_t hash_value(Category const &cat)
std::unordered_map< size_t, PAsset, IdentityHash > IdHashtable
Steam-Layer implementation namespace root.
a POD comprised of all the information sufficiently identifying any given Asset.
asset::Category category
primary tree like classification of the asset.
string name
element ID, comprehensible but sanitised.
const string org
origin or authorship id.
trivial hash functor returns any hash value unmodified.
size_t operator()(size_t val) const
Object Monitor based synchronisation.