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

Namespaces

 cpp11_compat
 
 detail
 

Classes

class  AggregateField
 A wrapper class that enables constraints on groups of Fields. More...
 
class  AggregateVerifiable
 Implementation of the Verifiable interface for aggregates of BaseTypes. More...
 
class  ConduitReader
 A Reader that is able to read variables from a file compatible with one of Conduit's protocols. More...
 
class  Container
 Provides functions to help define how individual Container and Field variables in an input file are expected to behave. It also holds the Sidre Group to the individual Container. More...
 
class  Field
 Provides functions to help define how individual field variables in an input file are expected to behave. It also holds the Sidre Group to the individual field. More...
 
class  Function
 
struct  FunctionType
 The types used to describe function signatures in the input file. More...
 
class  FunctionWrapper
 A sum type for callables with arbitrary signature. More...
 
class  Inlet
 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...
 
struct  InletVector
 A wrapper over Primal's Vector3D that also includes dimension information. More...
 
class  JSONReader
 A Reader that is able to read variables from a JSON file. More...
 
class  JSONSchemaWriter
 A Writer that is able to write the input file schema in JSON Schema format for a given input file. More...
 
class  LuaReader
 A Reader that is able to read variables from a Lua file. More...
 
class  Proxy
 Provides a uniform interface for access and conversion to primitive and user-defined types. More...
 
class  Reader
 Abstract base class defining the interface of all Reader classes. More...
 
class  SphinxWriter
 A Writer that is able write documentation in Sphinx RST format for a given input file. More...
 
class  VariantKey
 Provides a generic key type for mixed-key associative arrays/dictionaries. More...
 
class  Verifiable
 Interface for trivially verifiable objects - namely those that can be marked as required or checked with a user-provided lambda. More...
 
class  VerifiableScalar
 Basic interface for verifiable scalar values of Inlet primitive type, namely int, double, bool, or std::string - implementations can use this directly (inlet::Field) or forward to all elements of a collection (inlet::AggregrateField) More...
 
struct  VerificationError
 Information on an Inlet verification error. More...
 
class  Writer
 Abstract base class defining the interface of all Writer classes. More...
 
class  YAMLReader
 A Reader that is able to read variables from a YAML file. More...
 

Typedefs

using FunctionVariant = detail::BasicFunctionWrapper
 

Enumerations

enum  FunctionTag { FunctionTag::Vector, FunctionTag::Double, FunctionTag::Void, FunctionTag::String }
 The tags used to describe function signatures in the input file. More...
 
enum  ReaderResult { ReaderResult::Success, ReaderResult::NotFound, ReaderResult::NotHomogeneous, ReaderResult::WrongType }
 
enum  InletType {
  InletType::Nothing, InletType::Bool, InletType::String, InletType::Integer,
  InletType::Double, InletType::Object, InletType::Collection, InletType::Function
}
 Enumeration of basic types for things in inlet. More...
 

Functions

template<>
std::string Field::get< std::string > () const
 
template<>
bool Field::searchValidValues< std::string > (const axom::sidre::View &view) const
 
void setWarningFlag (axom::sidre::Group *root)
 This function is used to mark if anything went wrong during the defining phase of inlet so verify() will properly fail. More...
 
void setFlag (axom::sidre::Group &target, axom::sidre::Group &root, const std::string &flag, bool value)
 This function is used to add a flag to the Inlet object corresponding to the provided Sidre group. More...
 
bool checkFlag (const axom::sidre::Group &target, axom::sidre::Group &root, const std::string &flag)
 This function is used to determine the value of a flag for the Inlet object corresponding to the provided Sidre group. More...
 
bool verifyRequired (const axom::sidre::Group &target, const bool condition, const std::string &type, std::vector< VerificationError > *errors=nullptr)
 This function is used to verify the required-ness of the Inlet object corresponding to the provided Sidre group. More...
 
std::string appendPrefix (const std::string &prefix, const std::string &name)
 This function appends the prefix name to the ending name. More...
 
