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

Abstract base class defining the interface of all Reader classes. More...

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

Inheritance diagram for axom::inlet::Reader:

Public Member Functions

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

Detailed Description

Abstract base class defining the interface of all Reader classes.

Concrete instances need to inherit from this class and implement these functions.You will need to add your Reader using Reader::initialize

See also
LuaReader

Constructor & Destructor Documentation

◆ ~Reader()

virtual axom::inlet::Reader::~Reader ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ parseFile()

virtual bool axom::inlet::Reader::parseFile ( const std::string &  filePath)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ parseString()

virtual bool axom::inlet::Reader::parseString ( const std::string &  inputString)
pure virtual

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

Implemented in axom::inlet::ConduitReader, and axom::inlet::LuaReader.

◆ getBool()

virtual ReaderResult axom::inlet::Reader::getBool ( const std::string &  id,
bool &  value 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getDouble()

virtual ReaderResult axom::inlet::Reader::getDouble ( const std::string &  id,
double &  value 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getInt()

virtual ReaderResult axom::inlet::Reader::getInt ( const std::string &  id,
int &  value 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getString()

virtual ReaderResult axom::inlet::Reader::getString ( const std::string &  id,
std::string &  value 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getIntMap() [1/2]

virtual ReaderResult axom::inlet::Reader::getIntMap ( const std::string &  id,
std::unordered_map< int, int > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getIntMap() [2/2]

virtual ReaderResult axom::inlet::Reader::getIntMap ( const std::string &  id,
std::unordered_map< VariantKey, int > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getBoolMap() [1/2]

virtual ReaderResult axom::inlet::Reader::getBoolMap ( const std::string &  id,
std::unordered_map< int, bool > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getBoolMap() [2/2]

virtual ReaderResult axom::inlet::Reader::getBoolMap ( const std::string &  id,
std::unordered_map< VariantKey, bool > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getDoubleMap() [1/2]

virtual ReaderResult axom::inlet::Reader::getDoubleMap ( const std::string &  id,
std::unordered_map< int, double > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getDoubleMap() [2/2]

virtual ReaderResult axom::inlet::Reader::getDoubleMap ( const std::string &  id,
std::unordered_map< VariantKey, double > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getStringMap() [1/2]

virtual ReaderResult axom::inlet::Reader::getStringMap ( const std::string &  id,
std::unordered_map< int, std::string > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getStringMap() [2/2]

virtual ReaderResult axom::inlet::Reader::getStringMap ( const std::string &  id,
std::unordered_map< VariantKey, std::string > &  values 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getIndices() [1/2]

virtual ReaderResult axom::inlet::Reader::getIndices ( const std::string &  id,
std::vector< int > &  indices 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getIndices() [2/2]

virtual ReaderResult axom::inlet::Reader::getIndices ( const std::string &  id,
std::vector< VariantKey > &  indices 
)
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getFunction()

virtual FunctionVariant axom::inlet::Reader::getFunction ( const std::string &  id,
const FunctionTag  ret_type,
const std::vector< FunctionTag > &  arg_types 
)
pure virtual

Get a function from the input deck.

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.

◆ getAllNames()

virtual std::vector<std::string> axom::inlet::Reader::getAllNames ( )
pure virtual

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

Implemented in axom::inlet::LuaReader, and axom::inlet::ConduitReader.


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