Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Core of the session implementation datastructure.
The PlacementIndex is attached to and controlled by the SessionImpl. Client code is not intended to interface directly to this API. Even Steam-Layer internal facilities use the session datastructure through SessionServices. Embedded within the implementation of PlacementIndex is a flat table structure holding all the Placement instances contained in the session. Any further structuring exists on the logical level only.
To avoid the dangerous dependency on a direct reference, external code would rather rely on the Placement-ID. Moreover, being a simple value, such an ID can be passed through plain C APIs. PlacementRef is a smart-ptr like wrapper, containing just such an ID; dereferentiation transparently causes a lookup operation through the PlacementIndex of the current session. (accessing an invalid PlacementRef throws)
When it comes to ownership and lifecycle management, external client code should use MObjectRef instances. In addition to containing a PlacementRef, these set up a smart-ptr managing the MObject instance and sharing ownership with the Placement contained within the PlacementIndex. Usually, the commands expressing any mutating operations on the session, bind MObjectRef instances as arguments; similarly, the public API functions on the Session interface (and similar facade interfaces) are written in terms of MObectRef.
Placement<session::Clip>
, specifying a Placement<session::Fork>
as scope. This would bring the mentioned Clip onto the "Track", as implemented by a Fork-MObject. Thus, all "object instances" within the session are arranged in a tree-like fashion. On creation of the PlacementIndex, a root element needs to be provided. While this root element has a meaning for the session, within the index it is just a scope-providing element. Note that a non-empty scope can't be deleted from the Index.getReferrers(ID)
returns an (possibly empty) "Lumiera Forward Iterator", allowing to enumerate the nested elements. Client code within Lumiera's Steam-Layer typically uses this functionality through a ScopeQuery passed to the SessionServices, while external client code would use either QueryFocus and the Scope wrapper objects, or the specific query functions available on the facade objects accessible through the public session API.Placement<MObject>
can be casted into a more specifically typed Placement, thus allowing to re-gain the fully typed context. This technique plays an important role when it comes to generic processing of the session contents by a visitor, and especially within the Builder. This is a fundamental design decision within Steam-Layer: code should not operate on MObjects and do type/capability queries – rather any processing is assumed to happen in a suitable typed context. Consequently, client code will never need to fetch Placements directly from the index. This allows all type information to be discarded on adding (copying) a Placement instance into the PlacementIndex.Definition in file placement-index.hpp.
#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/itertools.hpp"
#include "steam/mobject/placement.hpp"
#include "steam/mobject/placement-ref.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <unordered_map>
#include <memory>
#include <vector>
Classes | |
struct | BuildID< PLA > |
Helper for building Placement-ID types. More... | |
struct | BuildID< Placement< MO, BMO > > |
struct | hash< steam::mobject::PlacementMO::ID > |
class | PlacementIndex |
Structured compound of Placement instances with lookup capabilities. More... | |
Functions | |
template<class MOX > | |
void | ___check_compatibleType (PlacementMO &questionable) |
void | __check_knownID (PlacementIndex const &idx, PlacementMO::ID id) |
LUMIERA_ERROR_DECLARE (NOT_IN_SESSION) | |
referring to a Placement not known to the current session | |
LUMIERA_ERROR_DECLARE (PLACEMENT_TYPE) | |
requested Placement (pointee) type not compatible with data or context | |
LUMIERA_ERROR_DECLARE (NONEMPTY_SCOPE) | |
Placement scope (still) contains other elements. | |
Namespaces | |
lumiera | |
Lumiera public interface. | |
steam | |
Steam-Layer implementation namespace root. | |
steam::mobject | |
Media-Objects, edit operations and high-level session. | |
steam::mobject::session | |
Namespace of Session and user visible high-level objects. | |
struct steam::mobject::session::BuildID |