AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::inlet::Field Class Reference

Provides functions to help define how individual field variables in an input file are expected to behave. It also holds the Sidre Group to the individual field. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.4.0/src/axom/inlet/Field.hpp>

Inherits enable_shared_from_this< Field >.

Public Member Functions

 Field (axom::sidre::Group *sidreGroup, axom::sidre::Group *root, axom::sidre::DataTypeId type=axom::sidre::DataTypeId::NO_TYPE_ID, bool docEnabled=true)
 Constructor for the Field class. More...
 
axom::sidre::GroupsidreGroup ()
 Returns pointer to the Sidre Group class for this Field. More...
 
std::shared_ptr< Fieldrequired (bool isRequired)
 Set the required status of this Field. More...
 
bool required ()
 Return the required status of this Field. More...
 
std::shared_ptr< FielddefaultValue (const std::string &value)
 Set the default value of this Field. More...
 
std::shared_ptr< FielddefaultValue (const char *value)
 Set the default value of this Field. More...
 
std::shared_ptr< FielddefaultValue (bool value)
 Set the default value of this Field. More...
 
std::shared_ptr< FielddefaultValue (int value)
 Set the default value of this Field. More...
 
std::shared_ptr< FielddefaultValue (double value)
 Set the default value of this Field. More...
 
std::shared_ptr< Fieldrange (double startVal, double endVal)
 Set the range of this Field. More...
 
std::shared_ptr< Fieldrange (int startVal, int endVal)
 Set the range of this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::vector< int > &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::vector< double > &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::vector< std::string > &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::initializer_list< const char *> &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::initializer_list< int > &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldvalidValues (const std::initializer_list< double > &set)
 Set the valid values for this Field. More...
 
std::shared_ptr< FieldregisterVerifier (std::function< bool()> lambda)
 Registers the function object that will verify this Field's contents during the verification stage. More...
 
bool verify ()
 Called by Inlet::verify to verify the contents of this Field. More...
 
std::string name ()
 

Detailed Description

Provides functions to help define how individual field variables in an input file are expected to behave. It also holds the Sidre Group to the individual field.

See also
Inlet Table

Constructor & Destructor Documentation

◆ Field()

axom::inlet::Field::Field ( axom::sidre::Group sidreGroup,
axom::sidre::Group root,
axom::sidre::DataTypeId  type = axom::sidre::DataTypeId::NO_TYPE_ID,
bool  docEnabled = true 
)
inline

Constructor for the Field class.

This class provides functions to define the behavior of the Field data already read and stored in the given Sidre Group.

Parameters
[in]sidreGroupPointer to the already created Sidre Group.
[in]rootPointer to the sidreRootGroup containing this Field
[in]typeFieldType specifying the data type of this Field instance. Default is FieldType::UNSPECIFIED.
[in]docEnabledBoolean indicating whether or not documentation generation is enabled for Input file this Field instance belongs to.

Member Function Documentation

◆ sidreGroup()

axom::sidre::Group* axom::inlet::Field::sidreGroup ( )
inline

Returns pointer to the Sidre Group class for this Field.

Provides access to the Sidre Group class that holds all the stored information for this Field class.

Returns
Pointer to the Sidre Group class for this Field

References defaultValue(), name(), axom::sidre::NO_TYPE_ID, range(), registerVerifier(), required(), validValues(), and verify().

◆ required() [1/2]

std::shared_ptr<Field> axom::inlet::Field::required ( bool  isRequired)

Set the required status of this Field.

Set whether this Field is required, or not, to be in the input file. The default behavior is to not be required.

Parameters
[in]isRequiredBoolean value of whether Field is required
Returns
Shared pointer to this instance of this class

◆ required() [2/2]

bool axom::inlet::Field::required ( )

Return the required status of this Field.

Return that this Field is required, or not, to be in the input file. The default behavior is to not be required.

Returns
Boolean value of whether this Field is required

Referenced by sidreGroup().

