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/latest/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
 
Readerreader ()
 Returns the reference to the Reader class. More...
 
axom::sidre::GroupsidreGroup ()
 Returns pointer to the root Sidre Group class for all of Inlet. More...
 
ContaineraddStruct (const std::string &name, const std::string &description="")
 Add a structure to the input file schema. More...
 
VerifiableScalaraddBool (const std::string &name, const std::string &description="")
 Add a Boolean Field to the input file schema. More...
 
VerifiableScalaraddDouble (const std::string &name, const std::string &description="")
 Add a Double Field to the input file schema. More...
 
VerifiableScalaraddInt (const std::string &name, const std::string &description="")
 Add a Integer Field to the input file schema. More...
 
VerifiableScalaraddString (const std::string &name, const std::string &description="")
 Add a String Field to the input file schema. More...
 
template<typename 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...
 
ContainergetGlobalContainer ()
 
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...
 
ContaineraddStructArray (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...
 
ContaineraddStructDictionary (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...
 

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
Container Field

Constructor & Destructor Documentation

◆ Inlet() [1/4]

axom::inlet::Inlet::Inlet ( std::unique_ptr< Reader reader,
axom::sidre::Group sidreRootGroup,
bool  docEnabled = true,
bool  reconstruct = false 
)
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]readerUnique (owning) 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.
[in]reconstructWhether or not to attempt to reconstruct child Containers and Fields from the data in the sidre Group

◆ Inlet() [2/4]

axom::inlet::Inlet::Inlet ( std::unique_ptr< Reader reader,
bool  docEnabled = true,
bool  reconstruct = false 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ Inlet() [3/4]

axom::inlet::Inlet::Inlet ( const Inlet )
delete

◆ Inlet() [4/4]

axom::inlet::Inlet::Inlet ( Inlet &&  )
default

◆ ~Inlet()

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

Member Function Documentation

◆ reader()

Reader& axom::inlet::Inlet::reader ( )
inline

Returns the reference to the Reader class.

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

Returns
Reference 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

◆ addStruct()

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.

Parameters
[in]nameName of the struct expected in the input file
[in]descriptionDescription of the struct
Returns
Reference to the created struct, as a Container

◆ addBool()

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.

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

◆ addDouble()

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.

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

◆ addInt()

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.

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

◆ addString()

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.

Parameters
[in]nameName of the Container expected in the input file
[in]descriptionDescription of the Container
Returns
Reference to the created Field

◆ get()

template<typename T >
T axom::inlet::Inlet::get ( const std::string &  name) const
inline

Gets a value of arbitrary type out of the datastore.

Retrieves a value of primitive or user-defined type.

Parameters
[in]nameThe name of the subcontainer representing the root of the object
Returns
The retrieved value
Template Parameters
Thetype to retrieve
Precondition
Requires a specialization of FromInlet<T> for user-defined types
Note
This function does not indicate failure in a way that can be handled by a program - if an object of requested type does not exist at the specified location, the program will terminate

References axom::inlet::Container::get().

◆ contains()

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

Return whether a subobject with the given name is present in the datastore.

See also
Container::contains

References axom::inlet::Container::contains().

◆ isUserProvided()

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

Return whether a subobject with the given name was provided by the user.

See also
Container::isUserProvided

References axom::inlet::Container::isUserProvided().

◆ operator[]()

Proxy axom::inlet::Inlet::operator[] ( const std::string &  name) const
inline

Obtains a proxy view into the datastore.

See also
Container::operator[]

◆ write()

void axom::inlet::Inlet::write ( Writer &&  writer)

Writes input file documentation.

This runs the calling Inlet object through the writer.

Parameters
[in]writerThe writer object to use

◆ verify()

bool axom::inlet::Inlet::verify ( std::vector< VerificationError > *  errors = nullptr) const

Verifies the contents of the sidreGroup according to Inlet requirements.

Parameters
[in]errorsAn 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.

Returns
true if contents are correct and false if not.

◆ getGlobalContainer()

Container& axom::inlet::Inlet::getGlobalContainer ( )
inline
Returns
The global Container.

◆ addBoolArray()

Verifiable<Container>& axom::inlet::Inlet::addBoolArray ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an array of Boolean Fields to the input file schema.

Parameters
[in]nameName of the array
[in]descriptionDescription of the array
Returns
Reference to the created array

References axom::inlet::Container::addBoolArray().

◆ addIntArray()

Verifiable<Container>& axom::inlet::Inlet::addIntArray ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an array of Integer Fields to the input file schema.

Parameters
[in]nameName of the array
[in]descriptionDescription of the array
Returns
Reference to the created array

References axom::inlet::Container::addIntArray().

◆ addDoubleArray()

Verifiable<Container>& axom::inlet::Inlet::addDoubleArray ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an array of Double Fields to the input file schema.

Parameters
[in]nameName of the array
[in]descriptionDescription of the array
Returns
Reference to the created array

References axom::inlet::Container::addDoubleArray().

◆ addStringArray()

Verifiable<Container>& axom::inlet::Inlet::addStringArray ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an array of String Fields to the input file schema.

Parameters
[in]nameName of the array
[in]descriptionDescription of the array
Returns
Reference to the created array

References axom::inlet::Container::addStringArray().

◆ addStructArray()

Container& axom::inlet::Inlet::addStructArray ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an array of user-defined type to the input file schema.

Parameters
[in]nameName of the array
[in]descriptionDescription of the array
Returns
Reference to the created array

References axom::inlet::Container::addStructArray().

◆ addFunction()

Verifiable<Function>& axom::inlet::Inlet::addFunction ( const std::string &  name,
const FunctionTag  ret_type,
const std::vector< FunctionTag > &  arg_types,
const std::string &  description = "" 
)
inline

Get a function from the input deck.

Parameters
[in]nameName of the function
[in]ret_typeThe return type of the function
[in]arg_typesThe argument types of the function
[in]descriptionDescription of the Field
Returns
Reference to the created Function

References axom::inlet::Container::addFunction().

◆ addBoolDictionary()

Verifiable<Container>& axom::inlet::Inlet::addBoolDictionary ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add a dictionary of Boolean Fields to the input file schema.

Parameters
[in]nameName of the dict
[in]descriptionDescription of the dictionary
Returns
Reference to the created dictionary

References axom::inlet::Container::addBoolDictionary().

◆ addIntDictionary()

Verifiable<Container>& axom::inlet::Inlet::addIntDictionary ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add a dictionary of Integer Fields to the input file schema.

Parameters
[in]nameName of the dict
[in]descriptionDescription of the dictionary
Returns
Reference to the created dictionary

References axom::inlet::Container::addIntDictionary().

◆ addDoubleDictionary()

Verifiable<Container>& axom::inlet::Inlet::addDoubleDictionary ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add a dictionary of Double Fields to the input file schema.

Parameters
[in]nameName of the dict
[in]descriptionDescription of the dictionary
Returns
Reference to the created dictionary

References axom::inlet::Container::addDoubleDictionary().

◆ addStringDictionary()

Verifiable<Container>& axom::inlet::Inlet::addStringDictionary ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add a dictionary of String Fields to the input file schema.

Parameters
[in]nameName of the dict
[in]descriptionDescription of the dictionary
Returns
Reference to the created dictionary

References axom::inlet::Container::addStringDictionary().

◆ addStructDictionary()

Container& axom::inlet::Inlet::addStructDictionary ( const std::string &  name,
const std::string &  description = "" 
)
inline

Add an dictionary of user-defined type to the input file schema.

Parameters
[in]nameName of the dictionary
[in]descriptionDescription of the dictionary
Returns
Reference to the created dictionary

References axom::inlet::Container::addStructDictionary().

◆ unexpectedNames()

const std::vector<std::string>& axom::inlet::Inlet::unexpectedNames ( ) const
inline

Returns the global list of unexpected names, i.e., entries in the input file that were not added via an add* call.


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