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.4.0/src/axom/inlet/Inlet.hpp>
Public Member Functions | |
Inlet (std::shared_ptr< Reader > reader, axom::sidre::Group *sidreRootGroup, bool docEnabled=true) | |
Constructor for the Inlet class. More... | |
virtual | ~Inlet ()=default |
std::shared_ptr< Reader > | reader () |
Returns the shared pointer to the Reader class. More... | |
axom::sidre::Group * | sidreGroup () |
Returns pointer to the root Sidre Group class for all of Inlet. More... | |
std::shared_ptr< Table > | addTable (const std::string &name, const std::string &description="") |
Add a Table to the input file schema. More... | |
std::shared_ptr< Field > | addBool (const std::string &name, const std::string &description="") |
Add a Boolean Field to the input file schema. More... | |
std::shared_ptr< Field > | addDouble (const std::string &name, const std::string &description="") |
Add a Double Field to the input file schema. More... | |
std::shared_ptr< Field > | addInt (const std::string &name, const std::string &description="") |
Add a Integer Field to the input file schema. More... | |
std::shared_ptr< Field > | addString (const std::string &name, const std::string &description="") |
Add a String Field to the input file schema. More... | |
bool | get (const std::string &name, bool &value) |
Gets a Boolean value out of the Datastore. More... | |
bool | get (const std::string &name, double &value) |
Gets a Double value out of the Datastore. More... | |
bool | get (const std::string &name, int &value) |
Gets a Integer value out of the Datastore. More... | |
bool | get (const std::string &name, std::string &value) |
Gets a String value out of the Datastore. More... | |
void | registerDocWriter (std::shared_ptr< DocWriter > writer) |
Sets the associated DocWriter for the Inlet instance. More... | |
void | writeDoc () |
Writes input file documentation. More... | |
bool | verify () |
Verifies the contents of the sidreGroup according to Inlet requirements. More... | |
std::shared_ptr< Table > | getGlobalTable () |
std::shared_ptr< Table > | getTable (const std::string &name) |
Retrieves the matching Table. More... | |
std::shared_ptr< Field > | getField (const std::string &name) |
Retrieves the matching Field. More... | |
bool | hasTable (const std::string &name) |
Return whether a Table with the given name is present in Inlet. More... | |
bool | hasField (const std::string &name) |
Return whether a Field with the given name is present in Inlet. 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 | Shared 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. |
References ~Inlet().
|
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(), addTable(), registerDocWriter(), verify(), and writeDoc().
Referenced by hasField().
std::shared_ptr<Table> axom::inlet::Inlet::addTable | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add a Table to the input file schema.
Adds a Table to the input file schema. Tables hold a varying amount Fields defined by the user. By default, it is not required unless marked with Table::required(). This creates the Sidre Group class with the given name and stores the given description.
[in] | name | Name of the Table expected in the input file |
[in] | description | Description of the Table |
Referenced by sidreGroup().
std::shared_ptr<Field> 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().
std::shared_ptr<Field> 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().
std::shared_ptr<Field> 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().
std::shared_ptr<Field> 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 Table expected in the input file |
[in] | description | Description of the Table |
Referenced by sidreGroup().
bool axom::inlet::Inlet::get | ( | const std::string & | name, |
bool & | value | ||
) |
Gets a Boolean value out of the Datastore.
Retrieves the Field value out of the DataStore. This Field may not have been actually present in the input file and will be indicted by the return value.
[in] | name | Name of the Field value to be gotten |
[out] | value | Value to be filled |
bool axom::inlet::Inlet::get | ( | const std::string & | name, |
double & | value | ||
) |
Gets a Double value out of the Datastore.
Retrieves the Field value out of the DataStore. This Field may not have been actually present in the input file and will be indicted by the return value.
[in] | name | Name of the Field value to be gotten |
[out] | value | Value to be filled |
bool axom::inlet::Inlet::get | ( | const std::string & | name, |
int & | value | ||
) |
Gets a Integer value out of the Datastore.
Retrieves the Field value out of the DataStore. This Field may not have been actually present in the input file and will be indicted by the return value.
[in] | name | Name of the Field value to be gotten |
[out] | value | Value to be filled |
bool axom::inlet::Inlet::get | ( | const std::string & | name, |
std::string & | value | ||
) |
Gets a String value out of the Datastore.
Retrieves the Field value out of the DataStore. This Field may not have been actually present in the input file and will be indicted by the return value.
[in] | name | Name of the Field value to be gotten |
[out] | value | Value to be filled |
void axom::inlet::Inlet::registerDocWriter | ( | std::shared_ptr< DocWriter > | writer | ) |
void axom::inlet::Inlet::writeDoc | ( | ) |
Writes input file documentation.
This writes the input file's documentation through the registered DocWriter.
Referenced by sidreGroup().
bool axom::inlet::Inlet::verify | ( | ) |
Verifies the contents of the sidreGroup according to Inlet requirements.
This recursively checks the correctness of each Field and Table 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 sidreGroup().
|
inline |
|
inline |
|
inline |
|
inline |
Return whether a Field with the given name is present in Inlet.
References sidreGroup().