|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Simple container for fields of type DataType w/ minimal error checking. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/slam/FieldRegistry.hpp>

Public Types | |
| using | PositionType = typename SetType::PositionType |
| The set's position type. More... | |
| using | DataType = TheDataType |
| Data type for scalars, buffers, and map values stored in this registry. More... | |
| using | KeyType = std::string |
| Key type used for registry entries. More... | |
| using | MapType = slam::Map< DataType, SetType > |
Owning field type (slam::Map) stored by this registry. More... | |
| using | BufferType = typename MapType::OrderedMap |
Owning buffer type used by MapType. More... | |
| using | ViewMapType = decltype(slam::make_map(std::declval< const SetType * >(), std::declval< axom::ArrayView< DataType > >())) |
| View-backed field type stored by this registry. More... | |
| using | ViewBufferType = axom::ArrayView< DataType > |
| View-backed buffer type stored by this registry. More... | |
| using | FieldStorageType = std::variant< MapType, ViewMapType > |
| Storage for one named field, either owning or view-backed. More... | |
| using | DataVecMap = std::map< KeyType, FieldStorageType, std::less<> > |
| using | DataBufferMap = std::map< KeyType, BufferType, std::less<> > |
| using | DataViewBufferMap = std::map< KeyType, ViewBufferType, std::less<> > |
| using | DataAttrMap = std::map< KeyType, DataType, std::less<> > |
Public Member Functions | |
Fields | |
| bool | hasField (std::string_view key) const |
| Returns true if a field with the given key exists. More... | |
| MapType & | addField (std::string_view key, const SetType *theSet) |
| Adds (or replaces) an owning field with the given key. More... | |
| ViewMapType & | addField (std::string_view key, const SetType *theSet, axom::ArrayView< DataType > data) |
Adds (or replaces) a view-backed field from an axom::ArrayView. More... | |
| ViewMapType & | addField (std::string_view key, const SetType *theSet, DataType *data) |
| Adds (or replaces) a view-backed field from a raw pointer buffer. More... | |
| MapType & | addNamelessField (const SetType *theSet) |
| Adds a new owning field using an auto-generated unique key. More... | |
| ViewMapType & | addNamelessField (const SetType *theSet, axom::ArrayView< DataType > data) |
| Adds a new view-backed field using an auto-generated unique key. More... | |
| MapType & | getField (std::string_view key) |
| Returns a mutable reference to the owning field for key. More... | |
| const MapType & | getField (std::string_view key) const |
| Returns a const reference to the owning field for key. More... | |
| std::optional< std::reference_wrapper< MapType > > | findField (std::string_view key) |
| Finds an owning field by name without inserting or asserting. More... | |
| std::optional< std::reference_wrapper< const MapType > > | findField (std::string_view key) const |
| Finds an owning field by name (const overload). More... | |
View-backed Fields | |
| bool | hasFieldView (std::string_view key) const |
| Returns true if a view-backed field with the given key exists. More... | |
| ViewMapType & | addFieldView (std::string_view key, const SetType *theSet, axom::ArrayView< DataType > data) |
Adds (or replaces) a view-backed field from an axom::ArrayView. More... | |
| ViewMapType & | addFieldView (std::string_view key, const SetType *theSet, DataType *data) |
| Adds (or replaces) a view-backed field from a raw pointer buffer. More... | |
| ViewMapType & | addNamelessFieldView (const SetType *theSet, axom::ArrayView< DataType > data) |
| Adds a new view-backed field using an auto-generated unique key. More... | |
| ViewMapType & | getFieldView (std::string_view key) |
| Returns a mutable reference to the view-backed field for key. More... | |
| const ViewMapType & | getFieldView (std::string_view key) const |
| Returns a const reference to the view-backed field for key. More... | |
| std::optional< ViewMapType > | findFieldView (std::string_view key) |
| Finds a view-backed field by name without inserting or asserting. More... | |
| std::optional< ViewMapType > | findFieldView (std::string_view key) const |
| Finds a view-backed field by name (const overload). More... | |
Owning Buffers | |
| bool | hasBuffer (std::string_view key) const |
| Returns true if an owning buffer with the given key exists. More... | |
| BufferType & | addBuffer (std::string_view key, int size=0) |
| Adds (or replaces) an owning buffer with the given key. More... | |
| BufferType & | addNamelessBuffer (int size=0) |
| Adds a new owning buffer using an auto-generated unique key. More... | |
| BufferType & | getBuffer (std::string_view key) |
| Returns a mutable reference to the owning buffer for key. More... | |
| const BufferType & | getBuffer (std::string_view key) const |
| Returns a const reference to the owning buffer for key. More... | |
| std::optional< std::reference_wrapper< BufferType > > | findBuffer (std::string_view key) |
| Finds an owning buffer by name without inserting or asserting. More... | |
| std::optional< std::reference_wrapper< const BufferType > > | findBuffer (std::string_view key) const |
| Finds an owning buffer by name (const overload). More... | |
View-backed Buffers | |
| bool | hasBufferView (std::string_view key) const |
| Returns true if a view-backed buffer with the given key exists. More... | |
| ViewBufferType & | addBufferView (std::string_view key, ViewBufferType view) |
Adds (or replaces) a view-backed buffer from an axom::ArrayView. More... | |
| ViewBufferType & | addBufferView (std::string_view key, DataType *data, PositionType size) |
| Adds (or replaces) a view-backed buffer from a raw pointer and size. More... | |
| ViewBufferType & | addNamelessBufferView (ViewBufferType view) |
| Adds a new view-backed buffer using an auto-generated unique key. More... | |
| ViewBufferType & | getBufferView (std::string_view key) |
| Returns a mutable reference to the view-backed buffer for key. More... | |
| const ViewBufferType & | getBufferView (std::string_view key) const |
| Returns a const reference to the view-backed buffer for key. More... | |
| std::optional< ViewBufferType > | findBufferView (std::string_view key) |
| Finds a view-backed buffer by name without inserting or asserting. More... | |
| std::optional< ViewBufferType > | findBufferView (std::string_view key) const |
| Finds a view-backed buffer by name (const overload). More... | |
Scalars | |
| bool | hasScalar (std::string_view key) const |
| Returns true if a scalar with the given key exists. More... | |
| DataType & | addScalar (std::string_view key, DataType val) |
| Adds (or replaces) a scalar value with the given key. More... | |
| DataType & | getScalar (std::string_view key) |
| Returns a mutable reference to the scalar for key. More... | |
| const DataType & | getScalar (std::string_view key) const |
| Returns a const reference to the scalar for key. More... | |
| std::optional< DataType > | findScalar (std::string_view key) const |
| Finds a scalar by name without inserting or asserting. More... | |
Simple container for fields of type DataType w/ minimal error checking.
slam::Mapslam::Map over axom::ArrayView (useful when generating SLAM objects from externally-owned C arrays) | using axom::slam::FieldRegistry< SetType, TheDataType >::PositionType = typename SetType::PositionType |
The set's position type.
| using axom::slam::FieldRegistry< SetType, TheDataType >::DataType = TheDataType |
Data type for scalars, buffers, and map values stored in this registry.
| using axom::slam::FieldRegistry< SetType, TheDataType >::KeyType = std::string |
Key type used for registry entries.
| using axom::slam::FieldRegistry< SetType, TheDataType >::MapType = slam::Map<DataType, SetType> |
Owning field type (slam::Map) stored by this registry.
| using axom::slam::FieldRegistry< SetType, TheDataType >::BufferType = typename MapType::OrderedMap |
Owning buffer type used by MapType.
| using axom::slam::FieldRegistry< SetType, TheDataType >::ViewMapType = decltype(slam::make_map(std::declval<const SetType*>(), std::declval<axom::ArrayView<DataType> >())) |
View-backed field type stored by this registry.
This is the return type of slam::make_map(set, axom::ArrayView<DataType>{...}) and uses policies::ArrayViewIndirection.
| using axom::slam::FieldRegistry< SetType, TheDataType >::ViewBufferType = axom::ArrayView<DataType> |
View-backed buffer type stored by this registry.
| using axom::slam::FieldRegistry< SetType, TheDataType >::FieldStorageType = std::variant<MapType, ViewMapType> |
Storage for one named field, either owning or view-backed.
| using axom::slam::FieldRegistry< SetType, TheDataType >::DataVecMap = std::map<KeyType, FieldStorageType, std::less<> > |
| using axom::slam::FieldRegistry< SetType, TheDataType >::DataBufferMap = std::map<KeyType, BufferType, std::less<> > |
| using axom::slam::FieldRegistry< SetType, TheDataType >::DataViewBufferMap = std::map<KeyType, ViewBufferType, std::less<> > |
| using axom::slam::FieldRegistry< SetType, TheDataType >::DataAttrMap = std::map<KeyType, DataType, std::less<> > |
|
inline |
Returns true if a field with the given key exists.
This function performs heterogeneous lookup, so callers may pass a std::string_view (or const char*) without allocating.
|
inline |
Adds (or replaces) an owning field with the given key.
| key | The field name. |
| theSet | Pointer to the set associated with the field (must outlive the map). |
|
inline |
Adds (or replaces) a view-backed field from an axom::ArrayView.
| key | The field name. |
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | View of externally-owned storage (must outlive the map). |
References axom::slam::make_map().
|
inline |
Adds (or replaces) a view-backed field from a raw pointer buffer.
| key | The field name. |
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | Pointer to externally-owned storage (must outlive the map). The helper wraps this as an axom::ArrayView<DataType> sized to theSet->size(). |
References axom::slam::make_map().
|
inline |
Adds a new owning field using an auto-generated unique key.
| theSet | Pointer to the set associated with the field (must outlive the map). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addField().
|
inline |
Adds a new view-backed field using an auto-generated unique key.
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | View of externally-owned storage (must outlive the map). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addField().
|
inline |
Returns a mutable reference to the owning field for key.
| key | Field name. |
findField(key) has a value (the key exists and is owning, not view-backed). getFieldView(). Requesting an owning field for a view-backed key is a precondition violation: it asserts in debug builds, and in release builds the underlying std::get throws std::bad_variant_access.
|
inline |
Returns a const reference to the owning field for key.
| key | Field name. |
findField(key) has a value (the key exists and is owning, not view-backed). getFieldView(). Requesting an owning field for a view-backed key is a precondition violation: it asserts in debug builds, and in release builds the underlying std::get throws std::bad_variant_access.
|
inline |
Finds an owning field by name without inserting or asserting.
| key | Field name. |
|
inline |
Finds an owning field by name (const overload).
| key | Field name. |
|
inline |
Returns true if a view-backed field with the given key exists.
|
inline |
Adds (or replaces) a view-backed field from an axom::ArrayView.
| key | The field name. |
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | View of externally-owned storage (must outlive the map). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addField().
|
inline |
Adds (or replaces) a view-backed field from a raw pointer buffer.
| key | The field name. |
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | Pointer to externally-owned storage (must outlive the map). The helper wraps this as an axom::ArrayView<DataType> sized to theSet->size(). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addField().
|
inline |
Adds a new view-backed field using an auto-generated unique key.
| theSet | Pointer to the set associated with the field (must outlive the map). |
| data | View of externally-owned storage (must outlive the map). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessField().
|
inline |
Returns a mutable reference to the view-backed field for key.
hasFieldView(key) is true (the key exists and is view-backed, not owning). getField(). Requesting a view-backed field for an owning key is a precondition violation: it asserts in debug builds, and in release builds the underlying std::get throws std::bad_variant_access.
|
inline |
Returns a const reference to the view-backed field for key.
hasFieldView(key) is true (the key exists and is view-backed, not owning). getField(). Requesting a view-backed field for an owning key is a precondition violation: it asserts in debug builds, and in release builds the underlying std::get throws std::bad_variant_access.
|
inline |
Finds a view-backed field by name without inserting or asserting.
|
inline |
Finds a view-backed field by name (const overload).
|
inline |
Returns true if an owning buffer with the given key exists.
|
inline |
Adds (or replaces) an owning buffer with the given key.
| key | Buffer name. |
| size | Initial buffer size. |
|
inline |
Adds a new owning buffer using an auto-generated unique key.
| size | Initial buffer size. |
References axom::slam::FieldRegistry< SetType, TheDataType >::addBuffer().
|
inline |
Returns a mutable reference to the owning buffer for key.
hasBuffer(key) is true.
|
inline |
Returns a const reference to the owning buffer for key.
hasBuffer(key) is true.
|
inline |
Finds an owning buffer by name without inserting or asserting.
|
inline |
Finds an owning buffer by name (const overload).
|
inline |
Returns true if a view-backed buffer with the given key exists.
|
inline |
Adds (or replaces) a view-backed buffer from an axom::ArrayView.
| key | Buffer name. |
| view | View of externally-owned storage (must outlive the registry entry). |
|
inline |
Adds (or replaces) a view-backed buffer from a raw pointer and size.
| key | Buffer name. |
| data | Pointer to externally-owned storage (must outlive the registry entry). |
| size | Number of elements. |
References axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView().
|
inline |
Adds a new view-backed buffer using an auto-generated unique key.
| view | View of externally-owned storage (must outlive the registry entry). |
References axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView().
|
inline |
Returns a mutable reference to the view-backed buffer for key.
hasBufferView(key) is true.
|
inline |
Returns a const reference to the view-backed buffer for key.
hasBufferView(key) is true.
|
inline |
Finds a view-backed buffer by name without inserting or asserting.
|
inline |
Finds a view-backed buffer by name (const overload).
|
inline |
Returns true if a scalar with the given key exists.
|
inline |
Adds (or replaces) a scalar value with the given key.
| key | Scalar name. |
| val | Scalar value. |
|
inline |
Returns a mutable reference to the scalar for key.
hasScalar(key) is true.
|
inline |
Returns a const reference to the scalar for key.
hasScalar(key) is true.
|
inline |
Finds a scalar by name without inserting or asserting.
| key | Scalar name. |