From 3f2f09fb2bacead0185428eee9a1090c5a53bdeb Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Wed, 30 Mar 2011 22:20:27 +0200 Subject: [PATCH] add PSignal3 template --- lib/python/connections.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/python/connections.h b/lib/python/connections.h index b4cd1c79..374749ab 100644 --- a/lib/python/connections.h +++ b/lib/python/connections.h @@ -80,4 +80,23 @@ public: } }; +template +class PSignal3: public PSignal, public Signal3 +{ +public: + R operator()(V0 a0, V1 a1, V2 a2) + { + if (m_list) + { + PyObject *pArgs = PyTuple_New(3); + PyTuple_SET_ITEM(pArgs, 0, PyFrom(a0)); + PyTuple_SET_ITEM(pArgs, 1, PyFrom(a1)); + PyTuple_SET_ITEM(pArgs, 2, PyFrom(a2)); + callPython(pArgs); + Org_Py_DECREF(pArgs); + } + return Signal3::operator()(a0, a1, a2); + } +}; + #endif -- 2.30.2