Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/mobject/session/placement-index.hpp"
Structured compound of Placement instances with lookup capabilities.
Core of the session datastructure. Adding a Placement creates a separate instance within this network, owned and managed by the backing implementation. All placements are related in a tree-like hierarchy of scopes, where each Placement is within the scope of a parent Placement. There is an additional reverse index, allowing to find the immediate children of any given Placement efficiently. All lookup is based on the Placement's hash-IDs.
Definition at line 181 of file placement-index.hpp.
Public Types | |
using | ID = PlacementMO::ID const & |
using | iterator = _ID_TableIterator |
using | PRef = PlacementRef< MObject > |
Public Member Functions | |
PlacementIndex (PlacementMO const &) | |
void | clear (ID targetScope) |
recursively kill a complete scope, including the given element and all children. More... | |
void | clear () |
bool | contains (PlacementMO const &) const |
bool | contains (ID) const |
PlacementMO & | find (ID) const |
template<class MO > | |
Placement< MO > & | find (PlacementMO::Id< MO >) const |
template<class MO > | |
Placement< MO > & | find (PlacementRef< MO > const &) const |
iterator | getReferrers (ID) const |
Retrieve all the elements attached to the given entry (scope) Each element (Placement) can act as a scope, containing other Placements, which will be discovered by this query one level deep (not recursive). More... | |
PlacementMO & | getRoot () const |
retrieve the logical root scope | |
PlacementMO & | getScope (PlacementMO const &) const |
PlacementMO & | getScope (ID) const |
retrieve the Scope information registered alongside with the denoted Placement. More... | |
ID | insert (PlacementMO const &newObj, ID targetScope) |
Add a new Placement (Object "instance") into the index. More... | |
template<class PLA > | |
BuildID< PLA >::Type | insert (PLA const &, ID) |
convenience shortcut to insert a placement immediately followed by creating a typed-ID, allowing to retain the original typed context More... | |
bool | isValid () const |
validity self-check, used for sanity checks and the session self-check. More... | |
bool | remove (PlacementMO &) |
bool | remove (ID) |
Remove and discard a Placement (Object "instance") from the index. More... | |
size_t | size () const |
Classes | |
class | Table |
Storage and implementation backing the PlacementIndex. More... | |
class | Validator |
PlacementIndex self-verification code Executes all built-in checks automatically on object creation. More... | |
Private Types | |
using | _ID_TableIterator = lib::TransformIter< ScopeRangeIter, PlacementMO & > |
using | _PID = PlacementMO::ID |
using | ScopeIter = std::unordered_multimap< _PID, _PID >::const_iterator |
using | ScopeRangeIter = lib::RangeIter< ScopeIter > |
Private Attributes | |
unique_ptr< Table > | pTab_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
PlacementMO & getScope | ( | ID | id | ) | const |
retrieve the Scope information registered alongside with the denoted Placement.
error::Invalid | when the given ID isn't registered |
Definition at line 478 of file placement-index.cpp.
PlacementIndex::iterator getReferrers | ( | ID | id | ) | const |
Retrieve all the elements attached to the given entry (scope) Each element (Placement) can act as a scope, containing other Placements, which will be discovered by this query one level deep (not recursive).
Definition at line 493 of file placement-index.cpp.
Referenced by PlacementIndex_test::checkContentsEnumeration(), and PlacementIndexQueryResolver::setupExploration().
bool isValid | ( | ) | const |
validity self-check, used for sanity checks and the session self-check.
The following checks are performed (causing at least one full table scan)
Definition at line 706 of file placement-index.cpp.
ID insert | ( | PlacementMO const & | newObj, |
ID | targetScope | ||
) |
Add a new Placement (Object "instance") into the index.
Usually this means effectively adding this "Object" to the Session. The given Placement is copied into the storage managed within the session. This copy within the storage is what will be "the placement of this object". It can be discovered as index (Session) content, re-accessed by the ID returned from this call and modified in the course of editing the session.
newObj | reference placement pointing to the MObject to be added |
targetScope | ref to a placement already added to the index, serving as container "into" which the new placement will be located |
Definition at line 513 of file placement-index.cpp.
Referenced by SessionImpl::attach().
bool remove | ( | ID | id | ) |
Remove and discard a Placement (Object "instance") from the index.
Usually this means removing this Object from the session.
true
if actually removed an object. error::State | if the object to be removed is an non-empty scope |
Definition at line 530 of file placement-index.cpp.
BuildID< PLA >::Type insert | ( | PLA const & | newObj, |
ID | targetScope | ||
) |
convenience shortcut to insert a placement immediately followed by creating a typed-ID, allowing to retain the original typed context
this solution is half-baked ///////////////////////////////////TICKET #523
is this API used in application code? or just used in tests?
Definition at line 331 of file placement-index.hpp.
void clear | ( | ID | targetScope | ) |
recursively kill a complete scope, including the given element and all children.
Definition at line 545 of file placement-index.cpp.