GEOS
Public Types | Public Member Functions | List of all members
geos::dataRepository::Wrapper< T > Class Template Referencefinal

#include <Wrapper.hpp>

Inheritance diagram for geos::dataRepository::Wrapper< T >:
Inheritance graph
[legend]

Public Types

using TYPE = T
 Alias for the wrapped type T.
 

Public Member Functions

virtual HistoryMetadata getHistoryMetadata (localIndex const packCount=-1) const override final
 Get a description of the wrapped data for time history collection/output. More...
 
void const * voidPointer () const override
 
virtual localIndex elementByteSize () const override
 
virtual size_t bytesAllocated () const override final
 
Constructors, destructor, copy/move assignment
 Wrapper (string const &name, Group &parent)
 Constructor that creates a new instance of wrapped type. More...
 
 Wrapper (string const &name, Group &parent, std::unique_ptr< T > object)
 Constructor that takes ownership of an existing object. More...
 
 Wrapper (string const &name, Group &parent, T *object)
 Constructor that does not take ownership of an existing object. More...
 
virtual ~Wrapper () noexcept override
 Default destructor. More...
 
Wrapperoperator= (Wrapper const &source)
 Copy Assignment Operator. More...
 
Wrapperoperator= (Wrapper &&source)
 Move Assignment Operator. More...
 
Packing/unpacking methods.
virtual bool isPackable (bool onDevice) const override
 Check whether wrapped type is can be packed into a buffer on host or device. More...
 
virtual localIndex unpack (buffer_unit_type const *&buffer, bool withMetadata, bool onDevice, parallelDeviceEvents &events) override final
 Unpack the entire wrapped object from a buffer. More...
 
virtual localIndex unpackByIndex (buffer_unit_type const *&buffer, arrayView1d< localIndex const > const &unpackIndices, bool withMetadata, bool onDevice, parallelDeviceEvents &events, MPI_Op op) override final
 For indexable types, unpack selected indices of wrapped object from a buffer. More...
 
Methods that delegate to the wrapped type

These functions will call the corresponding method on the wrapped object, if such method is declared in wrapped type.

virtual localIndex size () const override
 Calls T::size() More...
 
virtual void resize (int ndims, localIndex const *const dims) override
 Calls T::resize( num_dims, dims ) More...
 
virtual void reserve (localIndex const newCapacity) override
 Calls T::reserve( newCapacity ) if it exists, otherwise a no-op. More...
 
virtual localIndex capacity () const override
 
virtual void resize (localIndex const newSize) override
 Calls T::resize(newsize) if it exists. More...
 
virtual void copy (localIndex const sourceIndex, localIndex const destIndex) override
 Calls T::copy(sourceIndex, destIndex) More...
 
virtual void copyData (WrapperBase const &source) override
 Copy the the data contained in another wrapper into this wrapper. More...
 
void erase (std::set< localIndex > const &indicesToErase) override
 Calls T::erase(indicesToErase) More...
 
virtual void move (LvArray::MemorySpace const space, bool const touch) const override
 Calls T::move(space, touch) More...
 
virtual Regex const & getTypeRegex () const override
 
Methods for wrapped value data access
T & reference ()
 Accessor for m_data. More...
 
GEOS_DECLTYPE_AUTO_RETURN reference () const
 const Accessor for m_data More...
 
template<typename _T = T, typename = std::enable_if_t< traits::HasMemberFunction_toView< _T > >>
GEOS_DECLTYPE_AUTO_RETURN referenceAsView ()
 Provide access to wrapped object converted to a view, if possible. More...
 
template<typename _T = T, typename = std::enable_if_t< !traits::HasMemberFunction_toView< _T > >>
T & referenceAsView ()
 Provide access to wrapped object converted to a view, if possible. More...
 
template<typename _T = T, typename = std::enable_if_t< traits::HasMemberFunction_toView< _T > >>
GEOS_DECLTYPE_AUTO_RETURN referenceAsView () const
 Provide access to wrapped object converted to a view, if possible. More...
 
template<typename _T = T, typename = std::enable_if_t< !traits::HasMemberFunction_toView< _T > >>
T const & referenceAsView () const
 Provide access to wrapped object converted to a view, if possible. More...
 
Methods to manipulate default value for wrapped object
virtual bool hasDefaultValue () const final override
 Return true iff this wrapper has a valid default value. More...
 
template<typename U = T>
DefaultValue< T > const & getDefaultValueStruct () const
 Accessor for m_default. More...
 
template<typename U = T>
std::enable_if_t< DefaultValue< U >::has_default_value, typename DefaultValue< U >::value_type const & > getDefaultValue () const
 Accessor for default value. More...
 
template<typename U = T>
std::enable_if_t< DefaultValue< U >::has_default_value, Wrapper< T > & > setDefaultValue (typename DefaultValue< U >::value_type const &defaultVal)
 Setter for default value. More...
 