◆ defaultValue() [1/5]

std::shared_ptr<Field> axom::inlet::Field::defaultValue ( const std::string &  value)

Set the default value of this Field.

Set the default value for the Field in the input file.

Parameters
[in]valueThe default string value
Returns
Shared pointer to this Field instance

Referenced by sidreGroup().

◆ defaultValue() [2/5]

std::shared_ptr<Field> axom::inlet::Field::defaultValue ( const char *  value)

Set the default value of this Field.

Set the default value for the Field in the input file.

Parameters
[in]valueThe default string value
Returns
Shared pointer to this Field instance

◆ defaultValue() [3/5]

std::shared_ptr<Field> axom::inlet::Field::defaultValue ( bool  value)

Set the default value of this Field.

Set the default value for the Field in the input file.

Parameters
[in]valueThe default boolean value
Returns
Shared pointer to this Field instance

◆ defaultValue() [4/5]

std::shared_ptr<Field> axom::inlet::Field::defaultValue ( int  value)

Set the default value of this Field.

Set the default value for the Field in the input file.

Parameters
[in]valueThe default integer value
Returns
Shared pointer to this Field instance

◆ defaultValue() [5/5]

std::shared_ptr<Field> axom::inlet::Field::defaultValue ( double  value)

Set the default value of this Field.

Set the default value for the Field in the input file.

Parameters
[in]valueThe default double value
Returns
Shared pointer to this Field instance

◆ range() [1/2]

std::shared_ptr<Field> axom::inlet::Field::range ( double  startVal,
double  endVal 
)

Set the range of this Field.

Set the continuous range for the Field in the input file.

Parameters
[in]startValThe start of the range
[in]endValThe end of the range
Returns
Shared pointer to this Field instance

Referenced by sidreGroup().

◆ range() [2/2]

std::shared_ptr<Field> axom::inlet::Field::range ( int  startVal,
int  endVal 
)

Set the range of this Field.

Set the continuous range for the Field in the input file.

Parameters
[in]startValThe start of the range
[in]endValThe end of the range
Returns
Shared pointer to this Field instance

◆ validValues() [1/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::vector< int > &  set)

Set the valid values for this Field.

Parameters
[in]setAn vector containing the set of allowed integer values
Returns
Shared pointer to this Field instance

Referenced by sidreGroup().

◆ validValues() [2/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::vector< double > &  set)

Set the valid values for this Field.

Parameters
[in]setAn vector containing the set of allowed double values
Returns
Shared pointer to this Field instance

◆ validValues() [3/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::vector< std::string > &  set)

Set the valid values for this Field.

Parameters
[in]setA vector containing the set of allowed string values
Returns
Shared pointer to this Field instance

◆ validValues() [4/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::initializer_list< const char *> &  set)

Set the valid values for this Field.

Parameters
[in]setAn initializer list containing the set of allowed C-string values
Returns
Shared pointer to this Field instance

◆ validValues() [5/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::initializer_list< int > &  set)

Set the valid values for this Field.

Parameters
[in]setAn initializer list containing the valid integer values
Returns
Shared pointer to this Field instance

◆ validValues() [6/6]

std::shared_ptr<Field> axom::inlet::Field::validValues ( const std::initializer_list< double > &  set)

Set the valid values for this Field.

Parameters
[in]setAn initializer list containing the valid double values
Returns
Shared pointer to this Field instance

◆ registerVerifier()

std::shared_ptr<Field> axom::inlet::Field::registerVerifier ( std::function< bool()>  lambda)

Registers the function object that will verify this Field's contents during the verification stage.

Parameters
[in]Thefunction object that will be called by Field::verify().

Referenced by sidreGroup().

◆ verify()

bool axom::inlet::Field::verify ( )

Called by Inlet::verify to verify the contents of this Field.

Referenced by sidreGroup().

◆ name()

std::string axom::inlet::Field::name ( )
Returns
The full name for this Field.

Referenced by sidreGroup().


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