AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Provides functions to help define how individual Table and Field variables in an input file are expected to behave. It also holds the Sidre Group to the individual Table. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.4.0/src/axom/inlet/Table.hpp>
Public Member Functions | |
Table (const std::string &name, const std::string &description, std::shared_ptr< Reader > reader, axom::sidre::Group *sidreRootGroup, bool docEnabled=true) | |
Constructor for the Table class. More... | |
virtual | ~Table ()=default |
axom::sidre::Group * | sidreGroup () |
Returns pointer to the Sidre Group class for this Table. 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< Table > | addBoolArray (const std::string &name, const std::string &description="") |
Add an array of Boolean Fields to the input deck schema. More... | |
std::shared_ptr< Table > | addIntArray (const std::string &name, const std::string &description="") |
Add an array of Integer Fields to the input deck schema. More... | |
std::shared_ptr< Table > | addDoubleArray (const std::string &name, const std::string &description="") |
Add an array of Double Fields to the input deck schema. More... | |
std::shared_ptr< Table > | addStringArray (const std::string &name, const std::string &description="") |
Add an array of String Fields to the input deck schema. More... | |
bool | getBoolArray (std::unordered_map< int, bool > &map) |
Get a boolean array represented as an unordered map from the input deck. More... | |
bool | getIntArray (std::unordered_map< int, int > &map) |
Get a int array represented as an unordered map from the input deck. More... | |
bool | getDoubleArray (std::unordered_map< int, double > &map) |
Get a double array represented as an unordered map from the input deck. More... | |
bool | getStringArray (std::unordered_map< int, std::string > &map) |
Get a string array represented as an unordered map from the input deck. More... | |
std::shared_ptr< Field > | addBool (const std::string &name, const std::string &description="") |
Add a Boolean Field to the input deck 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... | |
std::shared_ptr< Table > | required (bool isRequired) |
Set the required status of this Table. More... | |
bool | required () |
Return the required status of this Table. More... | |
std::shared_ptr< Table > | registerVerifier (std::function< bool()> lambda) |
Registers the function object that will verify this Table's contents during the verification stage. More... | |
bool | verify () |
This will be called by Inlet::verify to verify the contents of this Table and all child Tables/Fields of this Table. More... | |
bool | hasTable (const std::string &tableName) |
Return whether a Table with the given name is present in this Table's subtree. More... | |
bool | hasField (const std::string &fieldName) |
Return whether a Field with the given name is present in this Table's subtree. More... | |
std::unordered_map< std::string, std::shared_ptr< Field > > | getChildFields () |
std::unordered_map< std::string, std::shared_ptr< Table > > | getChildTables () |
std::string | name () |
std::shared_ptr< Table > | getTable (const std::string &tableName) |
Retrieves the matching Table. More... | |
std::shared_ptr< Field > | getField (const std::string &fieldName) |
Retrieves the matching Field. More... | |
Provides functions to help define how individual Table and Field variables in an input file are expected to behave. It also holds the Sidre Group to the individual Table.
|
inline |
Constructor for the Table class.
This class provides functions to define the behavior of the Table data already read and stored in the given Sidre Group. This creates the necessary Sidre Group's and views to store the given name and description.
[in] | name | Name of the Table expected in the input file |
[in] | description | Description of the Table |
[in] | reader | Shared pointer to the input file Reader class. |
[in] | sidreRootGroup | Pointer to the already created Sidre Group. |
[in] | docEnabled | Boolean indicating whether or not documentation generation is enabled for input feck this Table instance belongs to. |
References axom::sidre::Group::createGroup(), axom::sidre::Group::createViewString(), axom::sidre::Group::destroyViewAndData(), axom::sidre::Group::getGroup(), axom::sidre::Group::hasGroup(), axom::sidre::Group::hasView(), SLIC_ASSERT_MSG, and ~Table().
|
virtualdefault |
Referenced by Table().
|
inline |
Returns pointer to the Sidre Group class for this Table.
Provides access to the Sidre Group class that holds all the stored information for this Table class.
References addBoolArray(), addDoubleArray(), addIntArray(), addStringArray(), addTable(), getBoolArray(), getDoubleArray(), getIntArray(), getStringArray(), and name().
Referenced by addString().
std::shared_ptr<Table> axom::inlet::Table::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<Table> axom::inlet::Table::addBoolArray | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add an array of Boolean Fields to the input deck schema.
[in] | name | Name of the array |
[in] | description | Description of the Field |
Referenced by sidreGroup().
std::shared_ptr<Table> axom::inlet::Table::addIntArray | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add an array of Integer Fields to the input deck schema.
[in] | name | Name of the array |
[in] | description | Description of the Field |
Referenced by sidreGroup().
std::shared_ptr<Table> axom::inlet::Table::addDoubleArray | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add an array of Double Fields to the input deck schema.
[in] | name | Name of the array |
[in] | description | Description of the Field |
Referenced by sidreGroup().
std::shared_ptr<Table> axom::inlet::Table::addStringArray | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Add an array of String Fields to the input deck schema.
[in] | name | Name of the array |
[in] | description | Description of the Field |
Referenced by sidreGroup().
bool axom::inlet::Table::getBoolArray | ( | std::unordered_map< int, bool > & | map | ) |
Get a boolean array represented as an unordered map from the input deck.
[out] | map | Unordered map to be populated with array contents |
Referenced by sidreGroup().
bool axom::inlet::Table::getIntArray | ( | std::unordered_map< int, int > & | map | ) |
Get a int array represented as an unordered map from the input deck.
[out] | map | Unordered map to be populated with array contents |
Referenced by sidreGroup().
bool axom::inlet::Table::getDoubleArray | ( | std::unordered_map< int, double > & | map | ) |
Get a double array represented as an unordered map from the input deck.
[out] | map | Unordered map to be populated with array contents |
Referenced by sidreGroup().
bool axom::inlet::Table::getStringArray | ( | std::unordered_map< int, std::string > & | map | ) |
Get a string array represented as an unordered map from the input deck.
[out] | map | Unordered map to be populated with array contents |
Referenced by sidreGroup().
|
inline |
Add a Boolean Field to the input deck 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 |
|
inline |
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 |
|
inline |
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 |
|
inline |
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 |
References getChildFields(), getChildTables(), getField(), getTable(), hasField(), hasTable(), name(), registerVerifier(), required(), sidreGroup(), and verify().
std::shared_ptr<Table> axom::inlet::Table::required | ( | bool | isRequired | ) |
bool axom::inlet::Table::required | ( | ) |
Return the required status of this Table.
Return that this Table is required, or not, to be in the input file. The default behavior is to not be required.
Referenced by addString().
std::shared_ptr<Table> axom::inlet::Table::registerVerifier | ( | std::function< bool()> | lambda | ) |
Registers the function object that will verify this Table's contents during the verification stage.
[in] | The | function object that will be called by Table::verify(). |
Referenced by addString().
bool axom::inlet::Table::verify | ( | ) |
This will be called by Inlet::verify to verify the contents of this Table and all child Tables/Fields of this Table.
Referenced by addString().
bool axom::inlet::Table::hasTable | ( | const std::string & | tableName | ) |
Return whether a Table with the given name is present in this Table's subtree.
Referenced by addString().
bool axom::inlet::Table::hasField | ( | const std::string & | fieldName | ) |
Return whether a Field with the given name is present in this Table's subtree.
Referenced by addString().
std::unordered_map<std::string, std::shared_ptr<Field> > axom::inlet::Table::getChildFields | ( | ) |
Referenced by addString().
std::unordered_map<std::string, std::shared_ptr<Table> > axom::inlet::Table::getChildTables | ( | ) |
Referenced by addString().
std::string axom::inlet::Table::name | ( | ) |
Referenced by addString(), and sidreGroup().
std::shared_ptr<Table> axom::inlet::Table::getTable | ( | const std::string & | tableName | ) |
Retrieves the matching Table.
[in] | The | string indicating the target name of the Table to be searched for. |
Referenced by addString().
std::shared_ptr<Field> axom::inlet::Table::getField | ( | const std::string & | fieldName | ) |
Retrieves the matching Field.
[in] | The | string indicating the target name of the Field to be searched for. |
Referenced by addString().