template<typename U = T>
std::enable_if_t< !traits::is_array< U > &&DefaultValue< U >::has_default_value, Wrapper< T > & > setApplyDefaultValue (typename DefaultValue< U >::value_type const &defaultVal)
 Set and apply for default value. More...
 
template<typename U = T>
std::enable_if_t< traits::is_array< U > &&DefaultValue< U >::has_default_value, Wrapper< T > & > setApplyDefaultValue (typename DefaultValue< U >::value_type const &defaultVal)
 Set and apply for default value. More...
 
virtual string getDefaultValueString () const override
 Return a string representing the default value. More...
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, Wrapper< T > & > setLimits (std::optional< LimitArg< limit_value_type_t< T > > > min, std::optional< LimitArg< limit_value_type_t< T > > > max, LimitsMode mode=LimitsMode::Error)
 Set both bounds for this attribute's value. More...
 
template<typename U = T>
std::enable_if_t< !is_limitable_v< U > &&!traits::is_array_type< U >, Wrapper< T > & > setLimits (std::optional< LimitArg< limit_value_type_t< T > > >, std::optional< LimitArg< limit_value_type_t< T > > >, LimitsMode GEOS_UNUSED_PARAM(mode))
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, std::optional< Bound< limit_value_type_t< T > > > const & > getMinBound () const
 Accessor for the minimum bound of this attribute's value. More...
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, std::optional< Bound< limit_value_type_t< T > > > const & > getMaxBound () const
 Accessor for the maximum bound of this attribute's value. More...
 
virtual string getLimitsString () const override
 Return a string representing the allowed value range. More...
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, stringgetLimitsStringImpl () const
 
template<typename U = T>
std::enable_if_t< !is_limitable_v< U >, stringgetLimitsStringImpl () const
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U > &&!traits::is_array_type< U >, void > validateLimits ()
 
template<typename U = T>
std::enable_if_t< is_limitable_v< U > &&traits::is_array_type< U >, void > validateLimits ()
 
template<typename U = T>
std::enable_if_t< !is_limitable_v< U >, void > validateLimits ()
 
virtual bool processInputFile (xmlWrapper::xmlNode const &targetNode, xmlWrapper::xmlNodePos const &nodePos) override
 Initialize the wrapper from the input xml node. More...
 
void setName ()
 DO_NOT_DOCUMENT. More...
 
void addBlueprintField (conduit::Node &fields, string const &name, string const &topology, stdVector< string > const &componentNames={}) const override
 
void populateMCArray (conduit::Node &node, stdVector< string > const &componentNames={}) const override
 
std::unique_ptr< WrapperBaseaverageOverSecondDim (string const &name, Group &group) const override
 
void registerToWrite () const override
 Register the wrapper's data for writing with Conduit.
 
void finishWriting () const override
 Write the wrapped data into Conduit.
 
bool loadFromConduit () override
 Read the wrapped data from Conduit. More...
 
Overridden setters

Setters that replace (hide) corresponding non-virtual functions in WrapperBase with the goal of returning Wrapper<T> pointers rather than WrapperBase pointers.

Wrapper< T > & setSizedFromParent (int val)
 Set whether this wrapper is resized when its parent is resized. More...
 
Wrapper< T > & setRestartFlags (RestartFlags flags)
 Set the RestartFlags of the wrapper. More...
 
Wrapper< T > & setPlotLevel (PlotLevel const flag)
 Set the PlotLevel of the wrapper. More...
 
Wrapper< T > & setInputFlag (InputFlags const input)
 Set the InputFlag of the wrapper. More...
 
Wrapper< T > & setDescription (string const &description)
 Set the description string of the wrapper. More...
 
Wrapper< T > & appendDescription (string const &description)
 Add up more text to the existing description string of the wrapper. More...
 
Wrapper< T > & setRegisteringObjects (string const &objectName)
 Add a new name to the list of groups that register this wrapper. More...
 
Wrapper< T > & setRTTypeName (string_view rtTypeName)
 override the rtType to use when parsing an input value to the wrapped object. It can be useful to change the used regex to validate the input value. More...
 
- Public Member Functions inherited from geos::dataRepository::WrapperBase
virtual void addBlueprintField (conduit::Node &fields, string const &name, string const &topology, stdVector< string > const &componentNames={}) const =0
 Push the data in the wrapper into a Conduit blueprint field. More...
 
virtual void populateMCArray (conduit::Node &node, stdVector< string > const &componentNames={}) const =0
 Push the data in the wrapper into a Conduit Blueprint mcarray. More...
 
virtual std::unique_ptr< WrapperBaseaverageOverSecondDim (string const &name, Group &group) const =0
 Create a new Wrapper with values averaged over the second dimension. More...
 
 WrapperBase (string const &name, Group &parent, string const &rtTypeName)
 Constructor. More...
 
virtual ~WrapperBase ()
 Default destructor.
 
