38 using std::static_pointer_cast;
40 using std::placeholders::_1;
59 using error::Invalid::Invalid;
71 :
IDErr(
_Fmt(
"Query for Asset with ID=%d, which up to now " 72 "hasn't been created or encountered.") % aID
73 ,LERR_(UNKNOWN_ASSET_ID))
80 :
IDErr (
_Fmt(
"Request for Asset(%s), specifying an Asset kind, " 81 "that doesn't match the actual type (and can't be " 82 "casted either).") % idi
83 ,LERR_(WRONG_ASSET_KIND))
96 AssetManager::AssetManager ()
106 return asset::hash_value (idi);
121 DB& registry (_aMang.registry);
129 registry.put (asset_id, smart_ptr);
161 ENSURE (instance().known(asset.id),
162 "unregistered asset instance encountered.");
163 return static_pointer_cast<KIND,
Asset>
164 (instance().registry.get (asset.id));
175 return bool(registry.get (
ID<Asset>(
id)));
186 PAsset pA = registry.get (
id);
187 return ( pA && pA->ident.category.isWithin(cat));
196 instance->
remove (pA->getID());
199 function<void(PAsset&)>
200 detach_child_recursively ()
202 return bind( &recursive_call, &AssetManager::instance(), _1 );
214 for_each (asset->dependants, detach_child_recursively());
223 INFO (progress,
"Clearing the Asset registry...");
232 registry.asList (res);
Facility for monitor object based locking.
static ID< Asset > getID(const Asset::Ident &)
provide the unique ID for given Asset::Ident tuple
Steam-Layer Interface: Asset Lookup and Organisation.
Definition of a structural asset to express patterns of wiring or processing Processing patterns can ...
A "processing pipe" represented as Asset.
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
Tree like classification of Assets.
void remove(IDA id)
remove the given asset from the internal DB.
scoped guard to control the actual locking.
Facade for the Asset subsystem.
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
Access point to singletons and other kinds of dependencies designated by type.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
AssetManager error responses, caused by querying invalid Asset IDs from the internal DB...
Object Monitor based synchronisation.
Implementation of the registry holding all Asset instances known to the Asset Manager subsystem...
An entity to collect, possibly filter and persist incident records.
Derived specific exceptions within Lumiera's exception hierarchy.
Structural building block of the session: a sequence of clips.
Data processing Plugins and Codecs can be treated as a specific Kind of Asset.
a POD comprised of all the information sufficiently identifying any given Asset.
list< PcAsset > listContent() const
extract a sorted list of all registered Assets
Superinterface describing especially bookkeeping properties.
void for_each(CON const &elements, FUN function, P1 &&bind1, ARGS &&...args)
Accept binding for arbitrary function arguments.
Definition of Asset representation for a media clip.
Implementation of the Asset database.
lib::P< KIND > getAsset(const ID< KIND > &id)
find and return corresponding object
bookkeeping (Asset) view of a media clip.
To establish a reference scale for quantised time values.
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
The asset subsystem of the Steam-Layer.
Asset representation of structural elements within the model.
Perform operations "for each element" of a collection.
static ID< KIND > reg(KIND *obj, const Asset::Ident &idi)
registers an asset object in the internal DB, providing its unique key.
Top level structural element within the session.
void clear()
deregister and evict all known Assets.
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.