std::string removePrefix (const std::string &prefix, const std::string &name)
 This function extracts the Container name from the full name. More...
 
std::string removeBeforeDelimiter (const std::string &path, const char delim='/')
 This function extracts the substring following the last instance of the delimiting character. More...
 
std::string removeAllInstances (const std::string &target, const std::string &substr)
 This function removes all instances of the substring from the target string. More...
 
bool isCollectionGroup (const std::string &name)
 Determines whether a Container is a collection group. More...
 
void markAsStructCollection (axom::sidre::Group &target)
 Marks the sidre::Group as a "struct collection" by adding a corresponding flag to the group. More...
 
void markRetrievalStatus (axom::sidre::Group &target, const ReaderResult result)
 Adds a ReaderResult to a sidre::Group corresponding to an inlet object. More...
 
ReaderResult collectionRetrievalResult (const bool contains_other_type, const bool contains_requested_type)
 Returns the corresponding retrieval result for a collection depending on whether the collection contained any elements of the requested or of other type. More...
 
bool operator== (const InletVector &u, const InletVector &v)
 Compares two InletVectors. More...
 
std::ostream & operator<< (std::ostream &os, const InletVector &v)
 "Prints" the vector to a stream More...
 
std::ostream & operator<< (std::ostream &out, const VariantKey &key)
 Inserts the key into a stream. More...
 

Typedef Documentation

◆ FunctionVariant

Enumeration Type Documentation

◆ FunctionTag

The tags used to describe function signatures in the input file.

Note
Additions to this enumeration should be propagated to FunctionType, LuaReader and func_signature_lists defined below (the mapping from enum to types)
Vector corresponds to a vector with max dimension of three, Double corresponds to a floating-point scalar
A two-dimensional vector was intentionally excluded for simplicity as a 3D vector can be used in its place (with the third component being empty/zero)
Enumerator
Vector 
Double 
Void 
String 

◆ ReaderResult

Enumerator
Success 
NotFound 
NotHomogeneous 
WrongType 

◆ InletType

Enumeration of basic types for things in inlet.

Enumerator
Nothing 
Bool 
String 
Integer 
Double 
Object 
Collection 
Function 

Function Documentation

◆ Field::get< std::string >()

template<>
std::string axom::inlet::Field::get< std::string > ( ) const

◆ Field::searchValidValues< std::string >()

template<>
bool axom::inlet::Field::searchValidValues< std::string > ( const axom::sidre::View view) const

◆ setWarningFlag()

void axom::inlet::setWarningFlag ( axom::sidre::Group root)

This function is used to mark if anything went wrong during the defining phase of inlet so verify() will properly fail.

Parameters
[in]rootPointer to the Sidre Root Group where the warning flag will be set.

◆ setFlag()

void axom::inlet::setFlag ( axom::sidre::Group target,
axom::sidre::Group root,
const std::string &  flag,
bool  value 
)

This function is used to add a flag to the Inlet object corresponding to the provided Sidre group.

Parameters
[in]targetReference to the Sidre group to set the required status of
[in]rootReference to the Sidre Root Group where the warning flag will be set on failure
[in]flagThe name of the flag to set
[in]valueThe value of the flag

◆ checkFlag()

bool axom::inlet::checkFlag ( const axom::sidre::Group target,
axom::sidre::Group root,
const std::string &  flag 
)

This function is used to determine the value of a flag for the Inlet object corresponding to the provided Sidre group.

Parameters
[in]targetReference to the Sidre group to check the required status of
[in]rootReference to the Sidre Root Group where the warning flag will be set on failure
[in]flagThe name of the flag to check
Returns
The value of the flag

◆ verifyRequired()

bool axom::inlet::verifyRequired ( const axom::sidre::Group target,
const bool  condition,
const std::string &  type,
std::vector< VerificationError > *  errors = nullptr 
)

This function is used to verify the required-ness of the Inlet object corresponding to the provided Sidre group.