void resize ()
 Calls resize(newsize) where newsize is taken from the parent Group.
 
string const & getRTTypeName () const
 
WrapperBasesetRTTypeName (string_view rtTypeName)
 override the rtType to use when parsing an input value to the wrapped object. It can be useful to change the used regex to validate the input value. More...
 
template<bool DO_PACKING>
localIndex pack (buffer_unit_type *&buffer, bool withMetadata, bool onDevice, parallelDeviceEvents &events) const
 Concrete implementation of the packing method. More...
 
template<bool DO_PACKING>
localIndex packByIndex (buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList, bool withMetadata, bool onDevice, parallelDeviceEvents &events) const
 Concrete implementation of the packing by index method. More...
 
int sizedFromParent () const
 Check whether this wrapper is resized when its parent is resized. More...
 
WrapperBasesetSizedFromParent (int val)
 Set whether this wrapper is resized when its parent is resized. More...
 
RestartFlags getRestartFlags () const
 Get the RestartFlags of the wrapper. More...
 
WrapperBasesetRestartFlags (RestartFlags flags)
 Set the RestartFlags of the wrapper. More...
 
PlotLevel getPlotLevel () const
 Get PlotLevel for this wrapper. More...
 
WrapperBasesetPlotLevel (PlotLevel const flag)
 Set the PlotLevel of the wrapper. More...
 
string const & getName () const
 Get name of the wrapper. More...
 
string getPath () const
 Return the path to this Wrapper in the data repository. More...
 
DataContext const & getDataContext () const
 
GroupgetParent ()
 
Group const & getParent () const
 
WrapperBasesetInputFlag (InputFlags const input)
 Set the InputFlag of the wrapper. More...
 
InputFlags getInputFlag () const
 Get the InputFlag of the wrapper. More...
 
bool getSuccessfulReadFromInput () const
 Returns flag that indicates whether the contents of the wrapper have been successfully read from the input file. More...
 
WrapperBasesetDescription (string const &description)
 Set the description string of the wrapper. More...
 
WrapperBaseappendDescription (string const &description)
 Add up more text to the existing description string of the wrapper. More...
 
string const & getDescription () const
 Get the description string of the wrapper. More...
 
wrapperLimits::LimitsMode getLimitsMode () const
 Get the enforcement mode of the (optional) attribute limits. More...
 
std::set< string > const & getRegisteringObjects () const
 Get the list of names of groups that registered this wrapper. More...
 
WrapperBasesetRegisteringObjects (string const &objectName)
 Add a new name to the list of groups that register this wrapper. More...
 
virtual std::unique_ptr< WrapperBaseclone (string const &name, Group &parent)=0
 Creates a clone of *this WrapperBase. More...
 
virtual WrapperBasesetDimLabels (integer dim, Span< string const > labels)=0
 Set dimension labels for an array. More...
 

Miscellaneous

virtual std::unique_ptr< WrapperBaseclone (string const &name, Group &parent) override
 
virtual void copyWrapper (WrapperBase const &source) override
 Copies the contents of a Wrapper into *this. More...
 
virtual void copyWrapperAttributes (WrapperBase const &source) override
 Copy attributes from another wrapper. More...
 
virtual const std::type_info & getTypeId () const noexcept override
 Get the typeid of T. More...
 
virtual int numArrayDims () const override
 Return the number of dimensions of the array. More...
 
virtual localIndex numArrayComp () const override
 Return the number of components in a multidimensional array. More...
 
virtual WrappersetDimLabels (integer const dim, Span< string const > const labels) override
 
virtual Span< string const > getDimLabels (integer const dim) const override
 Get dimension labels of an array. More...
 
static Wrappercast (WrapperBase &wrapper)
 Downcast base to a typed wrapper. More...
 
static Wrapper< T > const & cast (WrapperBase const &wrapper)
 Downcast base to a const typed wrapper. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geos::dataRepository::WrapperBase
void createDataContext (xmlWrapper::xmlNode const &targetNode, xmlWrapper::xmlNodePos const &nodePos)
 Sets the m_dataContext to a DataFileContext by retrieving the attribute file line. More...
 
- Protected Attributes inherited from geos::dataRepository::WrapperBase
string m_name
 Name of the object that is being wrapped.
 
Groupm_parent
 Pointer to Group that holds this WrapperBase.
 
int m_sizedFromParent
 Integer to indicate whether or not this wrapped object should be resized when m_parent is resized.
 
RestartFlags m_restart_flags
 Flag to determine the restart behavior for this wrapped object.
 
PlotLevel m_plotLevel
 Flag to store the plotLevel.
 
InputFlags m_inputFlag
 Flag to store if this wrapped object should be read from input.
 
bool m_successfulReadFromInput
 Flag to indicate if wrapped object was successfully read from input.
 
string m_description
 A string description of the wrapped object.
 
wrapperLimits::LimitsMode m_limitsMode
 Enforcement mode of the (optional) attribute limits.
 
