Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/assetmanager.hpp"
Facade for the Asset subsystem.
Definition at line 68 of file assetmanager.hpp.
Public Member Functions | |
void | clear () |
deregister and evict all known Assets. More... | |
template<class KIND > | |
lib::P< KIND > | getAsset (const ID< KIND > &id) |
find and return corresponding object More... | |
bool | known (IDA id) |
bool | known (IDA id, const Category &cat) |
list< PcAsset > | listContent () const |
extract a sorted list of all registered Assets | |
void | remove (IDA id) |
remove the given asset from the internal DB. More... | |
Static Public Member Functions | |
static ID< Asset > | getID (const Asset::Ident &) |
provide the unique ID for given Asset::Ident tuple | |
template<class KIND > | |
static lib::P< KIND > | wrap (const KIND &asset) |
retrieve the registered smart-ptr for any asset More... | |
Static Public Attributes | |
static lib::Depend< AssetManager > | instance |
get at the system-wide asset manager instance. More... | |
Friends | |
class | lib::DependencyFactory< AssetManager > |
Protected Member Functions | |
friend | Asset::Asset (Asset::Ident const &idi) |
Static Protected Member Functions | |
static void | destroy (Asset *aa) |
deleter function used by the Asset smart pointers to delete Asset objects | |
template<class KIND > | |
static ID< KIND > | reg (KIND *obj, const Asset::Ident &idi) |
registers an asset object in the internal DB, providing its unique key. More... | |
Private Attributes | |
asset::DB & | registry |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
retrieve the registered smart-ptr for any asset
Convenience shortcut for fetching the registered smart-ptr which is in charge of the given asset instance.
By querying directly asset.id (of type ID<Asset>), the call to registry.get() can bypass the dynamic cast, because the type of the asset is explicitly given by type KIND.
Definition at line 153 of file assetmanager.cpp.
Referenced by Builder< ErrorLog >::commit(), Asset::defineDependency(), Clip::findClipAsset(), Clip::getClipAsset(), and Clip::getMedia().
find and return corresponding object
error::Invalid | if nothing is found or if the actual KIND of the stored object differs and can't be casted. |
Definition at line 134 of file assetmanager.cpp.
Referenced by CreateAsset_test::createMedia().
bool known | ( | IDA | id | ) |
Definition at line 167 of file assetmanager.cpp.
Referenced by CreateAsset_test::createMedia().
Definition at line 178 of file assetmanager.cpp.
void remove | ( | IDA | id | ) |
remove the given asset from the internal DB.
remove the given asset from the internal DB together with all its dependents
together with all its dependents
Definition at line 205 of file assetmanager.cpp.
void clear | ( | ) |
deregister and evict all known Assets.
Definition at line 215 of file assetmanager.cpp.
|
staticprotected |
registers an asset object in the internal DB, providing its unique key.
used by the Asset base class ctor to create Asset::id.
This includes creating the smart ptr in charge of the asset's lifecycle
error::Invalid | in case of invalid identity spec |
Definition at line 112 of file assetmanager.cpp.
|
static |
get at the system-wide asset manager instance.
Implemented as singleton.
Definition at line 75 of file assetmanager.hpp.
Referenced by Sequence::create(), Timeline::create(), IdentityOfAssets_test::createDuplicate(), CreateAsset_test::createMedia(), ErrorLog::global(), Pipe::lookup(), StructFactory::made4fake(), ProcPatt::newCopy(), StructFactory::newPipe(), MediaFactory::operator()(), StructFactory::operator()(), TestAsset< A >::ptrFromThis(), steam::asset::meta::anonymous_namespace{time-grid.cpp}::publishWrapped(), and Asset::unlink().