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

A Reader that is able to read variables from a YAML file. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/inlet/YAMLReader.hpp>

Inheritance diagram for axom::inlet::YAMLReader:

Public Member Functions

 YAMLReader ()
 
bool parseFile (const std::string &filePath) override
 Parses the given input file. More...
 
bool parseString (const std::string &stringToRead) override
 Parses the given string. More...
 
ReaderResult getBool (const std::string &id, bool &value) override
 Return a boolean out of the input file. More...
 
ReaderResult getDouble (const std::string &id, double &value) override
 Return a double out of the input file. More...
 
ReaderResult getInt (const std::string &id, int &value) override
 Return a int out of the input file. More...
 
ReaderResult getString (const std::string &id, std::string &value) override
 Return a string out of the input file. More...
 
ReaderResult getIntMap (const std::string &id, std::unordered_map< int, int > &values) override
 Get an index-integer mapping for the given array. More...
 
ReaderResult getIntMap (const std::string &id, std::unordered_map< VariantKey, int > &values) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ReaderResult getDoubleMap (const std::string &id, std::unordered_map< int, double > &values) override
 Get an index-double mapping for the given array. More...
 
ReaderResult getDoubleMap (const std::string &id, std::unordered_map< VariantKey, double > &values) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ReaderResult getBoolMap (const std::string &id, std::unordered_map< int, bool > &values) override
 Get an index-bool mapping for the given array. More...
 
ReaderResult getBoolMap (const std::string &id, std::unordered_map< VariantKey, bool > &values) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ReaderResult getStringMap (const std::string &id, std::unordered_map< int, std::string > &values) override
 Get an index-string mapping for the given Lua array. More...
 
ReaderResult getStringMap (const std::string &id, std::unordered_map< VariantKey, std::string > &values) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ReaderResult getIndices (const std::string &id, std::vector< int > &indices) override
 Get the list of indices for a collection. More...
 
ReaderResult getIndices (const std::string &id, std::vector< VariantKey > &indices) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
FunctionVariant getFunction (const std::string &id, const FunctionTag ret_type, const std::vector< FunctionTag > &arg_types) override
 Get a function from the input file. More...
 
std::vector< std::string > getAllNames () override
 Retrieves all paths present in the input file. More...
 

Static Public Attributes

static const int baseIndex = 0
 The base index for Conduit arrays. More...
 

Detailed Description

A Reader that is able to read variables from a YAML file.

See also
Reader

Constructor & Destructor Documentation

◆ YAMLReader()

axom::inlet::YAMLReader::YAMLReader ( )
inline

Member Function Documentation

◆ parseFile()

bool axom::inlet::ConduitReader::parseFile ( const std::string &  filePath)
overridevirtualinherited

Parses the given input file.

This performs any setup work and parses the given input file. It is required that this is called before using the Reader and overrides any state that was previously there.

Parameters
[in]filePathThe Input file to be read
Returns
true if the input file was able to be parsed

Implements axom::inlet::Reader.

◆ parseString()

bool axom::inlet::ConduitReader::parseString ( const std::string &  inputString)
overridevirtualinherited

Parses the given string.

This performs any setup work and parses the given string. It is required that this is called before using the Reader and overrides any state that was previously there.

Parameters
[in]inputStringThe Input file to be read
Returns
true if the string was able to be parsed

Implements axom::inlet::Reader.

◆ getBool()

ReaderResult axom::inlet::ConduitReader::getBool ( const std::string &  id,
bool &  value 
)
overridevirtualinherited

Return a boolean out of the input file.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the bool that will be retrieved
[out]valueThe value of the bool that was retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getDouble()

ReaderResult axom::inlet::ConduitReader::getDouble ( const std::string &  id,
double &  value 
)
overridevirtualinherited

Return a double out of the input file.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the double that will be retrieved
[out]valueThe value of the double that was retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getInt()

ReaderResult axom::inlet::ConduitReader::getInt ( const std::string &  id,
int &  value 
)
overridevirtualinherited

Return a int out of the input file.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the int that will be retrieved
[out]valueThe value of the int that was retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getString()

ReaderResult axom::inlet::ConduitReader::getString ( const std::string &  id,
std::string &  value 
)
overridevirtualinherited

