Lumiera  0.pre.03
»edit your freedom«
Asset Class Referenceabstract

#include "steam/asset.hpp"

Description

Superinterface describing especially bookkeeping properties.

As of 09/2007, there are four Kinds of Assets, each comprising a sub-Interface of the Asset Interface:

  • asset::Media representing mediafiles
  • asset::Proc representing media data processing components (e.g. Effects)
  • asset::Struct representing structural components used in the session (e.g. Tracks)
  • asset::Meta representing metadata, parametrisation, customisation.

And of course there are various concrete Asset subclasses, like asset::Clip, asset::Effect, asset::Codec, asset::Dataset.

Note
Assets objects have a strict unique identity and because of this are non-copyable. You can not create an Asset derived object without registering it with the AssetManager automatically. It is possible to copy the PAsset (smart pointer) though.
Since
09/2007
Author
Ichthyo

Definition at line 139 of file asset.hpp.

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< PAssetdependants
 
bool enabled
 
set< string > groups
 additional classification, selections or departments this asset belongs to. More...
 
const ID< Assetid
 Asset primary key.
 
const string longDesc
 user visible qualification of the thing, unit or concept represented by this asset. More...
 
vector< PAssetparents
 
const string shortDesc
 user visible Name-ID. More...
 

Private Member Functions

void unregister (PAsset &other)
 

Constructor & Destructor Documentation

◆ Asset()

Asset ( const Ident idi)
protected

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 57 of file asset.cpp.

References cStr(), and Asset::ident.

+ Here is the call graph for this function:

◆ ~Asset()

~Asset ( )
protectedpure virtual
Note
Asset is abstract

Definition at line 65 of file asset.cpp.

References Asset::Ident::category, Asset::ident, Asset::Ident::name, stage::widget::name(), Asset::Ident::org, and Asset::Ident::version.

+ Here is the call graph for this function:

Member Function Documentation

◆ unlink() [1/2]

void unlink ( )
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.

Note
we don't release upward links to parent assets, thus effectively keeping the parents alive, because frequently the accessibility of parent assets is part of our own contract. (e.g. media for clip assets)

Reimplemented in Timeline, Sequence, and Viewer.

Definition at line 164 of file asset.cpp.

References Asset::unregister().

Referenced by Viewer::unlink(), Sequence::unlink(), and Timeline::unlink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlink() [2/2]

void unlink ( IDA  target)
protectedvirtual

variant of unlink() dropping only the links to the given specific Asset, leaving all other links intact.

variant dropping only the links to the given Asset

Usable for propagating

Definition at line 174 of file asset.cpp.

References AssetManager::instance.

◆ defineDependency()

void defineDependency ( PAsset  parent)
protected

establish a connection between this and the given parent asset, denoting we are in some way dependent on the parent.

Definition at line 183 of file asset.cpp.

References AssetManager::wrap().

Referenced by Preview::Preview().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregister()

void unregister ( PAsset other)
private
Parameters
other

Definition at line 150 of file asset.cpp.

Referenced by Asset::unlink().

+ Here is the caller graph for this function:

◆ getParents()

const vector<PAsset>& getParents ( ) const
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 276 of file asset.hpp.

Referenced by Media::checkCompound().

+ Here is the caller graph for this function:

◆ getDependant()

const vector<PAsset>& getDependant ( ) const
inline

All the other assets requiring this asset to be functional.

For example, all the clips depending on a given media file. May be empty. The dependency relation is transitive.

Definition at line 282 of file asset.hpp.

◆ isActive()

bool isActive ( ) const

weather this asset is switched on and consequently included in the fixture and participates in rendering

whether this asset is switched on and consequently included in the fixture and participates in rendering.

Definition at line 118 of file asset.cpp.

◆ enable()

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

Returns
false if the state could not be changed due to parent objects being disabled

Definition at line 133 of file asset.cpp.

Member Data Documentation

◆ groups

set<string> groups
protected

additional classification, selections or departments this asset belongs to.

Groups are optional, non-exclusive and may be overlapping.

Definition at line 217 of file asset.hpp.

◆ shortDesc

const string shortDesc
protected

user visible Name-ID.

To be localised.

Definition at line 220 of file asset.hpp.

◆ longDesc

const string longDesc
protected

user visible qualification of the thing, unit or concept represented by this asset.

preferably "in one line". To be localised.

Definition at line 224 of file asset.hpp.

+ Inheritance diagram for Asset:
+ Collaboration diagram for Asset:

The documentation for this class was generated from the following files: