Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/mobject/session/scope-path.hpp"
Sequence of nested scopes within the high-level model.
Implemented as vector of Scope elements. Providing state and relation predicates, and the ability to navigate the current location, as represented by the current leaf element of the path.
Incorporates a ref count to be utilised by ScopeLocator and QueryFocus to establish the current focus (path).
Definition at line 135 of file scope-path.hpp.
Public Types | |
typedef _IterType | iterator |
Iteration is always ascending from leaf to root. | |
Public Member Functions | |
ScopePath () | |
Create an empty path. More... | |
ScopePath (Scope const &leaf) | |
When creating a path to a given (leaf) scope, the complete sequence of nested scopes leading to this special scope is discovered, using the query service exposed by the session (through ScopeLocator). More... | |
ScopePath (ScopePath const &) | |
iterator | begin () const |
void | clear () |
bool | contains (Scope const &) const |
bool | contains (ScopePath const &) const |
bool | empty () const |
an empty path doesn't even contain a root element. More... | |
iterator | end () const |
bool | endsAt (Scope const &) const |
verify the scope in question is equivalent to our leaf scope. More... | |
Scope const & | getLeaf () const |
Scope const & | goRoot () |
bool | isRoot () const |
bool | isValid () const |
a valid path consists of more than just the root element. More... | |
size_t | length () const |
Scope const & | moveUp () |
void | navigate (Scope const &) |
operator bool () const | |
operator string () const | |
ScopePath diagnostic self display. More... | |
ScopePath & | operator= (ScopePath const &) |
Copy from existing path. More... | |
size_t | ref_count () const |
size_t | size () const |
Static Public Attributes | |
static const ScopePath | INVALID = ScopePath(Scope()) |
constant invalid path token. More... | |
Friends | |
ScopePath | commonPrefix (ScopePath const &, ScopePath const &) |
bool | disjoint (ScopePath const &, ScopePath const &) |
void | intrusive_ptr_add_ref (ScopePath *) |
management function for boost::intrusive_ptr to be picked up by ADL | |
void | intrusive_ptr_release (ScopePath *) |
bool | operator== (ScopePath const &, ScopePath const &) |
Private Types | |
typedef lib::RangeIter< _VIter > | _IterType |
typedef _VType::const_reverse_iterator | _VIter |
typedef vector< Scope > | _VType |
Private Member Functions | |
void | appendScope (Scope const &) |
PlacementMO const & | currModelRoot () const |
bool | hasValidRoot () const |
Private Attributes | |
std::vector< Scope > | path_ |
size_t | refcount_ |
ScopePath | ( | ) |
Create an empty path.
By default, a scope path just contains the root scope of the current session (PlacementIndex).
Definition at line 83 of file scope-path.cpp.
Referenced by ScopePath::ScopePath().
When creating a path to a given (leaf) scope, the complete sequence of nested scopes leading to this special scope is discovered, using the query service exposed by the session (through ScopeLocator).
error::Invalid | if the given target scope can't be connected to the (implicit) root |
Definition at line 101 of file scope-path.cpp.
References Scope::INVALID, and ScopePath::ScopePath().
Copy from existing path.
error::Logic | when current path has nonzero refcount |
Definition at line 122 of file scope-path.cpp.
bool isValid | ( | ) | const |
a valid path consists of more than just the root element.
Definition at line 170 of file scope-path.cpp.
References SessionServiceExploreScope::getScopeRoot().
Referenced by ScopePath::endsAt(), and QueryFocusStack::push().
|
inline |
an empty path doesn't even contain a root element.
Many operations throw when invoked on such a path. Navigating up from an root path creates an empty path.
Definition at line 265 of file scope-path.hpp.
Referenced by ScopePath::endsAt().
operator string | ( | ) | const |
ScopePath diagnostic self display.
Implemented similar to a filesystem path, where the path elements are based on the self-display of the MObject attached through the respective scope top placement.
Definition at line 150 of file scope-path.cpp.
|
inline |
Definition at line 286 of file scope-path.hpp.
Referenced by ScopePath::endsAt().
bool endsAt | ( | Scope const & | aScope | ) | const |
verify the scope in question is equivalent to our leaf scope.
Equivalence of scopes means they are defined by the same scope top placement, i.e. registered with the same Placement-ID.
Definition at line 212 of file scope-path.cpp.
References ScopePath::begin(), ScopePath::empty(), Scope::INVALID, and ScopePath::isValid().
|
private |
constant invalid path token.
Created by locating an invalid scope
Definition at line 153 of file scope-path.hpp.