AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::FieldRegistry< SetType, TheDataType > Class Template Reference

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>

Inheritance diagram for axom::slam::FieldRegistry< SetType, TheDataType >:

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...
 
MapTypeaddField (std::string_view key, const SetType *theSet)
 Adds (or replaces) an owning field with the given key. More...
 
ViewMapTypeaddField (std::string_view key, const SetType *theSet, axom::ArrayView< DataType > data)
 Adds (or replaces) a view-backed field from an axom::ArrayView. More...
 
ViewMapTypeaddField (std::string_view key, const SetType *theSet, DataType *data)
 Adds (or replaces) a view-backed field from a raw pointer buffer. More...
 
MapTypeaddNamelessField (const SetType *theSet)
 Adds a new owning field using an auto-generated unique key. More...
 
ViewMapTypeaddNamelessField (const SetType *theSet, axom::ArrayView< DataType > data)
 Adds a new view-backed field using an auto-generated unique key. More...
 
MapTypegetField (std::string_view key)
 Returns a mutable reference to the owning field for key. More...
 
const MapTypegetField (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...
 
ViewMapTypeaddFieldView (std::string_view key, const SetType *theSet, axom::ArrayView< DataType > data)
 Adds (or replaces) a view-backed field from an axom::ArrayView. More...
 
ViewMapTypeaddFieldView (std::string_view key, const SetType *theSet, DataType *data)
 Adds (or replaces) a view-backed field from a raw pointer buffer. More...
 
ViewMapTypeaddNamelessFieldView (const SetType *theSet, axom::ArrayView< DataType > data)
 Adds a new view-backed field using an auto-generated unique key. More...
 
ViewMapTypegetFieldView (std::string_view key)
 Returns a mutable reference to the view-backed field for key. More...
 
const ViewMapTypegetFieldView (std::string_view key) const
 Returns a const reference to the view-backed field for key. More...
 
std::optional< ViewMapTypefindFieldView (std::string_view key)
 Finds a view-backed field by name without inserting or asserting. More...
 
std::optional< ViewMapTypefindFieldView (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...
 
BufferTypeaddBuffer (std::string_view key, int size=0)
 Adds (or replaces) an owning buffer with the given key. More...
 
BufferTypeaddNamelessBuffer (int size=0)
 Adds a new owning buffer using an auto-generated unique key. More...
 
BufferTypegetBuffer (std::string_view key)
 Returns a mutable reference to the owning buffer for key. More...
 
const BufferTypegetBuffer (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...
 
ViewBufferTypeaddBufferView (std::string_view key, ViewBufferType view)
 Adds (or replaces) a view-backed buffer from an axom::ArrayView. More...
 
ViewBufferTypeaddBufferView (std::string_view key, DataType *data, PositionType size)
 Adds (or replaces) a view-backed buffer from a raw pointer and size. More...
 
ViewBufferTypeaddNamelessBufferView (ViewBufferType view)
 Adds a new view-backed buffer using an auto-generated unique key. More...
 
ViewBufferTypegetBufferView (std::string_view key)
 Returns a mutable reference to the view-backed buffer for key. More...
 
const ViewBufferTypegetBufferView (std::string_view key) const
 Returns a const reference to the view-backed buffer for key. More...
 
std::optional< ViewBufferTypefindBufferView (std::string_view key)
 Finds a view-backed buffer by name without inserting or asserting. More...
 
std::optional< ViewBufferTypefindBufferView (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...
 
DataTypeaddScalar (std::string_view key, DataType val)
 Adds (or replaces) a scalar value with the given key. More...
 
DataTypegetScalar (std::string_view key)
 Returns a mutable reference to the scalar for key. More...
 
const DataTypegetScalar (std::string_view key) const
 Returns a const reference to the scalar for key. More...
 
std::optional< DataTypefindScalar (std::string_view key) const
 Finds a scalar by name without inserting or asserting. More...
 

Detailed Description

template<typename SetType, typename TheDataType>
class axom::slam::FieldRegistry< SetType, TheDataType >

Simple container for fields of type DataType w/ minimal error checking.

Note
We are using concrete instances for int and double in the code below. This should eventually be replaced with the sidre datastore.
FieldRegistry is a host-only facility: it stores std::map tables keyed by std::string and its find APIs return std::optional. The lookup tables use transparent comparison (std::less<>) so callers may query with a std::string_view without constructing a temporary std::string.
FieldRegistry supports two field storage modes under a single field keyspace:

Member Typedef Documentation

◆ PositionType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::PositionType = typename SetType::PositionType

The set's position type.

◆ DataType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::DataType = TheDataType

Data type for scalars, buffers, and map values stored in this registry.

◆ KeyType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::KeyType = std::string

Key type used for registry entries.

◆ MapType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::MapType = slam::Map<DataType, SetType>

Owning field type (slam::Map) stored by this registry.

◆ BufferType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::BufferType = typename MapType::OrderedMap

Owning buffer type used by MapType.

◆ ViewMapType

template<typename SetType , typename TheDataType >
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.

◆ ViewBufferType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::ViewBufferType = axom::ArrayView<DataType>

View-backed buffer type stored by this registry.

◆ FieldStorageType

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::FieldStorageType = std::variant<MapType, ViewMapType>

Storage for one named field, either owning or view-backed.

◆ DataVecMap

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::DataVecMap = std::map<KeyType, FieldStorageType, std::less<> >

◆ DataBufferMap

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::DataBufferMap = std::map<KeyType, BufferType, std::less<> >

◆ DataViewBufferMap

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::DataViewBufferMap = std::map<KeyType, ViewBufferType, std::less<> >

◆ DataAttrMap

template<typename SetType , typename TheDataType >
using axom::slam::FieldRegistry< SetType, TheDataType >::DataAttrMap = std::map<KeyType, DataType, std::less<> >

Member Function Documentation

◆ hasField()

template<typename SetType , typename TheDataType >
bool axom::slam::FieldRegistry< SetType, TheDataType >::hasField ( std::string_view  key) const
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.

◆ addField() [1/3]

template<typename SetType , typename TheDataType >
MapType& axom::slam::FieldRegistry< SetType, TheDataType >::addField ( std::string_view  key,
const SetType *  theSet 
)
inline

Adds (or replaces) an owning field with the given key.

Parameters
keyThe field name.
theSetPointer to the set associated with the field (must outlive the map).
Returns
A mutable reference to the stored field.
Note
If an entry with the same key already exists, it is overwritten.

◆ addField() [2/3]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addField ( std::string_view  key,
const SetType *  theSet,
axom::ArrayView< DataType data 
)
inline

Adds (or replaces) a view-backed field from an axom::ArrayView.

Parameters
keyThe field name.
theSetPointer to the set associated with the field (must outlive the map).
dataView of externally-owned storage (must outlive the map).
Returns
A mutable reference to the stored field.
Note
If an entry with the same key already exists, it is overwritten.

References axom::slam::make_map().

◆ addField() [3/3]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addField ( std::string_view  key,
const SetType *  theSet,
DataType data 
)
inline

Adds (or replaces) a view-backed field from a raw pointer buffer.

Parameters
keyThe field name.
theSetPointer to the set associated with the field (must outlive the map).
dataPointer to externally-owned storage (must outlive the map). The helper wraps this as an axom::ArrayView<DataType> sized to theSet->size().
Returns
A mutable reference to the stored field.
Note
If an entry with the same key already exists, it is overwritten.

References axom::slam::make_map().

◆ addNamelessField() [1/2]

template<typename SetType , typename TheDataType >
MapType& axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessField ( const SetType *  theSet)
inline

Adds a new owning field using an auto-generated unique key.

Parameters
theSetPointer to the set associated with the field (must outlive the map).
Returns
A mutable reference to the stored field.
Note
The generated key is unique within this translation unit and template instantiation, but this API is not intended to be used concurrently from multiple threads.

References axom::slam::FieldRegistry< SetType, TheDataType >::addField().

◆ addNamelessField() [2/2]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessField ( const SetType *  theSet,
axom::ArrayView< DataType data 
)
inline

Adds a new view-backed field using an auto-generated unique key.

Parameters
theSetPointer to the set associated with the field (must outlive the map).
dataView of externally-owned storage (must outlive the map).
Returns
A mutable reference to the stored field.

References axom::slam::FieldRegistry< SetType, TheDataType >::addField().

◆ getField() [1/2]

template<typename SetType , typename TheDataType >
MapType& axom::slam::FieldRegistry< SetType, TheDataType >::getField ( std::string_view  key)
inline

Returns a mutable reference to the owning field for key.

Parameters
keyField name.
Returns
A mutable reference to the stored field.
Precondition
findField(key) has a value (the key exists and is owning, not view-backed).
Note
In debug builds, this asserts if the key is missing or is view-backed.
For view-backed fields, use 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.

◆ getField() [2/2]

template<typename SetType , typename TheDataType >
const MapType& axom::slam::FieldRegistry< SetType, TheDataType >::getField ( std::string_view  key) const
inline

Returns a const reference to the owning field for key.

Parameters
keyField name.
Returns
A const reference to the stored field.
Precondition
findField(key) has a value (the key exists and is owning, not view-backed).
Note
In debug builds, this asserts if the key is missing or is view-backed.
For view-backed fields, use 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.

◆ findField() [1/2]

template<typename SetType , typename TheDataType >
std::optional<std::reference_wrapper<MapType> > axom::slam::FieldRegistry< SetType, TheDataType >::findField ( std::string_view  key)
inline

Finds an owning field by name without inserting or asserting.

Parameters
keyField name.
Returns
An optional referencing the field if present, else empty.
Note
This function never inserts a new entry.

◆ findField() [2/2]

template<typename SetType , typename TheDataType >
std::optional<std::reference_wrapper<const MapType> > axom::slam::FieldRegistry< SetType, TheDataType >::findField ( std::string_view  key) const
inline

Finds an owning field by name (const overload).

Parameters
keyField name.
Returns
An optional referencing the field if present, else empty.
Note
This function never inserts a new entry.

◆ hasFieldView()

template<typename SetType , typename TheDataType >
bool axom::slam::FieldRegistry< SetType, TheDataType >::hasFieldView ( std::string_view  key) const
inline

Returns true if a view-backed field with the given key exists.

◆ addFieldView() [1/2]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addFieldView ( std::string_view  key,
const SetType *  theSet,
axom::ArrayView< DataType data 
)
inline

Adds (or replaces) a view-backed field from an axom::ArrayView.

Parameters
keyThe field name.
theSetPointer to the set associated with the field (must outlive the map).
dataView of externally-owned storage (must outlive the map).
Returns
A mutable reference to the stored field.
Note
If an entry with the same key already exists, it is overwritten.

References axom::slam::FieldRegistry< SetType, TheDataType >::addField().

◆ addFieldView() [2/2]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addFieldView ( std::string_view  key,
const SetType *  theSet,
DataType data 
)
inline

Adds (or replaces) a view-backed field from a raw pointer buffer.

Parameters
keyThe field name.
theSetPointer to the set associated with the field (must outlive the map).
dataPointer to externally-owned storage (must outlive the map). The helper wraps this as an axom::ArrayView<DataType> sized to theSet->size().
Returns
A mutable reference to the stored field.
Note
If an entry with the same key already exists, it is overwritten.

References axom::slam::FieldRegistry< SetType, TheDataType >::addField().

◆ addNamelessFieldView()

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessFieldView ( const SetType *  theSet,
axom::ArrayView< DataType data 
)
inline

Adds a new view-backed field using an auto-generated unique key.

Parameters
theSetPointer to the set associated with the field (must outlive the map).
dataView of externally-owned storage (must outlive the map).
Returns
A mutable reference to the stored field.

References axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessField().

◆ getFieldView() [1/2]

template<typename SetType , typename TheDataType >
ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::getFieldView ( std::string_view  key)
inline

Returns a mutable reference to the view-backed field for key.

Precondition
hasFieldView(key) is true (the key exists and is view-backed, not owning).
Note
For owning fields, use 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.

◆ getFieldView() [2/2]

template<typename SetType , typename TheDataType >
const ViewMapType& axom::slam::FieldRegistry< SetType, TheDataType >::getFieldView ( std::string_view  key) const
inline

Returns a const reference to the view-backed field for key.

Precondition
hasFieldView(key) is true (the key exists and is view-backed, not owning).
Note
For owning fields, use 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.

◆ findFieldView() [1/2]

template<typename SetType , typename TheDataType >
std::optional<ViewMapType> axom::slam::FieldRegistry< SetType, TheDataType >::findFieldView ( std::string_view  key)
inline

Finds a view-backed field by name without inserting or asserting.

Returns
An optional referencing the field if present, else empty.

◆ findFieldView() [2/2]

template<typename SetType , typename TheDataType >
std::optional<ViewMapType> axom::slam::FieldRegistry< SetType, TheDataType >::findFieldView ( std::string_view  key) const
inline

Finds a view-backed field by name (const overload).

Returns
An optional referencing the field if present, else empty.

◆ hasBuffer()

template<typename SetType , typename TheDataType >
bool axom::slam::FieldRegistry< SetType, TheDataType >::hasBuffer ( std::string_view  key) const
inline

Returns true if an owning buffer with the given key exists.

◆ addBuffer()

template<typename SetType , typename TheDataType >
BufferType& axom::slam::FieldRegistry< SetType, TheDataType >::addBuffer ( std::string_view  key,
int  size = 0 
)
inline

Adds (or replaces) an owning buffer with the given key.

Parameters
keyBuffer name.
sizeInitial buffer size.
Returns
A mutable reference to the stored buffer.
Note
If an entry with the same key already exists, it is overwritten.

◆ addNamelessBuffer()

template<typename SetType , typename TheDataType >
BufferType& axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessBuffer ( int  size = 0)
inline

Adds a new owning buffer using an auto-generated unique key.

Parameters
sizeInitial buffer size.
Returns
A mutable reference to the stored buffer.

References axom::slam::FieldRegistry< SetType, TheDataType >::addBuffer().

◆ getBuffer() [1/2]

template<typename SetType , typename TheDataType >
BufferType& axom::slam::FieldRegistry< SetType, TheDataType >::getBuffer ( std::string_view  key)
inline

Returns a mutable reference to the owning buffer for key.

Precondition
hasBuffer(key) is true.

◆ getBuffer() [2/2]

template<typename SetType , typename TheDataType >
const BufferType& axom::slam::FieldRegistry< SetType, TheDataType >::getBuffer ( std::string_view  key) const
inline

Returns a const reference to the owning buffer for key.

Precondition
hasBuffer(key) is true.

◆ findBuffer() [1/2]

template<typename SetType , typename TheDataType >
std::optional<std::reference_wrapper<BufferType> > axom::slam::FieldRegistry< SetType, TheDataType >::findBuffer ( std::string_view  key)
inline

Finds an owning buffer by name without inserting or asserting.

Returns
An optional referencing the buffer if present, else empty.

◆ findBuffer() [2/2]

template<typename SetType , typename TheDataType >
std::optional<std::reference_wrapper<const BufferType> > axom::slam::FieldRegistry< SetType, TheDataType >::findBuffer ( std::string_view  key) const
inline

Finds an owning buffer by name (const overload).

Returns
An optional referencing the buffer if present, else empty.

◆ hasBufferView()

template<typename SetType , typename TheDataType >
bool axom::slam::FieldRegistry< SetType, TheDataType >::hasBufferView ( std::string_view  key) const
inline

Returns true if a view-backed buffer with the given key exists.

◆ addBufferView() [1/2]

template<typename SetType , typename TheDataType >
ViewBufferType& axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView ( std::string_view  key,
ViewBufferType  view 
)
inline

Adds (or replaces) a view-backed buffer from an axom::ArrayView.

Parameters
keyBuffer name.
viewView of externally-owned storage (must outlive the registry entry).
Returns
A mutable reference to the stored view.
Note
If an entry with the same key already exists, it is overwritten.

◆ addBufferView() [2/2]

template<typename SetType , typename TheDataType >
ViewBufferType& axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView ( std::string_view  key,
DataType data,
PositionType  size 
)
inline

Adds (or replaces) a view-backed buffer from a raw pointer and size.

Parameters
keyBuffer name.
dataPointer to externally-owned storage (must outlive the registry entry).
sizeNumber of elements.
Returns
A mutable reference to the stored view.

References axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView().

◆ addNamelessBufferView()

template<typename SetType , typename TheDataType >
ViewBufferType& axom::slam::FieldRegistry< SetType, TheDataType >::addNamelessBufferView ( ViewBufferType  view)
inline

Adds a new view-backed buffer using an auto-generated unique key.

Parameters
viewView of externally-owned storage (must outlive the registry entry).
Returns
A mutable reference to the stored view.

References axom::slam::FieldRegistry< SetType, TheDataType >::addBufferView().

◆ getBufferView() [1/2]

template<typename SetType , typename TheDataType >
ViewBufferType& axom::slam::FieldRegistry< SetType, TheDataType >::getBufferView ( std::string_view  key)
inline

Returns a mutable reference to the view-backed buffer for key.

Precondition
hasBufferView(key) is true.

◆ getBufferView() [2/2]

template<typename SetType , typename TheDataType >
const ViewBufferType& axom::slam::FieldRegistry< SetType, TheDataType >::getBufferView ( std::string_view  key) const
inline

Returns a const reference to the view-backed buffer for key.

Precondition
hasBufferView(key) is true.

◆ findBufferView() [1/2]

template<typename SetType , typename TheDataType >
std::optional<ViewBufferType> axom::slam::FieldRegistry< SetType, TheDataType >::findBufferView ( std::string_view  key)
inline

Finds a view-backed buffer by name without inserting or asserting.

Returns
An optional referencing the buffer if present, else empty.

◆ findBufferView() [2/2]

template<typename SetType , typename TheDataType >
std::optional<ViewBufferType> axom::slam::FieldRegistry< SetType, TheDataType >::findBufferView ( std::string_view  key) const
inline

Finds a view-backed buffer by name (const overload).

Returns
An optional referencing the buffer if present, else empty.

◆ hasScalar()

template<typename SetType , typename TheDataType >
bool axom::slam::FieldRegistry< SetType, TheDataType >::hasScalar ( std::string_view  key) const
inline

Returns true if a scalar with the given key exists.

◆ addScalar()

template<typename SetType , typename TheDataType >
DataType& axom::slam::FieldRegistry< SetType, TheDataType >::addScalar ( std::string_view  key,
DataType  val 
)
inline

Adds (or replaces) a scalar value with the given key.

Parameters
keyScalar name.
valScalar value.
Returns
A mutable reference to the stored value.
Note
If an entry with the same key already exists, it is overwritten.

◆ getScalar() [1/2]

template<typename SetType , typename TheDataType >
DataType& axom::slam::FieldRegistry< SetType, TheDataType >::getScalar ( std::string_view  key)
inline

Returns a mutable reference to the scalar for key.

Precondition
hasScalar(key) is true.

◆ getScalar() [2/2]

template<typename SetType , typename TheDataType >
const DataType& axom::slam::FieldRegistry< SetType, TheDataType >::getScalar ( std::string_view  key) const
inline

Returns a const reference to the scalar for key.

Precondition
hasScalar(key) is true.

◆ findScalar()

template<typename SetType , typename TheDataType >
std::optional<DataType> axom::slam::FieldRegistry< SetType, TheDataType >::findScalar ( std::string_view  key) const
inline

Finds a scalar by name without inserting or asserting.

Parameters
keyScalar name.
Returns
An engaged optional with the scalar's value if present, else empty.

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