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/main/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 (std::unique_ptr< Reader > reader, bool docEnabled=true, bool reconstruct=false) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 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... | |
bool | isUserProvided (const std::string &name) const |
Return whether a subobject with the given name was provided by the user. More... | |
Proxy | operator[] (const std::string &name) const |
Obtains a proxy view into the datastore. More... | |
void | write (Writer &&writer) |
Writes input file documentation. More... | |
bool | verify (std::vector< VerificationError > *errors=nullptr) 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 |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
delete |
|
default |
|
virtualdefault |
|
inline |
|
inline |
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 |
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 |
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 |
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 |
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 |
|
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 |
Return whether a subobject with the given name was provided by the user.
References axom::inlet::Container::isUserProvided().
|
inline |
Obtains a proxy view into the datastore.
void axom::inlet::Inlet::write | ( | Writer && | writer | ) |
Writes input file documentation.
This runs the calling Inlet object through the writer.
[in] | writer | The writer object to use |
bool axom::inlet::Inlet::verify | ( | std::vector< VerificationError > * | errors = nullptr | ) | const |
Verifies the contents of the sidreGroup according to Inlet requirements.
[in] | errors | An optional vector of errors to append to in the case of verification failure |
Ownership is not taken of errors, the raw pointer is only used for its optional reference semantics, as opposed to something like std::optional<std::reference_wrapper<T>>
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.
|
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.