Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 65 of file state-map-grouping-storage.hpp.

Public Types

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

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.
 

Public Member Functions

bool empty () const
 
size_t size () const
 
void clear ()
 
GenNode const & retrieve (BareEntryID const &elementID, string propertyKey) const
 retrieve captured state
 
void record (BareEntryID const &elementID, GenNode const &stateMark)
 remember the state mark for the denoted element
 
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
 
iterator begin () const
 
iterator end () const
 
iterator find (BareEntryID const &elementID) const
 

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 ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Typedef Documentation

◆ StateData

using StateData = std::set<GenNode, GenNode::IDComparator>
private

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

◆ Storage

using Storage = std::unordered_map<BareEntryID, StateData, BareEntryID::UseEmbeddedHash>
private

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

◆ Record

using Record = Storage::value_type

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

◆ iterator

using iterator = Storage::const_iterator

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

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

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

References StateMapGroupingStorage::elmTable_.

◆ size()

size_t size ( ) const
inline

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

References StateMapGroupingStorage::elmTable_.

Referenced by StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ clear()

void clear ( )
inline

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

References StateMapGroupingStorage::elmTable_.

Referenced by StateRecorder::clearState(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ 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 104 of file state-map-grouping-storage.hpp.

References StateMapGroupingStorage::elmTable_, StateMapGroupingStorage::find(), StateMapGroupingStorage::getState(), and Ref::NO.

Referenced by StateRecorder::currentState(), StateRecorder::replayState(), and StateMapGroupingStorage_test::run().

+ Here is the call graph for this function:
+ Here is the caller 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 119 of file state-map-grouping-storage.hpp.

References StateMapGroupingStorage::elmTable_.

Referenced by StateRecorder::recordState(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ clearProperty()

void clearProperty ( BareEntryID const &  elementID,
string  propertyKey 
)
inline

clear previously recorded state for a given element and specific property

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

References StateMapGroupingStorage::elmTable_, StateMapGroupingStorage::find(), and StateMapGroupingStorage::findProperty().

Referenced by StateRecorder::recordState(), and StateMapGroupingStorage_test::run().

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

◆ clearState()

void clearState ( BareEntryID const &  elementID)
inline

clear any previously recorded state for a given element

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

References StateMapGroupingStorage::elmTable_, and StateMapGroupingStorage::find().

Referenced by StateRecorder::recordState().

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

◆ begin()

iterator begin ( ) const
inline

◆ end()

iterator end ( ) const
inline

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

References StateMapGroupingStorage::elmTable_.

Referenced by StateRecorder::replayAllProperties(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ find()

iterator find ( BareEntryID const &  elementID) const
inline

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

References StateMapGroupingStorage::elmTable_.

Referenced by StateMapGroupingStorage::clearProperty(), StateMapGroupingStorage::clearState(), StateRecorder::replayAllProperties(), StateMapGroupingStorage::retrieve(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ getID()

static BareEntryID const & getID ( Record const &  entry)
inlinestatic

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

Referenced by StateRecorder::replayAllState(), StateRecorder::replayPropertiesOf(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ getState() [1/2]

static StateData const & getState ( Record const &  entry)
inlinestatic

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

Referenced by StateRecorder::replayAllState(), StateRecorder::replayPropertiesOf(), StateMapGroupingStorage::retrieve(), and StateMapGroupingStorage_test::run().

+ Here is the caller graph for this function:

◆ getState() [2/2]

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 190 of file state-map-grouping-storage.hpp.

References StateMapGroupingStorage::findProperty(), and Ref::NO.

+ Here is the call graph for this function:

◆ findProperty()

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

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

Referenced by StateMapGroupingStorage::clearProperty(), and StateMapGroupingStorage::getState().

+ Here is the caller graph for this function:

Member Data Documentation

◆ elmTable_

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

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