Parameters
[in]targetReference to the Sidre group to verify the required-ness of
[in]conditionThe condition that must be true if the object is required
[in]typeThe type of the object as a string, for use in the warning message
[in]errorsAn optional vector of errors to append to in the case of verification failure
Returns
False if the object was required but condition was false, True otherwise
Postcondition
If the function returns False, a warning message will be emitted

◆ appendPrefix()

std::string axom::inlet::appendPrefix ( const std::string &  prefix,
const std::string &  name 
)

This function appends the prefix name to the ending name.

Parameters
[in]Theprefix string name.
[in]Theending string name.
Returns
The appended string.

◆ removePrefix()

std::string axom::inlet::removePrefix ( const std::string &  prefix,
const std::string &  name 
)

This function extracts the Container name from the full name.

Parameters
[in]Theprefix of the name, to be removed.
[in]Thefull name.
Returns
The extracted string.

◆ removeBeforeDelimiter()

std::string axom::inlet::removeBeforeDelimiter ( const std::string &  path,
const char  delim = '/' 
)

This function extracts the substring following the last instance of the delimiting character.

Parameters
[in]pathThe path to extract from
[in]delimThe delimiting character
Returns
The extracted string.

◆ removeAllInstances()

std::string axom::inlet::removeAllInstances ( const std::string &  target,
const std::string &  substr 
)

This function removes all instances of the substring from the target string.

Parameters
[in]targetThe string to operate on
[in]substrThe string to remove
Returns
The filtered string.

◆ isCollectionGroup()

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

Determines whether a Container is a collection group.

Parameters
[in]nameThe name of the container

References axom::inlet::detail::COLLECTION_GROUP_NAME, collectionRetrievalResult(), axom::utilities::string::endsWith(), markAsStructCollection(), and markRetrievalStatus().

Referenced by axom::inlet::Container::get().

◆ markAsStructCollection()

void axom::inlet::markAsStructCollection ( axom::sidre::Group target)

Marks the sidre::Group as a "struct collection" by adding a corresponding flag to the group.

Parameters
[in,out]targetThe group to tag

Referenced by isCollectionGroup().

◆ markRetrievalStatus()

void axom::inlet::markRetrievalStatus ( axom::sidre::Group target,
const ReaderResult  result 
)

Adds a ReaderResult to a sidre::Group corresponding to an inlet object.

Parameters
[in,out]targetThe group to tag
[in]resultThe retrieval result

Referenced by isCollectionGroup().

◆ collectionRetrievalResult()

ReaderResult axom::inlet::collectionRetrievalResult ( const bool  contains_other_type,
const bool  contains_requested_type 
)

Returns the corresponding retrieval result for a collection depending on whether the collection contained any elements of the requested or of other type.

Parameters
[in]contains_other_typeWhether any collection elements were of type other than the requested type
[in]contains_requested_typeWhether the collection of requested type was not empty, i.e., if any elements of the requested type were present

Referenced by isCollectionGroup().

◆ operator==()

bool axom::inlet::operator== ( const InletVector u,
const InletVector v 
)
inline

Compares two InletVectors.

Parameters
[in]uThe comparison LHS
[in]vThe comparison RHS
Returns
Whether the two vectors are equivalent

References axom::inlet::InletVector::dim, and axom::inlet::InletVector::vec.

Referenced by axom::inlet::VariantKey::VariantKey().

◆ operator<<() [1/2]

std::ostream& axom::inlet::operator<< ( std::ostream &  os,
const InletVector v 
)
inline

"Prints" the vector to a stream

Parameters
[in,out]osThe stream to insert into
[in]vThe vector to insert into the stream

References axom::inlet::InletVector::dim.

Referenced by axom::inlet::VariantKey::VariantKey().

◆ operator<<() [2/2]

std::ostream& axom::inlet::operator<< ( std::ostream &  out,
const VariantKey key 
)

Inserts the key into a stream.

Parameters
[in,out]outThe stream to insert into
[in]keyThe key to print

Prints the active member to the stream