Lumiera  0.pre.03
»edit your freedom«
StateMapGroupingStorage Class Reference

#include "stage/ctrl/state-map-grouping-storage.hpp"

Description

Map storage for captured presentation state information.

The master table is an association of model::Tangible element IDs to StateData records, which are a set of property data elements. The key of the stored elements acts as propertyKey and was chosen by the originating UI element. It is assumed that the entry last seen represents the current state of this property, so previous records are overwritten. Access to unknown data is marked by returning diff::Ref::NO rsp. Storage::end() (when searching)

Todo:
reinvestigate with GCC-5 //////////////////////////////////TICKET #991
See also
StateMapGroupingStorage_test

Definition at line 74 of file state-map-grouping-storage.hpp.

Public Types

using iterator = Storage::const_iterator
 
using Record = Storage::value_type
 

Public Member Functions

iterator begin () const
 
void clear ()
 
void clearProperty (BareEntryID const &elementID, string propertyKey)
 clear previously recorded state for a given element and specific property
 
void clearState (BareEntryID const &elementID)
 clear any previously recorded state for a given element
 
bool empty () const
 
iterator end () const
 
iterator find (BareEntryID const &elementID) const
 
void record (BareEntryID const &elementID, GenNode const &stateMark)
 remember the state mark for the denoted element More...
 
GenNode const & retrieve (BareEntryID const &elementID, string propertyKey) const
 retrieve captured state More...
 
size_t size () const
 

Static Public Member Functions

static BareEntryID const & getID (Record const &entry)
 
static StateData const & getState (Record const &entry)
 
static GenNode const & getState (Record const &entry, string propertyKey)
 Access the recorded state mark, if any. More...
 

Private Types

using StateData = std::set< GenNode, GenNode::IDComparator >
 
using Storage = std::unordered_map< BareEntryID, StateData, BareEntryID::UseEmbeddedHash >
 

Static Private Member Functions

static StateData::const_iterator findProperty (StateData const &stateSet, string propertyKey)
 

Private Attributes

Storage elmTable_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Function Documentation

◆ retrieve()

GenNode const& retrieve ( BareEntryID const &  elementID,
string  propertyKey 
) const
inline

retrieve captured state

Returns
reference to the state mark last seen for the denoted property or reference to a generic "no" marker (Ref::NO)

Definition at line 113 of file state-map-grouping-storage.hpp.

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

+ Here is the call graph for this function:

◆ record()

void record ( BareEntryID const &  elementID,
GenNode const &  stateMark 
)
inline

remember the state mark for the denoted element

Note
stateMark value is assigned to a previously existing entry with the same ID-symbol. If no such entry exists, a (heap allocated) copy of the state mark is stored.

Definition at line 128 of file state-map-grouping-storage.hpp.

Referenced by StateRecorder::recordState().

+ Here is the caller graph for this function:

◆ getState()

static GenNode const& getState ( Record const &  entry,
string  propertyKey 
)
inlinestatic

Access the recorded state mark, if any.

Warning
we can't search logarithmically, since this would require to construct another GenNode to represent the key.
Todo:
seemingly GCC-4.9 doesn't yet support the "transparent search" feature of C++14, where std::set would support an additional overload of the find() function, templated to accept a value convertible to some key equivalent, which needs to be understood by the comparator of the set. To trigger using this overload, the comparator has to define a suitable operator() and in addition a marker type is_transparent. See transparent-cmp and the [reference][cind-cpp14] for explanation. //////////////////////////////////TICKET #991

Definition at line 199 of file state-map-grouping-storage.hpp.

+ Inheritance diagram for StateMapGroupingStorage:
+ Collaboration diagram for StateMapGroupingStorage:

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