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/v0.4.0/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 bool getBool (const std::string &id, bool &value)=0
 Return a boolean out of the input file. More...
 
virtual bool getDouble (const std::string &id, double &value)=0
 Return a double out of the input file. More...
 
virtual bool getInt (const std::string &id, int &value)=0
 Return a int out of the input file. More...
 
virtual bool getString (const std::string &id, std::string &value)=0
 Return a string out of the input file. More...
 
virtual bool getIntMap (const std::string &id, std::unordered_map< int, int > &values)=0
 Get an index-integer mapping for the given array. More...
 
virtual bool getBoolMap (const std::string &id, std::unordered_map< int, bool > &values)=0
 Get an index-bool mapping for the given array. More...
 
virtual bool getDoubleMap (const std::string &id, std::unordered_map< int, double > &values)=0
 Get an index-double mapping for the given array. More...
 
virtual bool getStringMap (const std::string &id, std::unordered_map< int, std::string > &values)=0
 Get an index-string mapping for the given Lua array. 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

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.

Referenced by ~Reader().

◆ 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::LuaReader.

Referenced by ~Reader().

◆ getBool()

virtual bool 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
true if the variable was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getDouble()

virtual bool 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
true if the variable was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getInt()

virtual bool 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
true if the variable was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getString()

virtual bool 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
true if the variable was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getIntMap()

virtual bool 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
true if the array was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getBoolMap()

virtual bool 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
true if the array was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getDoubleMap()

virtual bool 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
true if the array was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().

◆ getStringMap()

virtual bool 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
true if the array was able to be retrieved from the file

Implemented in axom::inlet::LuaReader.

Referenced by ~Reader().


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