37 #ifndef H_OGF_GOM_LUA_INTERPRETER_H
38 #define H_OGF_GOM_LUA_INTERPRETER_H
42 #include <OGF/gom/types/callable.h>
80 lua_State* lua_state_;
84 static index_t current_instance_id_;
115 const std::string& command,
bool save_in_history,
bool log
126 Any resolve(
const std::string&
id,
bool quiet=
true)
const override;
131 void bind(
const std::string&
id,
const Any& value)
override;
137 const std::string& expression,
bool quiet=
true
161 void list_names(std::vector<std::string>& names)
const override;
178 const std::string& context, std::vector<std::string>& keys
185 const std::string& args
190 lua_State* lua_state_;
A class that stores a variable of arbitrary type.
Represents a list of name-value pairs.
Abstract base class for the GOM interpreter.
GOM wrapper around a LUA function.
~LuaCallable() override
LuaCallable destructor.
bool invoke(const ArgList &args, Any &ret_val) override
Invokes a method by method name.
LuaCallable(lua_State *L, int target_index)
LuaCallable constructor.
The main class that interfaces the Python interpreter with Graphite.
lua_State * lua_state()
Gets the LUA state.
void get_keys(const std::string &context, std::vector< std::string > &keys) override
Gets all possible keys in a certain context.
~LuaInterpreter() override
LuaInterpreter destructor.
bool execute(const std::string &command, bool save_in_history, bool log) override
Executes a single line of code in the interpreted language.
std::string name_value_pair_call(const std::string &args) const override
Transforms a list of name-value pairs arguments.
void reset() override
Clears all variables, restarts from initial state.
LuaInterpreter()
LuaInterpreter constructor.
void bind(const std::string &id, const Any &value) override
Binds a value to a variable.
Any resolve(const std::string &id, bool quiet=true) const override
Finds a variable by id.
virtual void adjust_lua_state()
Adjusts LUA state to recover from errors.
bool execute_file(const std::string &file_name) override
Executes commands from a given file.
Any eval(const std::string &expression, bool quiet=true) const override
Evaluates a string with an expression.
void list_names(std::vector< std::string > &names) const override
Lists the variable names in this Scope.
static void display_error_message(const std::string &msg)
Displays a Lua error message.
The abstract base class for the GOM interpreter.
geo_index_t index_t
The type for storing and manipulating indices.
Global Graphite namespace.
Definitions common to all include files in the gom library.