void LuaTable::setReference(const LuaReference& ref) { ref->pushValue(); lua_State* L = ref->getState(); if (lua_type(L, -1) != LUA_TTABLE) { lua_pop(L, 1); throw LuaException("Reference does not refere to a table!"); } else { lua_pop(L, 1); LuaValue::setReference(ref); } }
void LuaFunction::setReference(LuaReference ref) { ref->pushValue(); lua_State* L = ref->getState(); if (lua_type(L, -1) != LUA_TFUNCTION) { lua_pop(L, 1); throw LuaException("Reference does not refere to a function!"); } else { lua_pop(L, 1); LuaValue::setReference(ref); } }
LuaReference UniqueLuaReference::copy(const LuaReference& other) { other->pushValue(); return create(other->_luaState); }