AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A slam map class that supports adding and removing entries. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/slam/DynamicMap.hpp>
Public Types | |
using | SetPosition = typename SetType::PositionType |
using | SetElement = typename SetType::ElementType |
using | OrderedMap = std::vector< DataType > |
Public Member Functions | |
DynamicMap () | |
Default constructor. More... | |
DynamicMap (SetType *theSet) | |
Constructor from a set pointer. More... | |
DynamicMap (SetType *theSet, DataType defaultValue) | |
Constructor from a set pointer. More... | |
~DynamicMap () | |
const SetType * | set () const |
Returns a pointer to the map's underlying set. More... | |
OrderedMap & | data () |
Access to underlying data. More... | |
const OrderedMap & | data () const |
Const access to underlying data. More... | |
DynamicMap individual access functions | |
const DataType & | operator[] (SetPosition setIndex) const |
Return the value at set index setIndex. More... | |
DynamicMap cardinality functions | |
SetPosition | size () const |
Returns the size of map's set. More... | |
SetPosition | numberOfValidEntries () const |
Return the number of valid entries. More... | |
DynamicMap validity check functions | |
bool | isValidEntry (SetPosition pos) const |
bool | isValid (bool verboseOutput=false) const |
Predicate to check if this DynamicMap instance is valid. More... | |
Functions that modify the map's cardinality | |
DataType & | operator[] (SetPosition position) |
Get the value at position position. More... | |
void | insert (SetPosition position, DataType value) |
Insert vale value into position position in the map. More... | |
void | resize (SetPosition s) |
Resizes the map to have at least s positions. More... | |
A slam map class that supports adding and removing entries.
An entry in the map is considered valid if its corresponding set's entry is valid
using axom::slam::DynamicMap< SetType, DataType >::SetPosition = typename SetType::PositionType |
using axom::slam::DynamicMap< SetType, DataType >::SetElement = typename SetType::ElementType |
using axom::slam::DynamicMap< SetType, DataType >::OrderedMap = std::vector<DataType> |
|
inline |
Default constructor.
|
inline |
Constructor from a set pointer.
theSet | A pointer to the map's set |
The map will be allocated with theSet->size() entries. There is no guarantee that the values will be initialized
|
inline |
Constructor from a set pointer.
theSet | A pointer to the map's set |
defaultValue | The value that each entry in the map will be initialized |
The map will be allocated with theSet->size() entries. Each entry will have value defaultValue
|
inline |
|
inline |
Returns a pointer to the map's underlying set.
|
inline |
Return the value at set index setIndex.
Referenced by axom::slam::DynamicMap< SetType, DataType >::insert().
|
inline |
Access to underlying data.
|
inline |
Const access to underlying data.
|
inline |
Returns the size of map's set.
Referenced by axom::slam::DynamicMap< SetType, DataType >::operator[]().
|
inline |
Return the number of valid entries.
An entry at a given index is considered valid if corresponding set element is valid.
|
inline |
bool axom::slam::DynamicMap< SetType, DataType >::isValid | ( | bool | verboseOutput = false | ) | const |
Predicate to check if this DynamicMap instance is valid.
References SLIC_DEBUG.
Referenced by axom::slam::DynamicMap< SetType, DataType >::isValidEntry().
|
inline |
Get the value at position position.
References axom::slam::DynamicMap< SetType, DataType >::resize(), and axom::slam::DynamicMap< SetType, DataType >::size().
|
inline |
Insert vale value into position position in the map.
References axom::slam::DynamicMap< SetType, DataType >::operator[]().
|
inline |
Resizes the map to have at least s positions.
s | The minimum necessary capacity for resizing |
References SLIC_ASSERT_MSG.
Referenced by axom::slam::DynamicMap< SetType, DataType >::operator[]().