Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
Scope Class Reference

#include "steam/mobject/session/scope.hpp"

Description

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.

Note
Scope is a passive entity, basically just wrapping up a Scope-top Placement. Contrast this to QueryFocus, which actively maintains the current focus location and exposes query facilities.

Definition at line 69 of file scope.hpp.

Static Public Attributes

static const Scope INVALID = Scope()
 constant invalid scope token.
 

Static Public Member Functions

static Scope containing (PlacementMO const &aPlacement)
 discover the enclosing scope of a given Placement
 
static Scope containing (RefPlacement const &refPlacement)
 

Public Member Functions

 Scope (PlacementMO const &constitutingPlacement)
 conversion of a scope top (placement) into a Scope.
 
 Scope ()
 unlocated NIL scope
 
 Scope (PlacementMO::ID const &constitutingPlacement)
 
 Scope (Scope const &)
 
Scopeoperator= (Scope const &)
 
 operator std::string () const
 
Scope getParent () const
 retrieve the parent scope which encloses this scope.
 
PlacementMOgetTop () const
 
bool isValid () const
 check if this scope can be located.
 
bool isRoot () const
 

Friends

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.
 
bool operator!= (Scope const &, Scope const &)
 

Private Attributes

RefPlacement anchor_
 

Constructor & Destructor Documentation

◆ Scope() [1/4]

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.

◆ Scope() [2/4]

Scope ( )

unlocated NIL scope

Definition at line 73 of file scope.cpp.

References Scope::anchor_, and PlacementRef< MX >::isValid().

+ Here is the call graph for this function:

◆ Scope() [3/4]

Scope ( PlacementMO::ID const &  constitutingPlacement)
explicit

Definition at line 68 of file scope.cpp.

◆ Scope() [4/4]

Scope ( Scope const &  o)

Definition at line 80 of file scope.cpp.

References Scope::anchor_, and PlacementRef< MX >::isValid().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator=()

Scope & operator= ( Scope const &  o)

Definition at line 88 of file scope.cpp.

References Scope::anchor_, and Scope::isValid().

+ Here is the call graph for this function:

◆ containing() [1/2]

Scope containing ( PlacementMO const &  aPlacement)
static

discover the enclosing scope of a given Placement

Definition at line 184 of file scope.cpp.

References SessionServiceExploreScope::getScope().

Referenced by Scope::containing(), StructFactoryImpl::getFork_forSequence(), SessionElementQuery_test::run(), PlacementScope_test::verifyLookup(), and PlacementScope_test::verifyNavigation().

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

◆ containing() [2/2]

Scope containing ( RefPlacement const &  refPlacement)
static

Definition at line 191 of file scope.cpp.

References Scope::containing().

+ Here is the call graph for this function:

◆ operator std::string()

operator std::string ( ) const

◆ getParent()

Scope getParent ( ) const

retrieve the parent scope which encloses this scope.

Exceptions
error::Invalidif this is the root scope

Definition at line 209 of file scope.cpp.

References Scope::anchor_, SessionServiceExploreScope::getScope(), Scope::isRoot(), and LERR_.

Referenced by ScopePath_test::check_Identity_and_Copy(), ScopePath_test::checkIteration(), QueryFocus_test::checkNavigation(), ScopePath_test::checkRelations(), ScopePath_test::navigate(), PlacementScope_test::verifyEquality(), and PlacementScope_test::verifyNavigation().

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

◆ getTop()

PlacementMO & getTop ( ) const

Definition at line 198 of file scope.cpp.

References Scope::anchor_.

Referenced by ScopePath_test::navigate(), PlacementScope_test::verifyEquality(), and PlacementScope_test::verifyNavigation().

+ Here is the caller graph for this function:

◆ isValid()

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.

References Scope::anchor_, and PlacementRef< MX >::isValid().

Referenced by steam::mobject::session::anonymous_namespace{query-focus.cpp}::___check_validTaget(), ScopePath_test::checkInvalidScopeDetection(), ScopePath_test::invalidPath(), ScopePath::navigate(), Scope::operator=(), and QueryFocus::push().

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

◆ isRoot()

bool isRoot ( ) const
Returns
true if this is the outmost (root) scope

Definition at line 221 of file scope.cpp.

References Scope::anchor_, and SessionServiceExploreScope::getScopeRoot().

Referenced by QueryFocusStack_test::automaticFrameHandling(), QueryFocus_test::checkNavigation(), QueryFocusStack_test::clear(), StructFactoryImpl::getFork_forSequence(), Scope::getParent(), QueryFocusStack::push(), QueryFocusStack_test::usePushedFrame(), and PlacementScope_test::verifyNavigation().

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

Member Data Documentation

◆ anchor_

◆ INVALID

const Scope INVALID = Scope()
static

constant invalid scope token.

Definition at line 83 of file scope.hpp.

Referenced by ScopePath::ScopePath(), ScopePath_test::checkInvalidScopeDetection(), ScopePath::contains(), and ScopePath::moveUp().

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( Scope const &  scope1,
Scope const &  scope2 
)
friend

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.

Definition at line 107 of file scope.hpp.

◆ operator!=

bool operator!= ( Scope const &  scope1,
Scope const &  scope2 
)
friend

Definition at line 113 of file scope.hpp.

+ Collaboration diagram for Scope:

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