Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/mobject/session/scope.hpp"
A Placement scope within the high-level-model.
Within the Session/Model, Placements are used to attach MObjects; but beyond that, each Placement can contain other Placements, effectively forming a scope. Thus Scope is basically another view on Placements which are attached to the session. This (hidden) link to the session is utilised to establish the nesting of scopes and allow querying and navigating.
Actually, Scope is implemented through a PlacementRef pointing to the Placement which constitutes this Scope. We call this Placement the "scope top". A fork e.g. can contain several clips, but also nested sub forks, all of which would be within the scope of this fork. This scoping relation plays an important role when it comes to resolving properties of placement, like e.g. the output designation, overlay mode, sound pan position etc – properties from enclosing scopes will be inherited unless shaded by local definitions, similar to the behaviour known from most programming languages when referring to local variables.
Public Member Functions | |
Scope (PlacementMO const &constitutingPlacement) | |
conversion of a scope top (placement) into a Scope. More... | |
Scope () | |
unlocated NIL scope | |
Scope (PlacementMO::ID const &constitutingPlacement) | |
Scope (Scope const &) | |
Scope | getParent () const |
retrieve the parent scope which encloses this scope. More... | |
PlacementMO & | getTop () const |
bool | isRoot () const |
bool | isValid () const |
check if this scope can be located. More... | |
operator std::string () const | |
Scope & | operator= (Scope const &) |
Static Public Member Functions | |
static Scope | containing (PlacementMO const &aPlacement) |
discover the enclosing scope of a given Placement | |
static Scope | containing (RefPlacement const &refPlacement) |
Static Public Attributes | |
static const Scope | INVALID = Scope() |
constant invalid scope token. More... | |
Friends | |
bool | operator!= (Scope const &, Scope const &) |
bool | operator== (Scope const &, Scope const &) |
as scopes are constituted by a "scope top" element (placement) registered within the PlacementIndex of the current session, equality is defined in terms of this defining placement. | |
Private Attributes | |
RefPlacement | anchor_ |
Scope | ( | PlacementMO const & | constitutingPlacement | ) |
conversion of a scope top (placement) into a Scope.
only allowed if the given Placement is actually attached to the session, which will be checked by index access
Definition at line 64 of file scope.cpp.
References Scope::Scope().
Scope getParent | ( | ) | const |
retrieve the parent scope which encloses this scope.
error::Invalid | if this is the root scope |
Definition at line 209 of file scope.cpp.
References Scope::isRoot().
Referenced by QueryFocus_test::checkNavigation(), and PlacementScope_test::verifyEquality().
bool isValid | ( | ) | const |
check if this scope can be located.
An default constructed Scope (i.e without defining Placement) can't be located and returns false here
Definition at line 231 of file scope.cpp.
Referenced by QueryFocus::push(), and Scope::Scope().
bool isRoot | ( | ) | const |
Definition at line 221 of file scope.cpp.
References SessionServiceExploreScope::getScopeRoot().
Referenced by QueryFocus_test::checkNavigation(), Scope::getParent(), and QueryFocusStack::push().
constant invalid scope token.
Definition at line 83 of file scope.hpp.
Referenced by ScopePath::endsAt(), Scope::Scope(), and ScopePath::ScopePath().