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

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>

Inheritance diagram for axom::inlet::Inlet:

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< Readerreader ()
 Returns the shared pointer to the Reader class. More...
 
axom::sidre::GroupsidreGroup ()
 Returns pointer to the root Sidre Group class for all of Inlet. 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< FieldaddBool (const std::string &name, const std::string &description="")
 Add a Boolean Field to the input file 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...
 
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< TablegetGlobalTable ()
 
std::shared_ptr< TablegetTable (const std::string &name)
 Retrieves the matching Table. More...
 
std::shared_ptr< FieldgetField (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...
 

Detailed Description

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.

See also
Table Field

Constructor & Destructor Documentation

◆ Inlet()

axom::inlet::Inlet::Inlet ( std::shared_ptr< Reader reader,
axom::sidre::Group sidreRootGroup,
bool  docEnabled = true 
)
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.

Parameters
[in]readerShared pointer to the input file Reader class.
[in]sidreRootGroupPointer to the already created Sidre Group.
[in]docEnabledBoolean indicating whether documentation generation is enabled. This also toggles the storing of documentation-specific information.

References ~Inlet().

◆ ~Inlet()

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

Referenced by Inlet().

Member Function Documentation

◆ reader()

std::shared_ptr<Reader> axom::inlet::Inlet::reader ( )
inline

Returns the shared pointer to the Reader class.

Provides access to the Reader class that is used to access the input file.

Returns
Shared pointer to this instances' Reader class

◆ sidreGroup()

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

Returns
Pointer to the root Sidre Group for Inlet

References addBool(), addDouble(), addInt(), addString(), addTable(), registerDocWriter(), verify(), and writeDoc().

Referenced by hasField().

◆ addTable()

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.

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

◆ addBool()

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.

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

Referenced by sidreGroup().

◆ addDouble()

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.

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

Referenced by sidreGroup().

◆ addInt()

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.

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

Referenced by sidreGroup().

◆ addString()

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.

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

Referenced by sidreGroup().

◆ get() [1/4]

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.

Parameters
[in]nameName of the Field value to be gotten
[out]valueValue to be filled
Returns
True if the value was found in the Datastore

◆ get() [2/4]

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.

Parameters
[in]nameName of the Field value to be gotten
[out]valueValue to be filled
Returns
True if the value was found in the Datastore

◆ get() [3/4]

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.

Parameters
[in]nameName of the Field value to be gotten
[out]valueValue to be filled
Returns
True if the value was found in the Datastore

◆ get() [4/4]

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.

Parameters
[in]nameName of the Field value to be gotten
[out]valueValue to be filled
Returns
True if the value was found in the Datastore

◆ registerDocWriter()

void axom::inlet::Inlet::registerDocWriter ( std::shared_ptr< DocWriter writer)

Sets the associated DocWriter for the Inlet instance.

Sets the associated DocWriter. If the DocWriter is already set, it will be replaced by the one that was most recently set.

Parameters
[in]writerA pointer to a DocWriter object

Referenced by sidreGroup().

◆ writeDoc()

void axom::inlet::Inlet::writeDoc ( )

Writes input file documentation.

This writes the input file's documentation through the registered DocWriter.

Referenced by sidreGroup().

◆ verify()

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.

Returns
true if contents are correct and false if not.

Referenced by sidreGroup().

◆ getGlobalTable()

std::shared_ptr<Table> axom::inlet::Inlet::getGlobalTable ( )
inline
Returns
The global Table.

◆ getTable()

std::shared_ptr<Table> axom::inlet::Inlet::getTable ( const std::string &  name)
inline

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.

◆ getField()

std::shared_ptr<Field> axom::inlet::Inlet::getField ( const std::string &  name)
inline

Retrieves the matching Field.

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

◆ hasTable()

bool axom::inlet::Inlet::hasTable ( const std::string &  name)
inline

Return whether a Table with the given name is present in Inlet.

Returns
Boolean value indicating whether this Inlet contains the Table.

◆ hasField()

bool axom::inlet::Inlet::hasField ( const std::string &  name)
inline

Return whether a Field with the given name is present in Inlet.

Returns
Boolean value indicating whether this Inlet contains the Field.

References sidreGroup().


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