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

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>

Inheritance diagram for axom::inlet::Table:

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::GroupsidreGroup ()
 Returns pointer to the Sidre Group class for this Table. More...
 
std::shared_ptr< TableaddTable (const std::string &name, const std::string &description="")
 Add a Table to the input file schema. More...
 
std::shared_ptr< TableaddBoolArray (const std::string &name, const std::string &description="")
 Add an array of Boolean Fields to the input deck schema. More...
 
std::shared_ptr< TableaddIntArray (const std::string &name, const std::string &description="")
 Add an array of Integer Fields to the input deck schema. More...
 
std::shared_ptr< TableaddDoubleArray (const std::string &name, const std::string &description="")
 Add an array of Double Fields to the input deck schema. More...
 
std::shared_ptr< TableaddStringArray (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< FieldaddBool (const std::string &name, const std::string &description="")
 Add a Boolean Field to the input deck schema. More...
 
std::shared_ptr< FieldaddDouble (const std::string &name, const std::string &description="")
 Add a Double Field to the input file schema. More...
 
std::shared_ptr< FieldaddInt (const std::string &name, const std::string &description="")
 Add a Integer Field to the input file schema. More...
 
std::shared_ptr< FieldaddString (const std::string &name, const std::string &description="")
 Add a String Field to the input file schema. More...
 
std::shared_ptr< Tablerequired (bool isRequired)
 Set the required status of this Table. More...
 
bool required ()
 Return the required status of this Table. More...
 
std::shared_ptr< TableregisterVerifier (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< TablegetTable (const std::string &tableName)
 Retrieves the matching Table. More...
 
std::shared_ptr< FieldgetField (const std::string &fieldName)
 Retrieves the matching Field. More...
 

Detailed Description

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.

See also
Inlet Field

Constructor & Destructor Documentation

◆ Table()

axom::inlet::Table::Table ( const std::string &  name,
const std::string &  description,
std::shared_ptr< Reader reader,
axom::sidre::Group sidreRootGroup,
bool  docEnabled = true 
)
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.

Parameters
[in]nameName of the Table expected in the input file
[in]descriptionDescription of the Table
[in]readerShared pointer to the input file Reader class.
[in]sidreRootGroupPointer to the already created Sidre Group.
[in]docEnabledBoolean 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().

◆ ~Table()

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

Referenced by Table().

Member Function Documentation

◆ sidreGroup()

axom::sidre::Group* axom::inlet::Table::sidreGroup ( )
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.

Returns
Pointer to the Sidre Group for this Table

References addBoolArray(), addDoubleArray(), addIntArray(), addStringArray(), addTable(), getBoolArray(), getDoubleArray(), getIntArray(), getStringArray(), and name().

Referenced by addString().

◆ addTable()

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.

Parameters
[in]nameName of the Table expected in the input file
[in]descriptionDescription of the Table
Returns
Shared pointer to the created Table

Referenced by sidreGroup().

◆ addBoolArray()

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.

Parameters
[in]nameName of the array
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

Referenced by sidreGroup().

◆ addIntArray()

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.

Parameters
[in]nameName of the array
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

Referenced by sidreGroup().

◆ addDoubleArray()

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.

Parameters
[in]nameName of the array
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

Referenced by sidreGroup().

◆ addStringArray()

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.

Parameters
[in]nameName of the array
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

Referenced by sidreGroup().

◆ getBoolArray()

bool axom::inlet::Table::getBoolArray ( std::unordered_map< int, bool > &  map)

Get a boolean array represented as an unordered map from the input deck.

Parameters
[out]mapUnordered map to be populated with array contents
Returns
Whether or not the array was found

Referenced by sidreGroup().

◆ getIntArray()

bool axom::inlet::Table::getIntArray ( std::unordered_map< int, int > &  map)

Get a int array represented as an unordered map from the input deck.

Parameters
[out]mapUnordered map to be populated with array contents
Returns
Whether or not the array was found

Referenced by sidreGroup().

◆ getDoubleArray()

bool axom::inlet::Table::getDoubleArray ( std::unordered_map< int, double > &  map)

Get a double array represented as an unordered map from the input deck.

Parameters
[out]mapUnordered map to be populated with array contents
Returns
Whether or not the array was found

Referenced by sidreGroup().

◆ getStringArray()

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.

Parameters
[out]mapUnordered map to be populated with array contents
Returns
Whether or not the array was found

Referenced by sidreGroup().

◆ addBool()

std::shared_ptr<Field> axom::inlet::Table::addBool ( const std::string &  name,
const std::string &  description = "" 
)
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.

Parameters
[in]nameName of the Field expected in the input file
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

◆ addDouble()

std::shared_ptr<Field> axom::inlet::Table::addDouble ( const std::string &  name,
const std::string &  description = "" 
)
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.

Parameters
[in]nameName of the Field expected in the input file
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

◆ addInt()

std::shared_ptr<Field> axom::inlet::Table::addInt ( const std::string &  name,
const std::string &  description = "" 
)
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.

Parameters
[in]nameName of the Field expected in the input file
[in]descriptionDescription of the Field
Returns
Shared pointer to the created Field

◆ addString()

std::shared_ptr<Field> axom::inlet::Table::addString ( const std::string &  name,
const std::string &  description = "" 
)
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.

Parameters
[in]nameName of the Table expected in the input file
[in]descriptionDescription of the Table
Returns
Shared pointer to the created Field

References getChildFields(), getChildTables(), getField(), getTable(), hasField(), hasTable(), name(), registerVerifier(), required(), sidreGroup(), and verify().

◆ required() [1/2]

std::shared_ptr<Table> axom::inlet::Table::required ( bool  isRequired)

Set the required status of this Table.

Set whether this Table is required, or not, to be in the input file. The default behavior is to not be required.

Parameters
[in]isRequiredBoolean value of whether Table is required
Returns
Shared pointer to this instance of Table

◆ required() [2/2]

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.

Returns
Boolean value of whether this Table is required

Referenced by addString().

◆ registerVerifier()

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.

Parameters
[in]Thefunction object that will be called by Table::verify().

Referenced by addString().

◆ verify()

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().

◆ hasTable()

bool axom::inlet::Table::hasTable ( const std::string &  tableName)

Return whether a Table with the given name is present in this Table's subtree.

Returns
Boolean value indicating whether this Table's subtree contains this Table.

Referenced by addString().

◆ hasField()

bool axom::inlet::Table::hasField ( const std::string &  fieldName)

Return whether a Field with the given name is present in this Table's subtree.

Returns
Boolean value indicating whether this Table's subtree contains this Field.

Referenced by addString().

◆ getChildFields()

std::unordered_map<std::string, std::shared_ptr<Field> > axom::inlet::Table::getChildFields ( )
Returns
An unordered map from Field names to the child Field pointers for this Table.

Referenced by addString().

◆ getChildTables()

std::unordered_map<std::string, std::shared_ptr<Table> > axom::inlet::Table::getChildTables ( )
Returns
An unordered map from Table names to the child Table pointers for this Table.

Referenced by addString().

◆ name()

std::string axom::inlet::Table::name ( )
Returns
The full name of this Table.

Referenced by addString(), and sidreGroup().

◆ getTable()

std::shared_ptr<Table> axom::inlet::Table::getTable ( const std::string &  tableName)

Retrieves the matching Table.

Parameters
[in]Thestring indicating the target name of the Table to be searched for.
Returns
The Table matching the target name. If no such Table is found, a nullptr is returned.

Referenced by addString().

◆ getField()

std::shared_ptr<Field> axom::inlet::Table::getField ( const std::string &  fieldName)

Retrieves the matching Field.

Parameters
[in]Thestring indicating the target name of the Field to be searched for.
Returns
The Field matching the target name. If no such Field is found, a nullptr is returned.

Referenced by addString().


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