string m_rtTypeName
 A string regex to validate the input values string to parse for the wrapped object.
 
std::set< stringm_registeringObjects
 A vector of the names of the objects that created this Wrapper.
 
conduit::Node & m_conduitNode
 A reference to the corresponding conduit::Node.
 
std::unique_ptr< DataContextm_dataContext
 A DataContext object that can helps to contextualize this Group.
 

Detailed Description

template<typename T>
class geos::dataRepository::Wrapper< T >

Templated class to serve as a wrapper to arbitrary objects.

Template Parameters
Tis any type that is to be wrapped by Wrapper

Definition at line 58 of file Wrapper.hpp.

Constructor & Destructor Documentation

◆ Wrapper() [1/3]

template<typename T >
geos::dataRepository::Wrapper< T >::Wrapper ( string const &  name,
Group parent 
)
inlineexplicit

Constructor that creates a new instance of wrapped type.

Parameters
namename of the object
parentparent group which owns the Wrapper

Definition at line 77 of file Wrapper.hpp.

◆ Wrapper() [2/3]

template<typename T >
geos::dataRepository::Wrapper< T >::Wrapper ( string const &  name,
Group parent,
std::unique_ptr< T >  object 
)
inlineexplicit

Constructor that takes ownership of an existing object.

Parameters
namename of the object
parentparent group that owns the Wrapper
objectobject that is being wrapped by the Wrapper

Definition at line 99 of file Wrapper.hpp.

◆ Wrapper() [3/3]

template<typename T >
geos::dataRepository::Wrapper< T >::Wrapper ( string const &  name,
Group parent,
T *  object 
)
inlineexplicit

Constructor that does not take ownership of an existing object.

Parameters
namename of the object
parentparent group that owns the Wrapper
objectobject that is being wrapped by the Wrapper

Definition at line 122 of file Wrapper.hpp.

◆ ~Wrapper()

template<typename T >
virtual geos::dataRepository::Wrapper< T >::~Wrapper ( )
inlineoverridevirtualnoexcept

Default destructor.

Deletes wrapped object if the wrapper is owning

Definition at line 144 of file Wrapper.hpp.

Member Function Documentation

◆ appendDescription()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::appendDescription ( string const &  description)
inline

Add up more text to the existing description string of the wrapper.

Parameters
descriptionthe description to add to the end of the previous one.
Returns
a pointer to this wrapper

Definition at line 1045 of file Wrapper.hpp.

◆ bytesAllocated()

template<typename T >
virtual size_t geos::dataRepository::Wrapper< T >::bytesAllocated ( ) const
inlinefinaloverridevirtual
Returns
the number of bytes allocated for the wrapped object.

Implements geos::dataRepository::WrapperBase.

Definition at line 373 of file Wrapper.hpp.

◆ capacity()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::capacity ( ) const
inlineoverridevirtual
Returns
T::capacity() if it exists, other wise calls size().

Implements geos::dataRepository::WrapperBase.

Definition at line 406 of file Wrapper.hpp.

◆ cast() [1/2]

template<typename T >
static Wrapper& geos::dataRepository::Wrapper< T >::cast ( WrapperBase wrapper)
inlinestatic

Downcast base to a typed wrapper.

Parameters
wrapperthe base wrapper reference
Precondition
wrapper must be an instance of Wrapper<T>
Returns
reference to wrapper cast to a typed wrapper.

Definition at line 223 of file Wrapper.hpp.

◆ cast() [2/2]

template<typename T >
static Wrapper< T > const& geos::dataRepository::Wrapper< T >::cast ( WrapperBase const &  wrapper)
inlinestatic

Downcast base to a const typed wrapper.

Parameters
wrapperthe base wrapper reference
Precondition
wrapper must be an instance of Wrapper<T>
Returns
const reference to wrapper cast to a typed wrapper.

Definition at line 236 of file Wrapper.hpp.

◆ copy()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::copy ( localIndex const  sourceIndex,
localIndex const  destIndex 
)
inlineoverridevirtual

Calls T::copy(sourceIndex, destIndex)

Parameters
[in]sourceIndexindex to copy from
[in]destIndexindex to copy to

Implements geos::dataRepository::WrapperBase.

Definition at line 458 of file Wrapper.hpp.

◆ copyData()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::copyData ( WrapperBase const &  source)
inlineoverridevirtual

Copy the the data contained in another wrapper into this wrapper.

Parameters
sourceThe wrapper that holds the data to copy.

Implements geos::dataRepository::WrapperBase.

Definition at line 465 of file Wrapper.hpp.

◆ copyWrapper()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::copyWrapper ( WrapperBase const &  source)
inlineoverridevirtual

Copies the contents of a Wrapper into *this.

Parameters
[in]sourceThe wrapper to copy

Implements geos::dataRepository::WrapperBase.

Definition at line 193 of file Wrapper.hpp.

