Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/asset.hpp"
Superinterface describing especially bookkeeping properties.
As of 09/2007, there are four Kinds of Assets, each comprising a sub-Interface of the Asset Interface:
And of course there are various concrete Asset subclasses, like asset::Clip, asset::Effect, asset::Codec, asset::Dataset.
Public Member Functions | |
bool | enable (bool on=true) |
change the enabled status of this asset. More... | |
const vector< PAsset > & | getDependant () const |
All the other assets requiring this asset to be functional. More... | |
virtual const ID< Asset > & | getID () const |
const vector< PAsset > & | getParents () const |
List of entities this asset depends on or requires to be functional. More... | |
bool | isActive () const |
weather this asset is switched on and consequently included in the fixture and participates in rendering More... | |
virtual | operator string () const |
bool | operator< (Asset const &oa) const |
bool | operator== (Asset const &oa) const |
Public Attributes | |
const Ident | ident |
Asset identification tuple. | |
Classes | |
struct | Ident |
a POD comprised of all the information sufficiently identifying any given Asset. More... | |
Friends | |
class | AssetManager |
class | DB |
Protected Member Functions | |
Asset (const Ident &idi) | |
Asset is a Interface class; usually, objects of concrete subclasses are created via specialised Factories. More... | |
virtual | ~Asset ()=0 |
void | defineDependency (PAsset parent) |
establish a connection between this and the given parent asset, denoting we are in some way dependent on the parent. More... | |
void | defineDependency (Asset &parent) |
virtual void | unlink () |
release all links to other Asset objects held internally. More... | |
virtual void | unlink (IDA target) |
variant of unlink() dropping only the links to the given specific Asset, leaving all other links intact. More... | |
Protected Attributes | |
vector< PAsset > | dependants |
bool | enabled |
set< string > | groups |
additional classification, selections or departments this asset belongs to. More... | |
const ID< Asset > | id |
Asset primary key. | |
const string | longDesc |
user visible qualification of the thing, unit or concept represented by this asset. More... | |
vector< PAsset > | parents |
const string | shortDesc |
user visible Name-ID. More... | |
Private Member Functions | |
void | unregister (PAsset &other) |
Asset is a Interface class; usually, objects of concrete subclasses are created via specialised Factories.
Calling this base ctor causes registration with AssetManager.
Definition at line 66 of file asset.cpp.
References cStr(), and Asset::ident.
|
protectedpure virtual |
Definition at line 74 of file asset.cpp.
References Asset::Ident::category, Asset::ident, Asset::Ident::name, stage::widget::name(), Asset::Ident::org, and Asset::Ident::version.
|
protectedvirtual |
release all links to other Asset objects held internally.
release all links to other dependent asset objects held internally and advise all parent assets to do so with the link to this asset.
The lifecycle of Asset objects is managed by smart pointers and the Asset manager. Calling unlink()
breaks interconnections to other Assets in the central Object network comprising the session. Especially, the downward links to dependent entities are released, while the primary (upward) smart-ptr links to our prerequisites are still retained. The rationale is, after releasing these redundant or cyclic interlinking, when the AssetManager removes its DB entry for this asset, the smart pointer goes out of scope and causes unwinding of the whole dependency chain.
Reimplemented in Timeline, Sequence, and Viewer.
Definition at line 173 of file asset.cpp.
References Asset::unregister().
Referenced by Viewer::unlink(), Sequence::unlink(), and Timeline::unlink().
|
protectedvirtual |
|
protected |
establish a connection between this and the given parent asset, denoting we are in some way dependent on the parent.
Definition at line 192 of file asset.cpp.
References AssetManager::wrap().
Referenced by Preview::Preview().
|
private |
other |
Definition at line 159 of file asset.cpp.
Referenced by Asset::unlink().
|
inline |
List of entities this asset depends on or requires to be functional.
May be empty. The head of this list can be considered the primary prerequisite
Definition at line 285 of file asset.hpp.
Referenced by Media::checkCompound().
|
inline |
bool isActive | ( | ) | const |
bool enable | ( | bool | on = true | ) |
change the enabled status of this asset.
change the enablement status of this asset.
Note the corresponding isActive predicate may depend on the enablement status of parent assets as well
false
if the state could not be changed due to parent objects being disabled
|
protected |
|
protected |
|
protected |