Lumiera  0.pre.03
»edit your freedom«
PlacementIndex::Table Class Reference

Description

Storage and implementation backing the PlacementIndex.

  • #placementTab_ is an hashtable mapping IDs to Placement + Scope
  • #scopeTab_ is an reverse association serving to keep track of any scope's contents
  • root scope element is stored and maintained explicitly.

Definition at line 105 of file placement-index.cpp.

Public Types

using IDIter = lib::IterSource< PID >::iterator
 

Public Member Functions

IDIter _contents_4check (ID id)
 
IDIter _eachEntry_4check ()
 
IDIter _eachScope_4check ()
 
PlacementMO_element_4check (ID id)
 
PlacementMO_root_4check ()
 
PlacementMO_scope_4check (ID id)
 
ID addEntry (PlacementMO const &newObj, ID scopeID)
 Store a copy of the given Placement as new instance within the index, together with the Scope this Placement belongs to. More...
 
void clear ()
 
bool contains (ID id) const
 
size_t element_cnt () const
 
PlacementMOfetch (ID id) const
 
PlacementMOfetchScope (ID id) const
 
PlacementMOgetRootElement ()
 
PlacementIndex::iterator queryScopeContents (ID id) const
 
void removeAll (ID scopeID)
 
bool removeEntry (ID id)
 
size_t scope_cnt () const
 < More...
 
void setupRoot (PlacementMO const &rootDef)
 insert a specially configured root entry into the yet empty table. More...
 
size_t size () const
 < More...
 

Classes

struct  PlacementEntry
 

Private Types

typedef function< PlacementMO &(pair< PID, PID > const &)> ElementResolver
 
typedef unordered_map< PID, PlacementEntryIDTable
 
typedef PlacementMO::ID PID
 
typedef shared_ptr< PlacementMOPPlacement
 
typedef pair< ScopeIter, ScopeIter > ScopeContents
 
typedef std::unordered_multimap< PID, PID > ScopeTable
 
typedef IDTable::const_iterator Slot
 

Private Member Functions

PlacementEntry const & base_entry (ID key) const
 
void remove_all_from_scope (ID scopeID)
 
PlacementEntry remove_base_entry (ID key)
 
void remove_from_scope (ID scopeID, ID entryID)
 
PlacementMOresolveScopeIndexElement (pair< PID, PID > const &entry) const
 Helper for building a scope exploring iterator for PlacementIndex: our "reverse index" (scopeTab_) tracks the contents of each scope as pairs (scopeID,elementID). More...
 
ElementResolver scopeIndexElementsResolver () const
 < More...
 

Private Attributes

TypedAllocationManager allocator_
 
ElementResolver elementResolver_
 
IDTable placementTab_
 
PPlacement root_
 
ScopeTable scopeTab_
 

Class Documentation

◆ steam::mobject::session::PlacementIndex::Table::PlacementEntry

struct steam::mobject::session::PlacementIndex::Table::PlacementEntry
Class Members
PPlacement element
PPlacement scope
+ Collaboration diagram for PlacementIndex::Table::PlacementEntry:

Member Function Documentation

◆ size()

size_t size ( ) const
inline

<

Note
always at least 1 because of root

Definition at line 146 of file placement-index.cpp.

◆ scope_cnt()

size_t scope_cnt ( ) const
inline

<

Note
root doesn't produce an scope entry

Definition at line 152 of file placement-index.cpp.

References steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry().

+ Here is the call graph for this function:

◆ setupRoot()

void setupRoot ( PlacementMO const &  rootDef)
inline

insert a specially configured root entry into the yet empty table.

Root is it's own scope

Definition at line 219 of file placement-index.cpp.

◆ addEntry()

ID addEntry ( PlacementMO const &  newObj,
ID  scopeID 
)
inline

Store a copy of the given Placement as new instance within the index, together with the Scope this Placement belongs to.

Note
we discard the specific type info. It can be rediscovered later with the help of the pointee's vtable
See also
Placement::isCompatible

Definition at line 254 of file placement-index.cpp.

References steam::mobject::session::test::anonymous_namespace{defs-manager-impl-test.cpp}::newID().

+ Here is the call graph for this function:

◆ resolveScopeIndexElement()

PlacementMO& resolveScopeIndexElement ( pair< PID, PID > const &  entry) const
inlineprivate

Helper for building a scope exploring iterator for PlacementIndex: our "reverse index" (scopeTab_) tracks the contents of each scope as pairs (scopeID,elementID).

After fetching the range of matching entries, whenever the client dereferences the iterator, we have to pick up the second ID and resolve it through the main index table (placementTab_).

Definition at line 390 of file placement-index.cpp.

◆ scopeIndexElementsResolver()

ElementResolver scopeIndexElementsResolver ( ) const
inlineprivate

<

Returns
functor for iterator element access

Definition at line 402 of file placement-index.cpp.

+ Collaboration diagram for PlacementIndex::Table:

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