31using std::placeholders::_1;
47 : name(
util::sanitise (n))
62 TRACE (asset_mem,
"ctor Asset(id=%zu) : adr=%p %s",
size_t(
id),
this,
cStr(this->
ident) );
67 TRACE (asset_mem,
"dtor Asset(id=%zu) : adr=%p",
size_t(
id),
this );
71 Asset::Ident::operator string ()
const
73 return string (
_Fmt(
"(%2%:%3%.%1% v%4%)")
81 Asset::operator string ()
const
83 return string (
_Fmt(
"Asset(%2%:%3%.%1% v%4%)")
94 return not isnil (
name)
152 other->unlink (this->
id);
186 REQUIRE (!contains (parent->dependants, p_this));
187 REQUIRE (!contains (this->
parents, parent));
189 parent->dependants.push_back(p_this);
Steam-Layer Interface: Assets.
Steam-Layer Interface: Asset Lookup and Organisation.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Facade for the Asset subsystem.
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
Superinterface describing especially bookkeeping properties.
const Ident ident
Asset identification tuple.
void defineDependency(PAsset parent)
establish a connection between this and the given parent asset, denoting we are in some way dependent...
void unregister(PAsset &other)
bool isActive() const
weather this asset is switched on and consequently included in the fixture and participates in render...
bool enable(bool on=true)
change the enabled status of this asset.
vector< PAsset > dependants
const ID< Asset > id
Asset primary key.
virtual void unlink()
release all links to other Asset objects held internally.
Asset(const Ident &idi)
Asset is a Interface class; usually, objects of concrete subclasses are created via specialised Facto...
Tree like classification of Assets.
A front-end for using printf-style formatting.
The asset subsystem of the Steam-Layer.
bool all_parents_enabled(const vector< PAsset > &parents)
void propagate_down(PAsset child, bool on)
function< bool(const PAsset &)> check_isActive
Steam-Layer implementation namespace root.
bool contains(MAP &map, typename MAP::key_type const &key)
shortcut for containment test on a map
bool and_all(IT i, IT end, FUN predicate)
All quantification: check if all elements of a collection satisfy the given predicate.
SEQ::iterator removeall(SEQ &coll, typename SEQ::value_type const &val)
shortcut for removing all copies of an Element in any sequential collection
disable_if< can_IterForEach< Container >, FUN > for_each(Container const &coll, FUN doIt)
operate on all elements of a STL container.
bool isnil(lib::time::Duration const &dur)
a POD comprised of all the information sufficiently identifying any given Asset.
string name
element ID, comprehensible but sanitised.
const uint version
version number of the thing or concept represented by this asset.
const string org
origin or authorship id.
Ident(string const &n, Category const &cat, string const &o="lumi", const uint ver=1)
CStr cStr(std::string const &rendered)
convenience shortcut: forced conversion to c-String via string.
Perform operations "for each element" of a collection.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...