Return a string out of the input file.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the string that will be retrieved
[out]valueThe value of the string that was retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getIntMap() [1/2]

ReaderResult axom::inlet::ConduitReader::getIntMap ( const std::string &  id,
std::unordered_map< int, int > &  values 
)
overridevirtualinherited

Get an index-integer mapping for the given array.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the string that will be retrieved
[out]mapThe values of the ints that were retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getIntMap() [2/2]

ReaderResult axom::inlet::ConduitReader::getIntMap ( const std::string &  id,
std::unordered_map< VariantKey, int > &  values 
)
overridevirtualinherited

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

Implements axom::inlet::Reader.

◆ getDoubleMap() [1/2]

ReaderResult axom::inlet::ConduitReader::getDoubleMap ( const std::string &  id,
std::unordered_map< int, double > &  values 
)
overridevirtualinherited

Get an index-double mapping for the given array.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the string that will be retrieved
[out]mapThe values of the doubles that were retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getDoubleMap() [2/2]

ReaderResult axom::inlet::ConduitReader::getDoubleMap ( const std::string &  id,
std::unordered_map< VariantKey, double > &  values 
)
overridevirtualinherited

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

Implements axom::inlet::Reader.

◆ getBoolMap() [1/2]

ReaderResult axom::inlet::ConduitReader::getBoolMap ( const std::string &  id,
std::unordered_map< int, bool > &  values 
)
overridevirtualinherited

Get an index-bool mapping for the given array.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the string that will be retrieved
[out]mapThe values of the bools that were retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getBoolMap() [2/2]

ReaderResult axom::inlet::ConduitReader::getBoolMap ( const std::string &  id,
std::unordered_map< VariantKey, bool > &  values 
)
overridevirtualinherited

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

Implements axom::inlet::Reader.

◆ getStringMap() [1/2]

ReaderResult axom::inlet::ConduitReader::getStringMap ( const std::string &  id,
std::unordered_map< int, std::string > &  values 
)
overridevirtualinherited

Get an index-string mapping for the given Lua array.

This performs any necessary retrieval and mapping from the given identifier to what is in the input file.

Parameters
[in]idThe identifier to the string that will be retrieved
[out]mapThe values of the strings that were retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getStringMap() [2/2]

ReaderResult axom::inlet::ConduitReader::getStringMap ( const std::string &  id,
std::unordered_map< VariantKey, std::string > &  values 
)
overridevirtualinherited

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

Implements axom::inlet::Reader.

◆ getIndices() [1/2]

ReaderResult axom::inlet::ConduitReader::getIndices ( const std::string &  id,
std::vector< int > &  indices 
)
overridevirtualinherited

Get the list of indices for a collection.

Parameters
[in]idThe identifier to the collection that will be retrieved
[out]indicesThe values of the indices that were retrieved
Returns
The status of the retrieval,
See also
ReaderResult

Implements axom::inlet::Reader.

◆ getIndices() [2/2]

ReaderResult axom::inlet::ConduitReader::getIndices ( const std::string &  id,
std::vector< VariantKey > &  indices 
)
overridevirtualinherited

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

Implements axom::inlet::Reader.

◆ getFunction()

FunctionVariant axom::inlet::ConduitReader::getFunction ( const std::string &  id,
const FunctionTag  ret_type,
const std::vector< FunctionTag > &  arg_types 
)
overridevirtualinherited

Get a function from the input file.

Parameters
[in]idThe identifier to the function that will be retrieved
[in]ret_typeThe return type of the function
[in]arg_typesThe argument types of the function
Returns
The function, compares false if not found
Note
Conduit does not support functions - calling this function will result in a SLIC_ERROR

Implements axom::inlet::Reader.

◆ getAllNames()

std::vector<std::string> axom::inlet::ConduitReader::getAllNames ( )
overridevirtualinherited

Retrieves all paths present in the input file.

Returns
The set of all paths/full names in the input file - this represents a full traversal of the input file "tree" and includes paths to array/dictionary entries

Implements axom::inlet::Reader.

Member Data Documentation

◆ baseIndex

const int axom::inlet::ConduitReader::baseIndex = 0
staticinherited

The base index for Conduit arrays.


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