AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A Reader that is able to read variables from a Lua file. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/inlet/LuaReader.hpp>
Public Member Functions | |
LuaReader () | |
bool | parseFile (const std::string &filePath) override |
Parses the given input file. More... | |
bool | parseString (const std::string &luaString) 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 deck. More... | |
std::vector< std::string > | getAllNames () override |
Retrieves all paths present in the input file. More... | |
Static Public Attributes | |
static const int | baseIndex = 1 |
The base index for arrays in Lua. More... | |
Protected Member Functions | |
std::shared_ptr< axom::sol::state > | solState () |
Returns the Sol Lua state. More... | |
axom::inlet::LuaReader::LuaReader | ( | ) |
|
overridevirtual |
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.
[in] | filePath | The Input file to be read |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | inputString | The Input file to be read |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | id | The identifier to the bool that will be retrieved |
[out] | value | The value of the bool that was retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | id | The identifier to the double that will be retrieved |
[out] | value | The value of the double that was retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | id | The identifier to the int that will be retrieved |
[out] | value | The value of the int that was retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | id | The identifier to the string that will be retrieved |
[out] | value | The value of the string that was retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
[in] | id | The identifier to the string that will be retrieved |
[out] | map | The values of the ints that were retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
|
overridevirtual |
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.
[in] | id | The identifier to the string that will be retrieved |
[out] | map | The values of the doubles that were retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
|
overridevirtual |
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.
[in] | id | The identifier to the string that will be retrieved |
[out] | map | The values of the bools that were retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
|
overridevirtual |
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.
[in] | id | The identifier to the string that will be retrieved |
[out] | map | The values of the strings that were retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
|
overridevirtual |
Get the list of indices for a collection.
[in] | id | The identifier to the collection that will be retrieved |
[out] | indices | The values of the indices that were retrieved |
Implements axom::inlet::Reader.
|
overridevirtual |
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.
|
overridevirtual |
Get a function from the input deck.
[in] | id | The identifier to the function that will be retrieved |
[in] | ret_type | The return type of the function |
[in] | arg_types | The argument types of the function |
Implements axom::inlet::Reader.
|
overridevirtual |
Retrieves all paths present in the input file.
Implements axom::inlet::Reader.
|
inlineprotected |
Returns the Sol Lua state.
This allows the user to access functionality that was not provided by Inlet.
state
, be sure to include axom/sol.hpp
and derive a new class to access this publically. See the lua_library.cpp
example. Including sol.hpp
can increase compile time significantly.
|
static |
The base index for arrays in Lua.