◆ copyWrapperAttributes()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::copyWrapperAttributes ( WrapperBase const &  source)
inlineoverridevirtual

Copy attributes from another wrapper.

Parameters
[in]sourcethe source wrapper, must wrap the same type T

Reimplemented from geos::dataRepository::WrapperBase.

Definition at line 201 of file Wrapper.hpp.

◆ elementByteSize()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::elementByteSize ( ) const
inlineoverridevirtual
Returns
the number of bytes in an object of unit size. Ie elementByteSize() * size() gives the size of memory pointed to by voidPointer().

Implements geos::dataRepository::WrapperBase.

Definition at line 370 of file Wrapper.hpp.

◆ erase()

template<typename T >
void geos::dataRepository::Wrapper< T >::erase ( std::set< localIndex > const &  indicesToErase)
inlineoverridevirtual

Calls T::erase(indicesToErase)

Parameters
[in]indicesToEraseindices to erase

Implements geos::dataRepository::WrapperBase.

Definition at line 564 of file Wrapper.hpp.

◆ getDefaultValue()

template<typename T >
template<typename U = T>
std::enable_if_t< DefaultValue< U >::has_default_value, typename DefaultValue< U >::value_type const & > geos::dataRepository::Wrapper< T >::getDefaultValue ( ) const
inline

Accessor for default value.

Returns
reference to const T

Definition at line 667 of file Wrapper.hpp.

◆ getDefaultValueString()

template<typename T >
virtual string geos::dataRepository::Wrapper< T >::getDefaultValueString ( ) const
inlineoverridevirtual

Return a string representing the default value.

Returns
A string representing the default value.

Implements geos::dataRepository::WrapperBase.

Definition at line 716 of file Wrapper.hpp.

◆ getDefaultValueStruct()

template<typename T >
template<typename U = T>
DefaultValue< T > const& geos::dataRepository::Wrapper< T >::getDefaultValueStruct ( ) const
inline

Accessor for m_default.

Returns
reference to const m_default member

Definition at line 655 of file Wrapper.hpp.

◆ getDimLabels()

template<typename T >
virtual Span< string const > geos::dataRepository::Wrapper< T >::getDimLabels ( integer const  dim) const
inlineoverridevirtual

Get dimension labels of an array.

Parameters
dimdimension index (must be less than number of array dimensions)
Returns
reference to array of labels (empty unless set via setDimLabels)

An error is raised if wrapped type is not LvArray::Array.

Implements geos::dataRepository::WrapperBase.

Definition at line 261 of file Wrapper.hpp.

◆ getHistoryMetadata()

template<typename T >
virtual HistoryMetadata geos::dataRepository::Wrapper< T >::getHistoryMetadata ( localIndex const  packCount = -1) const
inlinefinaloverridevirtual

Get a description of the wrapped data for time history collection/output.

Parameters
packCountThe number of indices from the wrapped data to collect,
Returns
HistoryMetadata about the wrapped type

Implements geos::dataRepository::WrapperBase.

Definition at line 270 of file Wrapper.hpp.

◆ getLimitsString()

template<typename T >
virtual string geos::dataRepository::Wrapper< T >::getLimitsString ( ) const
inlineoverridevirtual

Return a string representing the allowed value range.

Returns
A string of the form "[min, max]" using standard interval notation, or an empty string if no limits are set.

Implements geos::dataRepository::WrapperBase.

Definition at line 799 of file Wrapper.hpp.

◆ getMaxBound()

template<typename T >
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, std::optional< Bound< limit_value_type_t< T > > > const & > geos::dataRepository::Wrapper< T >::getMaxBound ( ) const
inline

Accessor for the maximum bound of this attribute's value.

Returns
optional containing the typed maximum value, empty if not set
Note
Only available when T is a limitable type

Definition at line 791 of file Wrapper.hpp.

◆ getMinBound()

template<typename T >
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, std::optional< Bound< limit_value_type_t< T > > > const & > geos::dataRepository::Wrapper< T >::getMinBound ( ) const
inline

Accessor for the minimum bound of this attribute's value.

Returns
optional containing the typed minimum value, empty if not set
Note
Only available when T is a limitable type

Definition at line 779 of file Wrapper.hpp.

◆ getTypeId()

template<typename T >
virtual const std::type_info& geos::dataRepository::Wrapper< T >::getTypeId ( ) const
inlineoverridevirtualnoexcept

Get the typeid of T.

Returns
type_info of the wrapped type "typeid(T)"

Implements geos::dataRepository::WrapperBase.

Definition at line 212 of file Wrapper.hpp.

◆ getTypeRegex()

template<typename T >
virtual Regex const& geos::dataRepository::Wrapper< T >::getTypeRegex ( ) const
inlineoverridevirtual
Returns
regex used to validate inputs of wrapped type

Implements geos::dataRepository::WrapperBase.

Definition at line 576 of file Wrapper.hpp.

◆ hasDefaultValue()

