Added code to probe 'interface'

This commit is contained in:
2021-02-07 17:26:48 -05:00
parent 8c15e56fe9
commit 368d066cc7
5 changed files with 73 additions and 9 deletions

View File

@@ -372,6 +372,7 @@ private:
};
static int collect_tagged_pointer(lua_State *L);
void make_tagged_pointer(LuaSlot target, void *ptr, LuaTypeTag tag, LuaDeleterFn del);
void clear_tagged_pointer(LuaSlot target);
template<typename T>
static void delete_pointer(void *p) { delete (T*)p; }
@@ -449,6 +450,8 @@ public:
return (T*)(tp->ptr);
}
void clearuserdata(LuaSlot target) { clear_tagged_pointer(target); }
int next(LuaSlot tab, LuaSlot key, LuaSlot value) const;
bool isemptytable(LuaSlot s) const;
@@ -462,6 +465,13 @@ public:
pop_any_value(target);
}
template<typename RT, typename KT>
void gettable(RT &target, LuaSlot tab, KT key) const {
push_any_value(key);
lua_gettable(L_, tab);
pop_any_value(target);
}
template<typename RT, typename KT>
void rawget(RT &target, LuaSlot tab, KT key) const {
push_any_value(key);