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

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.5.0/src/axom/inlet/Field.hpp>

Inheritance diagram for axom::inlet::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...
 
virtual ~Field ()=default
 
const axom::sidre::GroupsidreGroup () const
 Returns pointer to the Sidre Group class for this Field. More...
 
Fieldrequired (bool isRequired=true)
 Set the required status of this Field. More...
 
bool isRequired () const
 Return the required status of this Field. More...
 
FielddefaultValue (const std::string &value)
 Set the default value of this Field. More...
 
FielddefaultValue (const char *value)
 Set the default value of this Field. More...
 
FielddefaultValue (bool value)
 Set the default value of this Field. More...
 
FielddefaultValue (int value)
 Set the default value of this Field. More...
 
FielddefaultValue (double value)
 Set the default value of this Field. More...
 
Fieldrange (double startVal, double endVal)
 Set the range of this Field. More...
 
Fieldrange (int startVal, int endVal)
 Set the range of this Field. More...
 
FieldvalidValues (const std::vector< int > &set)
 Set the valid values for this Field. More...
 
FieldvalidValues (const std::vector< double > &set)
 Set the valid values for this Field. More...
 
FieldvalidValues (const std::vector< std::string > &set)
 Set the valid values for this Field. More...
 
FieldvalidValues (const std::initializer_list< const char *> &set)
 Set the valid values for this Field. More...
 
FieldvalidValues (const std::initializer_list< int > &set)
 Set the valid values for this Field. More...
 
FieldvalidValues (const std::initializer_list< double > &set)
 Set the valid values for this Field. More...
 
FieldregisterVerifier (std::function< bool(const Field &)> lambda)
 Registers the function object that will verify this Field's contents during the verification stage. More...
 
bool verify () const
 Called by Inlet::verify to verify the contents of this Field. More...
 
std::string name () const
 
template<typename T >
get () const
 Returns a value of primitive type. More...
 
InletType type () const
 Returns the type of the stored value. More...
 
bool exists () const
 Returns whether a value for the Field exists, i.e., if a value was provided in the input file or if a default was provided. More...
 
bool isUserProvided () const
 Returns whether a value was provided in the input file. More...
 
template<>
bool get () const
 
template<>
int get () const
 
template<>
double get () const
 
virtual VerifiableScalarregisterVerifier (std::function< bool(const axom::inlet::Field &)> lambda)=0
 Registers the function object that will verify this object's contents during the verification stage. More...
 

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 Container

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.

References ~Field().

◆ ~Field()

virtual axom::inlet::Field::~Field ( )
virtualdefault

Referenced by Field().

Member Function Documentation

◆ sidreGroup()

const axom::sidre::Group* axom::inlet::Field::sidreGroup ( ) const
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(), exists(), isRequired(), isUserProvided(), name(), axom::sidre::NO_TYPE_ID, range(), registerVerifier(), required(), type(), validValues(), and verify().

◆ required()

Field& axom::inlet::Field::required ( bool  isRequired = true)
virtual

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
Reference to this instance of this class

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ isRequired()

bool axom::inlet::Field::isRequired ( ) const
virtual

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

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ defaultValue() [1/5]

Field& axom::inlet::Field::defaultValue ( const std::string &  value)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ defaultValue() [2/5]

Field& axom::inlet::Field::defaultValue ( const char *  value)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

◆ defaultValue() [3/5]

Field& axom::inlet::Field::defaultValue ( bool  value)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

◆ defaultValue() [4/5]

Field& axom::inlet::Field::defaultValue ( int  value)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

◆ defaultValue() [5/5]

Field& axom::inlet::Field::defaultValue ( double  value)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

◆ range() [1/2]

Field& axom::inlet::Field::range ( double  startVal,
double  endVal 
)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ range() [2/2]

Field& axom::inlet::Field::range ( int  startVal,
int  endVal 
)
virtual

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
Reference to this Field instance

Implements axom::inlet::VerifiableScalar.

◆ validValues() [1/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ validValues() [2/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

◆ validValues() [3/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

◆ validValues() [4/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

◆ validValues() [5/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

◆ validValues() [6/6]

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

Set the valid values for this Field.

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

Implements axom::inlet::VerifiableScalar.

◆ registerVerifier() [1/2]

Field& axom::inlet::Field::registerVerifier ( std::function< bool(const Field &)>  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 axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ verify()

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

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

Implements axom::inlet::VerifiableScalar.

Referenced by axom::inlet::AggregateField::AggregateField(), and sidreGroup().

◆ name()

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

Referenced by sidreGroup().

◆ get() [1/4]

template<typename T >
T axom::inlet::Field::get ( ) const

Returns a value of primitive type.

Returns
The value
Template Parameters
TThe type to retrieve

Referenced by axom::inlet::Proxy::get().

◆ type()

InletType axom::inlet::Field::type ( ) const

Returns the type of the stored value.

Returns
The type
See also
InletType

Referenced by sidreGroup().

◆ exists()

bool axom::inlet::Field::exists ( ) const

Returns whether a value for the Field exists, i.e., if a value was provided in the input file or if a default was provided.

Referenced by sidreGroup().

◆ isUserProvided()

bool axom::inlet::Field::isUserProvided ( ) const

Returns whether a value was provided in the input file.

Referenced by sidreGroup().

◆ get() [2/4]

template<>
bool axom::inlet::Field::get ( ) const

◆ get() [3/4]

template<>
int axom::inlet::Field::get ( ) const

◆ get() [4/4]

template<>
double axom::inlet::Field::get ( ) const

◆ registerVerifier() [2/2]

virtual VerifiableScalar& axom::inlet::VerifiableScalar::registerVerifier ( std::function< bool(const axom::inlet::Field &)>  lambda)
pure virtualinherited

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

Parameters
[in]Thefunction object.

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