25 #include "lua/lauxlib.h" 60 assert(
_ref != LUA_REFNIL);
73 const int oldRef =
_ref;
79 if (oldState && oldRef != LUA_REFNIL) {
80 lua_unref(oldState, oldRef);
88 const int savedTop = lua_gettop(
_luaState);
94 if (lua_pcall(&stack.
getLuaState(), params.size(), LUA_MULTRET, 0) != 0) {
98 const int retsCount = stack.
getSize() - savedTop;
114 params.push_back(v1);
115 params.push_back(v2);
121 params.push_back(v1);
122 params.push_back(v2);
123 params.push_back(v3);
129 params.push_back(v1);
130 params.push_back(v2);
131 params.push_back(v3);
132 params.push_back(v4);
Variables getVariablesFromTop(int count) const
void pushVariables(const Variables &vars)
A reference to a Lua function.
int getSize() const
Return the number of elements in the stack.
Basic exceptions to throw.
lua_State & getLuaState() const
std::vector< Variable > Variables
A reference to a Lua function.
const FunctionRef & operator=(const FunctionRef &fn)
lua_State & getLuaState() const
Return the underlying Lua state.