14 luabind::object obj = luabind::globals(
lua_state());
25 luabind::object obj = luabind::registry(
lua_state());
46 size_t t = Fname.find_last_of(
"/");
49 if(t != std::string::npos) {
50 dirbase = Fname.substr(0, t);
51 bname = Fname.substr(t + 1);
93 int status = luaL_dofile(
lua_state(), Fname.c_str());
97 e <<
"Lua error: " << lua_tostring(
lua_state(), -1) <<
"\n";
110 int status = luaL_dostring(
lua_state(), S.c_str());
114 e <<
"Lua error: " << lua_tostring(
lua_state(), -1) <<
"\n";
LuabindObject globals()
Globals table.
void run(const std::string &S)
Run the given Lua code.
const std::string & base_dir_name() const
Base directory that we use when running Lua.
LuabindObject registry()
Registery table.
void do_file(const std::string &Fname)
Load the given file and execute it.
static void register_lua(lua_State *ls)
lua_State * lua_state()
Lua state pointer.
This is the base of the exception hierarchy for Full Physics code.
To detect things like divide by zero, we may turn on floating point exceptions.
This is a light wrapper around the luabind::object.
LuaState(const std::string &Dir_name="./")
Create a new instance of Lua.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
static boost::shared_ptr< LuaState > load_file(const std::string &Fname)
Create a new LuaState, and then open the given file.