00001
00010 #ifndef CALL_HELPER_H_
00011 #define CALL_HELPER_H_
00012
00013 #ifdef BSPY_EXPORTING_PLUGIN
00014
00015 namespace blue_sky
00016 {
00017 namespace tx
00018 {
00019
00020 using blue_sky::python::py_objbase;
00021
00023 template <class R, class C, class A>
00024 R call(py_objbase * py, R(C::*f)(A), A a)
00025 {
00026 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00027 return ((*c).*f)(a);
00028 }
00029 template <class R, class C, class A>
00030 R call(py_objbase * py, R(C::*f)(A&), A &a)
00031 {
00032 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00033 return ((*c).*f)(a);
00034 }
00035
00037 template <class R, class C, class A, class A2>
00038 R call(py_objbase * py, R(C::*f)(A, A2), A a, A2 a2)
00039 {
00040 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00041 return ((*c).*f)(a, a2);
00042 }
00043 template <class R, class C, class A, class A2>
00044 R call(py_objbase * py, R(C::*f)(A&, A2&), A &a, A2 &a2)
00045 {
00046 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00047 return ((*c).*f)(a, a2);
00048 }
00049
00051 template <class R, class C, class A, class A2, class A3>
00052 R call(py_objbase * py, R(C::*f)(A, A2, A3), A a, A2 a2, A3 a3)
00053 {
00054 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00055 return ((*c).*f)(a, a2, a3);
00056 }
00057 template <class R, class C, class A, class A2, class A3>
00058 R call(py_objbase * py, R(C::*f)(A&, A2&, A3&), A &a, A2 &a2, A3 &a3)
00059 {
00060 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00061 return ((*c).*f)(a, a2, a3);
00062 }
00063 template <class R, class C, class A, class A2, class A3, class A4>
00064 R call(py_objbase * py, R(C::*f)(A, A2, A3, A4), A a, A2 a2, A3 a3, A4 a4)
00065 {
00066 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00067 return ((*c).*f)(a, a2, a3, a4);
00068 }
00069
00070 template <class R, class C, class A, class A2, class A3, class A4, class A5>
00071 R call(py_objbase * py, R(C::*f)(A, A2, A3, A4), A a, A2 a2, A3 a3, A4 a4, A5 a5)
00072 {
00073 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00074 return ((*c).*f)(a, a2, a3, a4, a5);
00075 }
00076
00077 template <class R, class C>
00078 R call (py_objbase * py, R(C::*f)())
00079 {
00080 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00081 return ((*c).*f)();
00082 }
00083 template <class R, class C>
00084 R call (py_objbase * py, R(C::*f)() const)
00085 {
00086 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00087 return ((*c).*f)();
00088 }
00089 template <class R, class C>
00090 R call (const py_objbase * py, R(C::*f)() const)
00091 {
00092 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00093 return ((*c).*f)();
00094 }
00095
00097 template <class C, class A>
00098 void call(py_objbase * py, void (C::*f)(A), A a)
00099 {
00100 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00101 ((*c).*f)(a);
00102 }
00103 template <class C, class A>
00104 void call(py_objbase * py, void (C::*f)(A&), A &a)
00105 {
00106 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00107 ((*c).*f)(a);
00108 }
00109 template <class C>
00110 void call(py_objbase * py, void(C::*f)())
00111 {
00112 lsmart_ptr<smart_ptr<C, true> > c(py->get_sp());
00113 ((*c).*f)();
00114 }
00115
00116
00117 }
00118 }
00119
00120 #endif // #ifdef BSPY_EXPORTING_PLUGIN
00121 #endif // #ifndef CALL_HELPER_H_