From 4fae7ee29447ad806113db49ab69a98992b9712e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neun=C3=BCller?= Date: Fri, 26 Jul 2013 11:08:02 +0200 Subject: [PATCH] Add support basic luabind converter for ssig::Connection. --- src/luaexport/LuaEventHelpers.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/luaexport/LuaEventHelpers.hpp b/src/luaexport/LuaEventHelpers.hpp index 0e0dfe0..3862425 100644 --- a/src/luaexport/LuaEventHelpers.hpp +++ b/src/luaexport/LuaEventHelpers.hpp @@ -45,4 +45,28 @@ ssig::ScopedConnection* makeConnection( return new ssig::ScopedConnection(con); } +namespace luabind { + template + struct default_converter> + : native_converter_base> + { + void to(lua_State* L, ssig::Connection const& value) + { + luabind::object o( + L, static_cast(makeConnection(value))); + o.push(L); + } + }; + + template + struct default_converter const> + : default_converter> + {}; + + template + struct default_converter const&> + : default_converter> + {}; +} // namespace luabind + #endif // include guard