template<typename T >
virtual bool geos::dataRepository::Wrapper< T >::hasDefaultValue ( ) const
inlinefinaloverridevirtual

Return true iff this wrapper has a valid default value.

Returns
True iff this wrapper has a valid default value.

Implements geos::dataRepository::WrapperBase.

Definition at line 644 of file Wrapper.hpp.

◆ isPackable()

template<typename T >
virtual bool geos::dataRepository::Wrapper< T >::isPackable ( bool  onDevice) const
inlineoverridevirtual

Check whether wrapped type is can be packed into a buffer on host or device.

Parameters
[in]onDevicedetermine whether the wrapper is packable on host vs device
Returns
true if T is packable, false otherwise

Implements geos::dataRepository::WrapperBase.

Definition at line 283 of file Wrapper.hpp.

◆ loadFromConduit()

template<typename T >
bool geos::dataRepository::Wrapper< T >::loadFromConduit ( )
inlineoverridevirtual

Read the wrapped data from Conduit.

Returns
True iff the Wrapper read in data.

Implements geos::dataRepository::WrapperBase.

Definition at line 967 of file Wrapper.hpp.

◆ move()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::move ( LvArray::MemorySpace const  space,
bool const  touch 
) const
inlineoverridevirtual

Calls T::move(space, touch)

Parameters
[in]spaceA CHAI execution space to move the data into
[in]touchwhether to register a touch in target space

Implements geos::dataRepository::WrapperBase.

Definition at line 572 of file Wrapper.hpp.

◆ numArrayComp()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::numArrayComp ( ) const
inlineoverridevirtual

Return the number of components in a multidimensional array.

Returns
total size along all dimensions except first if T is an array, and 0 otherwise

Implements geos::dataRepository::WrapperBase.

Definition at line 250 of file Wrapper.hpp.

◆ numArrayDims()

template<typename T >
virtual int geos::dataRepository::Wrapper< T >::numArrayDims ( ) const
inlineoverridevirtual

Return the number of dimensions of the array.

Returns
the number of dimensions of the array if T is an array, and 0 otherwise

Implements geos::dataRepository::WrapperBase.

Definition at line 245 of file Wrapper.hpp.

◆ operator=() [1/2]

template<typename T >
Wrapper& geos::dataRepository::Wrapper< T >::operator= ( Wrapper< T > &&  source)
inline

Move Assignment Operator.

Parameters
source
Returns
*this

Definition at line 170 of file Wrapper.hpp.

◆ operator=() [2/2]

template<typename T >
Wrapper& geos::dataRepository::Wrapper< T >::operator= ( Wrapper< T > const &  source)
inline

Copy Assignment Operator.

Parameters
sourcerhs
Returns
*this

Definition at line 159 of file Wrapper.hpp.

◆ processInputFile()

template<typename T >
virtual bool geos::dataRepository::Wrapper< T >::processInputFile ( xmlWrapper< T >::xmlNode const &  targetNode,
xmlWrapper< T >::xmlNodePos const &  nodePos 
)
inlineoverridevirtual

Initialize the wrapper from the input xml node.

Parameters
targetNodethe xml node to initialize from.
nodePosthe target node position, typically obtained with xmlDocument::getNodePosition().
Returns
True if the wrapper initialized itself from the file.

Implements geos::dataRepository::WrapperBase.

Definition at line 854 of file Wrapper.hpp.

◆ reference() [1/2]

template<typename T >
T& geos::dataRepository::Wrapper< T >::reference ( )
inline

Accessor for m_data.

Returns
reference to T

Definition at line 590 of file Wrapper.hpp.

◆ reference() [2/2]

template<typename T >
GEOS_DECLTYPE_AUTO_RETURN geos::dataRepository::Wrapper< T >::reference ( ) const
inline

const Accessor for m_data

Returns
reference to T, or in the case of an Array, a reference to an ArrayView<T const> const.

Definition at line 598 of file Wrapper.hpp.

◆ referenceAsView() [1/4]

template<typename T >
template<typename _T = T, typename = std::enable_if_t< traits::HasMemberFunction_toView< _T > >>
GEOS_DECLTYPE_AUTO_RETURN geos::dataRepository::Wrapper< T >::referenceAsView ( )
inline

Provide access to wrapped object converted to a view, if possible.

Template Parameters
Udummy template parameter to enable SFINAE (do not change)
Returns
the view for wrapped object

This is used mainly for LvArray classes (arrays, etc.) that can convert themselves into views. For other types, a regular reference is returned.

Definition at line 610 of file Wrapper.hpp.

◆ referenceAsView() [2/4]

template<typename T >
template<typename _T = T, typename = std::enable_if_t< !traits::HasMemberFunction_toView< _T > >>
T& geos::dataRepository::Wrapper< T >::referenceAsView ( )
inline

Provide access to wrapped object converted to a view, if possible.

Template Parameters
Udummy template parameter to enable SFINAE (do not change)
Returns
the view for wrapped object

This is used mainly for LvArray classes (arrays, etc.) that can convert themselves into views. For other types, a regular reference is returned.

Definition at line 617 of file Wrapper.hpp.

◆ referenceAsView() [3/4]

template<typename T >
template<typename _T = T, typename = std::enable_if_t< traits::HasMemberFunction_toView< _T > >>
GEOS_DECLTYPE_AUTO_RETURN geos::dataRepository::Wrapper< T >::referenceAsView ( ) const
inline

Provide access to wrapped object converted to a view, if possible.

Template Parameters
Udummy template parameter to enable SFINAE (do not change)
Returns
the view for wrapped object

This is used mainly for LvArray classes (arrays, etc.) that can convert themselves into views. For other types, a regular reference is returned.

Definition at line 624 of file Wrapper.hpp.

◆ referenceAsView() [4/4]

template<typename T >
template<typename _T = T, typename = std::enable_if_t< !traits::HasMemberFunction_toView< _T > >>
T const& geos::dataRepository::Wrapper< T >::referenceAsView ( ) const
inline

Provide access to wrapped object converted to a view, if possible.

Template Parameters
Udummy template parameter to enable SFINAE (do not change)
Returns
the view for wrapped object

This is used mainly for LvArray classes (arrays, etc.) that can convert themselves into views. For other types, a regular reference is returned.

Definition at line 631 of file Wrapper.hpp.

◆ reserve()

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::reserve ( localIndex const  newCapacity)
inlineoverridevirtual

Calls T::reserve( newCapacity ) if it exists, otherwise a no-op.

Parameters
[in]newCapacitythe new capacity of the T.

Implements geos::dataRepository::WrapperBase.

Definition at line 399 of file Wrapper.hpp.

◆ resize() [1/2]

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::resize ( int  num_dims,
localIndex const *const  dims 
)
inlineoverridevirtual

Calls T::resize( num_dims, dims )

Parameters
[in]num_dimsnumber of dimensions in T
[in]dimspointer to the new dims

Implements geos::dataRepository::WrapperBase.

Definition at line 392 of file Wrapper.hpp.

◆ resize() [2/2]

template<typename T >
virtual void geos::dataRepository::Wrapper< T >::resize ( localIndex const  newsize)
inlineoverridevirtual

Calls T::resize(newsize) if it exists.

Parameters
[in]newsizeparameter to pass to T::resize(newsize)

Implements geos::dataRepository::WrapperBase.

Definition at line 413 of file Wrapper.hpp.

◆ setApplyDefaultValue() [1/2]

template<typename T >
template<typename U = T>
std::enable_if_t< !traits::is_array< U > && DefaultValue< U >::has_default_value, Wrapper< T > & > geos::dataRepository::Wrapper< T >::setApplyDefaultValue ( typename DefaultValue< U >::value_type const &  defaultVal)
inline

Set and apply for default value.

Parameters
defaultValthe new default value
Returns
pointer to Wrapper<T>

Definition at line 692 of file Wrapper.hpp.

◆ setApplyDefaultValue() [2/2]

template<typename T >
template<typename U = T>
std::enable_if_t< traits::is_array< U > && DefaultValue< U >::has_default_value, Wrapper< T > & > geos::dataRepository::Wrapper< T >::setApplyDefaultValue ( typename DefaultValue< U >::value_type const &  defaultVal)
inline

Set and apply for default value.

Parameters
defaultValthe new default value
Returns
pointer to Wrapper<T>

Definition at line 706 of file Wrapper.hpp.

◆ setDefaultValue()

template<typename T >
template<typename U = T>
std::enable_if_t< DefaultValue< U >::has_default_value, Wrapper< T > & > geos::dataRepository::Wrapper< T >::setDefaultValue ( typename DefaultValue< U >::value_type const &  defaultVal)
inline

Setter for default value.

Parameters
defaultValthe new default value
Returns
pointer to Wrapper<T>

Definition at line 679 of file Wrapper.hpp.

◆ setDescription()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setDescription ( string const &  description)
inline

Set the description string of the wrapper.

Parameters
descriptionthe description
Returns
a pointer to this wrapper

Definition at line 1036 of file Wrapper.hpp.

◆ setInputFlag()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setInputFlag ( InputFlags const  input)
inline

Set the InputFlag of the wrapper.

Parameters
inputthe new InputFlags value
Returns
a pointer to this wrapper

Definition at line 1027 of file Wrapper.hpp.

◆ setLimits()

template<typename T >
template<typename U = T>
std::enable_if_t< is_limitable_v< U >, Wrapper< T > & > geos::dataRepository::Wrapper< T >::setLimits ( std::optional< LimitArg< limit_value_type_t< T > > >  min,
std::optional< LimitArg< limit_value_type_t< T > > >  max,
LimitsMode  mode = LimitsMode::Error 
)
inline

Set both bounds for this attribute's value.

Parameters
minthe minimum allowed value (inclusive)
maxthe maximum allowed value (inclusive)
modethe enforcement mode
Returns
pointer to Wrapper<T>
Note
min and max are std::optional(s). Set them to std::nullopt to disable a limit.
registerWrapper( viewKeysStruct::fooString(), &m_foo )
.setLimits( 0.0, 1.0 ) // sets a minimum value of 0.0 and a maximum value of 1.0
.setLimits( 0.0, std::nullopt ) // sets a minimum value of 0.0 and no maximum value
.setLimits( inclusive( 0.0 ), std::nullopt ) // sets an inclusive (default) minimum value
.setLimits( exclusive( 0.0 ), std::nullopt ) // sets an exclusive maximum value

Definition at line 743 of file Wrapper.hpp.

◆ setName()

template<typename T >
void geos::dataRepository::Wrapper< T >::setName ( )
inline

DO_NOT_DOCUMENT.

Associate the path to this wrapper with the object being held.

Note
This calls T::setName( string ) if it exists and is a no-op if not. LvArray objects implement this method.

Definition at line 912 of file Wrapper.hpp.

◆ setPlotLevel()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setPlotLevel ( PlotLevel const  flag)
inline

Set the PlotLevel of the wrapper.

Parameters
flagthe new PlotLevel value
Returns
a pointer to this wrapper

Definition at line 1018 of file Wrapper.hpp.

◆ setRegisteringObjects()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setRegisteringObjects ( string const &  objectName)
inline

Add a new name to the list of groups that register this wrapper.

Parameters
objectNamename of the registering object
Returns
pointer to this wrapper

Definition at line 1054 of file Wrapper.hpp.

◆ setRestartFlags()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setRestartFlags ( RestartFlags  flags)
inline

Set the RestartFlags of the wrapper.

Parameters
flagsthe new RestartFlags value
Returns
a pointer to this wrapper

Definition at line 1009 of file Wrapper.hpp.

◆ setRTTypeName()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setRTTypeName ( string_view  rtTypeName)
inline

override the rtType to use when parsing an input value to the wrapped object. It can be useful to change the used regex to validate the input value.

Parameters
rtTypeNamethe name of the rtType to use (given by rtType::CustomTypes or rtType::getTypeName())
Returns
the reference to this Wrapper

Definition at line 1063 of file Wrapper.hpp.

◆ setSizedFromParent()

template<typename T >
Wrapper< T >& geos::dataRepository::Wrapper< T >::setSizedFromParent ( int  val)
inline

Set whether this wrapper is resized when its parent is resized.

Parameters
valan int that is converted into a bool
Returns
a pointer to this wrapper

Definition at line 1000 of file Wrapper.hpp.

◆ size()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::size ( ) const
inlineoverridevirtual

Calls T::size()

Returns
result of T::size()

Implements geos::dataRepository::WrapperBase.

Definition at line 388 of file Wrapper.hpp.

◆ unpack()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::unpack ( buffer_unit_type const *&  buffer,
bool  withMetadata,
bool  onDevice,
parallelDeviceEvents &  events 
)
inlinefinaloverridevirtual

Unpack the entire wrapped object from a buffer.

Parameters
[in,out]bufferthe binary buffer pointer, advanced upon completion
[in]withMetadatawhether to expect string metadata with the underlying data
[in]onDevicewhether to use device-based packing functions (buffer must be either pinned or a device pointer)
[out]eventsa collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized )
Returns
the number of buffer_unit_type units unpacked

Implements geos::dataRepository::WrapperBase.

Definition at line 299 of file Wrapper.hpp.

◆ unpackByIndex()

template<typename T >
virtual localIndex geos::dataRepository::Wrapper< T >::unpackByIndex ( buffer_unit_type const *&  buffer,
arrayView1d< localIndex const > const &  unpackIndices,
bool  withMetadata,
bool  onDevice,
parallelDeviceEvents &  events,
MPI_Op  op 
)
inlinefinaloverridevirtual

For indexable types, unpack selected indices of wrapped object from a buffer.

Parameters
[in,out]bufferthe binary buffer pointer, advanced upon completion
[in]unpackIndicesthe list of indices to pack
[in]withMetadatawhether to include metadata in the packing
[in]onDevicewhether to use device-based packing functions (buffer must be either pinned or a device pointer)
[out]eventsa collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized )
[in]opthe operation to perform while unpacking
Returns
the number of buffer_unit_type units unpacked

Implements geos::dataRepository::WrapperBase.

Definition at line 329 of file Wrapper.hpp.

◆ voidPointer()

template<typename T >
void const* geos::dataRepository::Wrapper< T >::voidPointer ( ) const
inlineoverridevirtual
Returns
a const void pointer to the data.

Implements geos::dataRepository::WrapperBase.

Definition at line 366 of file Wrapper.hpp.


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