git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
958cfa1
)
add PSignal3 template
author
Andreas Oberritter
<obi@opendreambox.org>
Wed, 30 Mar 2011 20:20:27 +0000
(22:20 +0200)
committer
Andreas Oberritter
<obi@opendreambox.org>
Thu, 31 Mar 2011 23:31:31 +0000
(
01:31
+0200)
lib/python/connections.h
patch
|
blob
|
history
diff --git
a/lib/python/connections.h
b/lib/python/connections.h
index b4cd1c7996452d09cdd3700861ce1458130a2129..374749abb9505200a3ff7a37745536ac27987c72 100644
(file)
--- a/
lib/python/connections.h
+++ b/
lib/python/connections.h
@@
-80,4
+80,23
@@
public:
}
};
+template <class R, class V0, class V1, class V2>
+class PSignal3: public PSignal, public Signal3<R,V0,V1,V2>
+{
+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<R,V0,V1,V2>::operator()(a0, a1, a2);
+ }
+};
+
#endif