lua_iface.h (snort3-3.1.28.0) | : | lua_iface.h (snort3-3.1.29.0) | ||
---|---|---|---|---|
skipping to change at line 81 | skipping to change at line 81 | |||
} | } | |||
// ----------------------------------------------------------------------------- | // ----------------------------------------------------------------------------- | |||
// TypeInterface | // TypeInterface | |||
// ----------------------------------------------------------------------------- | // ----------------------------------------------------------------------------- | |||
template<typename T> | template<typename T> | |||
struct TypeInterface | struct TypeInterface | |||
{ | { | |||
using type = T; | using type = T; | |||
using AccessorCallback = void (*)(lua_State*, int, T&); | using AccessorCallback = void (*)(lua_State*, int, T&); | |||
using ConstAccessorCallback = void (*)(lua_State*, int, const T&); | ||||
const char* name; | const char* name; | |||
const luaL_Reg* methods; | const luaL_Reg* methods; | |||
const luaL_Reg* metamethods; | const luaL_Reg* metamethods; | |||
T** regurgitate(lua_State* L, int arg = 1) const | T** regurgitate(lua_State* L, int arg = 1) const | |||
{ | { | |||
T** handle = ::Lua::regurgitate<T>(L, name, arg); | T** handle = ::Lua::regurgitate<T>(L, name, arg); | |||
assert(handle); | assert(handle); | |||
return handle; | return handle; | |||
skipping to change at line 139 | skipping to change at line 140 | |||
lua_pushfstring(L, "%s@0x%p", this->name, &this->get(L)); | lua_pushfstring(L, "%s@0x%p", this->name, &this->get(L)); | |||
return 1; | return 1; | |||
} | } | |||
int default_gc(lua_State* L) const | int default_gc(lua_State* L) const | |||
{ | { | |||
this->destroy(L); | this->destroy(L); | |||
return 0; | return 0; | |||
} | } | |||
int default_getter(lua_State* L, AccessorCallback acb) const | int default_getter(lua_State* L, ConstAccessorCallback acb) const | |||
{ | { | |||
auto& self = this->get(L); | auto& self = this->get(L); | |||
lua_newtable(L); | lua_newtable(L); | |||
acb(L, lua_gettop(L), self); | acb(L, lua_gettop(L), self); | |||
return 1; | return 1; | |||
} | } | |||
int default_setter(lua_State* L, AccessorCallback acb) const | int default_setter(lua_State* L, AccessorCallback acb) const | |||
{ | { | |||
auto& self = this->get(L, 1); | auto& self = this->get(L, 1); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |