AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
This class is the main access point for all Inlet operations from from defining the schema of the users input file to getting the values out of the Sidre DataStore. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/inlet/Inlet.hpp>
Public Member Functions | |
Inlet (std::unique_ptr< Reader > reader, axom::sidre::Group *sidreRootGroup, bool docEnabled=true, bool reconstruct=false) | |
Constructor for the Inlet class. More... | |
Inlet (const Inlet &)=delete | |
Inlet (Inlet &&)=default | |
virtual | ~Inlet ()=default |
Reader & | reader () |
Returns the reference to the Reader class. More... | |
axom::sidre::Group * | sidreGroup () |
Returns pointer to the root Sidre Group class for all of Inlet. More... | |
Container & | addStruct (const std::string &name, const std::string &description="") |
Add a structure to the input file schema. More... | |
VerifiableScalar & | addBool (const std::string &name, const std::string &description="") |
Add a Boolean Field to the input file schema. More... | |
VerifiableScalar & | addDouble (const std::string &name, const std::string &description="") |
Add a Double Field to the input file schema. More... | |
VerifiableScalar & | addInt (const std::string &name, const std::string &description="") |
Add a Integer Field to the input file schema. More... | |
VerifiableScalar & | addString (const std::string &name, const std::string &description="") |
Add a String Field to the input file schema. More... | |
template<typename T > | |
T | get (const std::string &name) const |
Gets a value of arbitrary type out of the datastore. More... | |
bool | contains (const std::string &name) const |
Return whether a subobject with the given name is present in the datastore. More... | |
Proxy | operator[] (const std::string &name) const |
Obtains a proxy view into the datastore. More... | |
void | registerWriter (std::unique_ptr< Writer > writer) |
Sets the associated Writer for the Inlet instance. More... | |
void | write () |
Writes input file documentation. More... | |
bool | verify () const |
Verifies the contents of the sidreGroup according to Inlet requirements. More... | |
Container & | getGlobalContainer () |
Verifiable< Container > & | addBoolArray (const std::string &name, const std::string &description="") |
Add an array of Boolean Fields to the input file schema. More... | |
Verifiable< Container > & | addIntArray (const std::string &name, const std::string &description="") |
Add an array of Integer Fields to the input file schema. More... | |
Verifiable< Container > & | addDoubleArray (const std::string &name, const std::string &description="") |
Add an array of Double Fields to the input file schema. More... | |
Verifiable< Container > & | addStringArray (const std::string &name, const std::string &description="") |
Add an array of String Fields to the input file schema. More... | |
Container & | addStructArray (const std::string &name, const std::string &description="") |
Add an array of user-defined type to the input file schema. More... | |
Verifiable< Function > & | addFunction (const std::string &name, const FunctionTag ret_type, const std::vector< FunctionTag > &arg_types, const std::string &description="") |
Get a function from the input deck. More... | |
Verifiable< Container > & | addBoolDictionary (const std::string &name, const std::string &description="") |
Add a dictionary of Boolean Fields to the input file schema. More... | |
Verifiable< Container > & | addIntDictionary (const std::string &name, const std::string &description="") |
Add a dictionary of Integer Fields to the input file schema. More... | |
Verifiable< Container > & | addDoubleDictionary (const std::string &name, const std::string &description="") |
Add a dictionary of Double Fields to the input file schema. More... | |
Verifiable< Container > & | addStringDictionary (const std::string &name, const std::string &description="") |
Add a dictionary of String Fields to the input file schema. More... | |
Container & | addStructDictionary (const std::string &name, const std::string &description="") |
Add an dictionary of user-defined type to the input file schema. More... | |
const std::vector< std::string > & | unexpectedNames () const |
Returns the global list of unexpected names, i.e., entries in the input file that were not added via an add* call. More... | |
This class is the main access point for all Inlet operations from from defining the schema of the users input file to getting the values out of the Sidre DataStore.
|
inline |
Constructor for the Inlet class.
Creates an Inlet class that can then be used with the given Reader and will store data under the given Sidre Group.
[in] | reader | Unique (owning) pointer to the input file Reader class. |
[in] | sidreRootGroup | Pointer to the already created Sidre Group. |
[in] | docEnabled | Boolean indicating whether documentation generation is enabled. This also toggles the storing of documentation-specific information. |
[in] | reconstruct | Whether or not to attempt to reconstruct child Containers and Fields from the data in the sidre Group |
References ~Inlet().
|
delete |
|
default |
|
virtualdefault |
Referenced by Inlet().
|
inline |
|
inline |
Returns pointer to the root Sidre Group class for all of Inlet.
Provides access to the Sidre Group class that holds all the stored information for all of Inlet.
References addBool(), addDouble(), addInt(), addString(), and addStruct().
Container& axom::inlet::Inlet::addStruct | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a structure to the input file schema.
Adds a structure/record to the input file schema. Structures can contain fields and/or substructures. By default, it is not required unless marked with Container::isRequired(). This creates the Sidre Group class with the given name and stores the given description.
[in] | name | Name of the struct expected in the input file |
[in] | description | Description of the struct |
Referenced by sidreGroup().
VerifiableScalar& axom::inlet::Inlet::addBool | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a Boolean Field to the input file schema.
Adds a Boolean Field to the input file schema. It may or may not be required to be present in the input file. This creates the Sidre Group class with the given name and stores the given description. If present in the input file the value is read and stored in the datastore.
[in] | name | Name of the Field expected in the input file |
[in] | description | Description of the Field |
Referenced by sidreGroup().
VerifiableScalar& axom::inlet::Inlet::addDouble | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a Double Field to the input file schema.
Adds a Double Field to the input file schema. It may or may not be required to be present in the input file. This creates the Sidre Group class with the given name and stores the given description. If present in the input file the value is read and stored in the datastore.
[in] | name | Name of the Field expected in the input file |
[in] | description | Description of the Field |
Referenced by sidreGroup().
VerifiableScalar& axom::inlet::Inlet::addInt | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a Integer Field to the input file schema.
Adds a Integer Field to the input file schema. It may or may not be required to be present in the input file. This creates the Sidre Group class with the given name and stores the given description. If present in the input file the value is read and stored in the datastore.
[in] | name | Name of the Field expected in the input file |
[in] | description | Description of the Field |
Referenced by sidreGroup().
VerifiableScalar& axom::inlet::Inlet::addString | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a String Field to the input file schema.
Adds a String Field to the input file schema. It may or may not be required to be present in the input file. This creates the Sidre Group class with the given name and stores the given description. If present in the input file the value is read and stored in the datastore.
[in] | name | Name of the Container expected in the input file |
[in] | description | Description of the Container |
Referenced by sidreGroup().
|
inline |
Gets a value of arbitrary type out of the datastore.
Retrieves a value of primitive or user-defined type.
[in] | name | The name of the subcontainer representing the root of the object |
The | type to retrieve |
References axom::inlet::Container::get().
|
inline |
Return whether a subobject with the given name is present in the datastore.
References axom::inlet::Container::contains().
|
inline |
Obtains a proxy view into the datastore.
References registerWriter(), verify(), and write().
void axom::inlet::Inlet::registerWriter | ( | std::unique_ptr< Writer > | writer | ) |
void axom::inlet::Inlet::write | ( | ) |
Writes input file documentation.
This runs the calling Inlet object through the registered Writer.
Referenced by operator[]().
bool axom::inlet::Inlet::verify | ( | ) | const |
Verifies the contents of the sidreGroup according to Inlet requirements.
This recursively checks the correctness of each Field and Container in the Sidre Group: ensuring that required Fields are specified, each Field's value and default value are within the specified range or are equal to a valid value, and types are consistent. Also ensures that the registered verification functions hold true.
Referenced by operator[]().
|
inline |
Add an array of Boolean Fields to the input file schema.
[in] | name | Name of the array |
[in] | description | Description of the array |
References axom::inlet::Container::addBoolArray().
|
inline |
Add an array of Integer Fields to the input file schema.
[in] | name | Name of the array |
[in] | description | Description of the array |
References axom::inlet::Container::addIntArray().
|
inline |
Add an array of Double Fields to the input file schema.
[in] | name | Name of the array |
[in] | description | Description of the array |
References axom::inlet::Container::addDoubleArray().
|
inline |
Add an array of String Fields to the input file schema.
[in] | name | Name of the array |
[in] | description | Description of the array |
References axom::inlet::Container::addStringArray().
|
inline |
Add an array of user-defined type to the input file schema.
[in] | name | Name of the array |
[in] | description | Description of the array |
References axom::inlet::Container::addStructArray().
|
inline |
Get a function from the input deck.
[in] | name | Name of the function |
[in] | ret_type | The return type of the function |
[in] | arg_types | The argument types of the function |
[in] | description | Description of the Field |
References axom::inlet::Container::addFunction().
|
inline |
Add a dictionary of Boolean Fields to the input file schema.
[in] | name | Name of the dict |
[in] | description | Description of the dictionary |
References axom::inlet::Container::addBoolDictionary().
|
inline |
Add a dictionary of Integer Fields to the input file schema.
[in] | name | Name of the dict |
[in] | description | Description of the dictionary |
References axom::inlet::Container::addIntDictionary().
|
inline |
Add a dictionary of Double Fields to the input file schema.
[in] | name | Name of the dict |
[in] | description | Description of the dictionary |
References axom::inlet::Container::addDoubleDictionary().
|
inline |
Add a dictionary of String Fields to the input file schema.
[in] | name | Name of the dict |
[in] | description | Description of the dictionary |
References axom::inlet::Container::addStringDictionary().
|
inline |
Add an dictionary of user-defined type to the input file schema.
[in] | name | Name of the dictionary |
[in] | description | Description of the dictionary |
References axom::inlet::Container::addStructDictionary().
|
inline |
Returns the global list of unexpected names, i.e., entries in the input file that were not added via an add* call.