37 #ifndef __MO_LUA_BASE_H__
38 #define __MO_LUA_BASE_H__
82 bool InitialiseVM (
void);
87 bool FinaliseVM (
void);
94 bool RunFile (
const char *strFilename);
103 bool RunBuffer (
const unsigned char *pbBuffer,
size_t szLen,
const char *strName = NULL);
111 bool CallFunction (
int nArgs,
int nReturns = 0);
117 operator lua_State *(void) {
return m_pState; }
123 static void Panic (lua_State *lua);
129 virtual bool Ok (
void) {
return m_fIsOk; }
167 void FinaliseDBG (
void);
173 void SetHooksFlag (
int iMask);
178 void SetCount (
int iCount) { m_iCountMask = iCount; }
184 void ErrorRun (
int iErrorCode);
208 m_pState = (lua_State *) vm;
212 m_iTop = lua_gettop (m_pState);
222 lua_settop (m_pState, m_iTop);
242 lua_State *state = (lua_State *) vm;
246 lua_getglobal (state,
"this");
247 m_iOldRef = luaL_ref (state, LUA_REGISTRYINDEX);
250 lua_rawgeti(state, LUA_REGISTRYINDEX, iRef);
251 lua_setglobal (state,
"this");
260 lua_State *state = (lua_State *) m_vm;
261 if (m_iOldRef > 0 && m_vm.Ok ())
264 lua_rawgeti(state, LUA_REGISTRYINDEX, m_iOldRef);
265 lua_setglobal (state,
"this");
266 luaL_unref (state, LUA_REGISTRYINDEX, m_iOldRef);
moLuaVirtualMachine & m_vm
virtual ~moLuaRestoreStack(void)
Clase base abstracta de donde deben derivar los objetos [virtual pura].
moLuaVirtualMachine & m_vm
void SetCount(int iCount)
moLuaRestoreStack(moLuaVirtualMachine &vm)
moLuaThis(moLuaVirtualMachine &vm, int iRef)
void AttachDebugger(moLuaDebugger *dbg)
restaurador del stack de LUA