#include <src_lua_bind_lua.hh>
Public Types | |
| typedef LUA_NUMBER | Number |
| Lua numeric type. | |
Public Member Functions | |
| CLASS_METHOD Lua & | GetInstance (void) |
| void | ExportCmdLine (int argc, char **argv) |
| void | SetScriptDir (const string &scriptDir) |
| string | GetScriptDir (void) |
| void | RunScript (const string &scriptName, const bool recompile=false) |
| bool | ReadVarAsBool (const string &varName) |
| Number | ReadVarAsNumber (const string &varName) |
| string | ReadVarAsString (const string &varName) |
| Number | ReadTableAsNumber (const string &tableName, const int tableIdx) |
| Number | ReadTableAsNumber (const string &tableName, const string &memberName) |
| string | ReadTableAsString (const string &tableName, const int tableIdx) |
| string | ReadTableAsString (const string &tableName, const string &memberName) |
| Number | CallLuaFunc (const string &tableName, const string &funcName, const vector< Lua::Number > &args) |
Private Types | |
| typedef map< string, int > | BytecodeMap |
Private Member Functions | |
| Lua (void) | |
| ~Lua () | |
| void | SaveStack (void) |
| void | RestoreStack (void) |
| void | ThrowLuaException (const string &msg) |
Private Attributes | |
| CLASS_VAR Lua * | msInstance |
| instance of Lua | |
| CLASS_VAR const luaL_Reg | mFuncTable [] |
| C interface functions exported to Lua scripts. | |
| lua_State * | mLua |
| the Lua interpreter (C code) | |
| string | mScriptDir |
| directory containing scripts | |
| BytecodeMap | mBytecodeMap |
| avoids recompiling Lua bytecode | |
| int | mSavedStack |
| stack depth | |
NOTE: Most methods might throw a C++ exception.
| typedef LUA_NUMBER lua::Lua::Number |
Lua numeric type.
typedef map<string,int> lua::Lua::BytecodeMap [private] |
| lua::Lua::Lua | ( | void | ) | [private] |
ctor/dtor.
| lua::Lua::~Lua | ( | ) | [private] |
| CLASS_METHOD Lua& lua::Lua::GetInstance | ( | void | ) | [inline] |
| void lua::Lua::ExportCmdLine | ( | int | argc, | |
| char ** | argv | |||
| ) |
Export command-line args to Lua.
| void lua::Lua::SetScriptDir | ( | const string & | scriptDir | ) |
Set the directory containing Lua scripts.
| string lua::Lua::GetScriptDir | ( | void | ) | [inline] |
| void lua::Lua::RunScript | ( | const string & | scriptName, | |
| const bool | recompile = false | |||
| ) |
THROWS C++ EXCEPTION. Execute a script. To avoid recompiling, the bytecode of a Lua script is stored in case the same script is called again. http://lua-users.org/lists/lua-l/2003-07/msg00082.html
| bool lua::Lua::ReadVarAsBool | ( | const string & | varName | ) |
| Lua::Number lua::Lua::ReadVarAsNumber | ( | const string & | varName | ) |
THROWS C++ EXCEPTION. Read a number variable from Lua.
| string lua::Lua::ReadVarAsString | ( | const string & | varName | ) |
THROWS C++ EXCEPTION. Read a string variable from Lua.
| Lua::Number lua::Lua::ReadTableAsNumber | ( | const string & | tableName, | |
| const int | tableIdx | |||
| ) |
THROWS C++ EXCEPTION. Read a member of table by numeric index (treats table as an array).
| Lua::Number lua::Lua::ReadTableAsNumber | ( | const string & | tableName, | |
| const string & | memberName | |||
| ) |
THROWS C++ EXCEPTION. Read a member of table by key (key is a string).
| string lua::Lua::ReadTableAsString | ( | const string & | tableName, | |
| const int | tableIdx | |||
| ) |
THROWS C++ EXCEPTION. Read a member of table by numeric index (treats table as an array).
| string lua::Lua::ReadTableAsString | ( | const string & | tableName, | |
| const string & | memberName | |||
| ) |
THROWS C++ EXCEPTION. Read a member of table by key (key is a string).
| Lua::Number lua::Lua::CallLuaFunc | ( | const string & | tableName, | |
| const string & | funcName, | |||
| const vector< Lua::Number > & | args | |||
| ) |
Call a Lua function from C++ (as a method in a table). tableName:funcName( args )
| tableName | ||
| funcName | ||
| args | Can be empty. |
| void lua::Lua::SaveStack | ( | void | ) | [inline, private] |
| void lua::Lua::RestoreStack | ( | void | ) | [inline, private] |
| void lua::Lua::ThrowLuaException | ( | const string & | msg | ) | [inline, private] |
Lua * lua::Lua::msInstance [private] |
instance of Lua
CLASS_VAR const luaL_Reg lua::Lua::mFuncTable[] [private] |
C interface functions exported to Lua scripts.
lua_State* lua::Lua::mLua [private] |
the Lua interpreter (C code)
string lua::Lua::mScriptDir [private] |
directory containing scripts
BytecodeMap lua::Lua::mBytecodeMap [private] |
avoids recompiling Lua bytecode
int lua::Lua::mSavedStack [private] |
stack depth
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Mon Dec 29 17:27:01 2008