51#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H
52#define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H
71 class FunctorPythonBase
74 FunctorPythonBase(
const TPyObjPtr& callable): callable_(callable) {}
75 bool operator==(
const FunctorPythonBase& other)
const
77 return callable_.get() == other.callable_.get();
79 bool operator!()
const
91 LASS_ASSERT(callable_);
92 const TPyObjPtr result(PyObject_CallObject(callable_.get(), args.get()));
106 template <
typename R>
107 class FunctorPythonRBase
110 FunctorPythonRBase(
const TPyObjPtr& callable): callable_(callable) {}
111 bool operator==(
const FunctorPythonRBase<R>& other)
const
113 return callable_.get() == other.callable_.get();
115 bool operator!()
const
127 LASS_ASSERT(callable_);
128 const TPyObjPtr result(PyObject_CallObject(callable_.get(), args.get()));
134 typename TraitsR::TStorage temp;
135 if (pyGetSimpleObject(result.get(), temp) != 0)
139 return TraitsR::arg(temp);
145 class PyCallbackImplBase
148 virtual ~PyCallbackImplBase() =
default;
149 virtual PyObject* call(PyObject* args)
const = 0;
156 using TPimpl = std::unique_ptr<PyCallbackImplBase>;
158 PyCallback(TPimpl impl);
160 template <
typename PyCallbackImplType>
161 bool get(
typename PyCallbackImplType::TCallback& v)
const
163 PyCallbackImplBase* p = pimpl_.get();
164 if (p &&
typeid(*p) ==
typeid(PyCallbackImplType))
166 v =
static_cast<PyCallbackImplType*
>(p)->callable();
172 static PyObject* _tp_call(PyObject* self, PyObject* args, PyObject* kwargs);
188template <
typename CallbackType,
typename PyCallbackImplType,
typename ExportTraits>
191 static int get(PyObject* value, CallbackType& callback)
193 if (value == Py_None)
198 impl::initLassModule();
199 if (PyType_IsSubtype(Py_TYPE(value), impl::PyCallback::_lassPyClassDef.type()))
201 if (
static_cast<impl::PyCallback*
>(value)->get<PyCallbackImplType>(callback))
207 if (pyGetSimpleObject(value, callable) != 0)
217 if (!PyCallable_Check(callable.get()))
219 std::ostringstream buffer;
220 buffer << ExportTraits::className() <<
": not callable";
221 PyErr_SetString(PyExc_TypeError, buffer.str().c_str());
224 using TFunctor =
typename PyCallbackImplType::TFunctor;
225 callback = TFunctor(callable);
228 static PyObject* build(
const CallbackType& callback)
235 using TDispatcher =
typename PyCallbackImplType::TDispatcher;
236 auto dispatcher = callback.dispatcher().get();
237 if (dispatcher &&
typeid(*dispatcher) ==
typeid(TDispatcher))
243 impl::PyCallback::TPimpl pimpl(
new PyCallbackImplType(callback));
244 return new impl::PyCallback(std::move(pimpl));
253#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_0)
254# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_0
255# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_0
263 class Functor0Python:
public FunctorPythonBase
266 Functor0Python(
const python::TPyObjPtr& callable): FunctorPythonBase(callable) {}
267 void operator()()
const
269 LockGIL LASS_UNUSED(lock);
274 class PyCallback0Impl:
public PyCallbackImplBase
277 using TCallback = util::Callback0;
278 using TFunctor = Functor0Python;
279 using TDispatcher = util::impl::Dispatcher0Function<TFunctor>;
281 PyCallback0Impl(TCallback callback): callback_(std::move(callback)) {}
282 const TCallback& callable()
const {
return callback_; }
284 PyObject* call(PyObject* args)
const override
286 if ( decodeTuple(args) != 0 )
290 return Caller<void>::callFunction<const TCallback&>(callback_);
324 impl::PyCallback0Impl,
325 PyExportTraits< util::Callback0 >
328 static constexpr const char* py_typing =
"Callable[[], None]";
330 static const char* className() {
return "Callback0"; }
339#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_1)
340# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_1
341# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_1
349 template <
typename P1>
350 class Functor1Python:
public FunctorPythonBase
353 Functor1Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
354 void operator()(
typename util::CallTraits<P1>::TParam p1)
const
356 LockGIL LASS_UNUSED(lock);
357 this->call(makeTuple(p1));
361 template <
typename P1>
362 class PyCallback1Impl:
public PyCallbackImplBase
365 using TCallback = util::Callback1<P1>;
366 using TFunctor = Functor1Python<P1>;
367 using TDispatcher = util::impl::Dispatcher1Function<P1, TFunctor>;
369 PyCallback1Impl(TCallback callback): callback_(std::move(callback)) {}
370 const TCallback& callable()
const {
return callback_; }
372 PyObject* call(PyObject* args)
const override
374 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
376 if ( decodeTuple<S1>(args, p1) != 0 )
380 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1));
410template <
typename P1>
414 impl::PyCallback1Impl<P1>,
415 PyExportTraits< util::Callback1<P1> >
418 static constexpr const char* py_typing =
"Callable[[P1!], None]";
420 static const char* className() {
return "Callback1"; }
429#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_2)
430# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_2
431# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_2
439 template <
typename P1,
typename P2>
440 class Functor2Python:
public FunctorPythonBase
443 Functor2Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
444 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2)
const
446 LockGIL LASS_UNUSED(lock);
447 this->call(makeTuple(p1, p2));
451 template <
typename P1,
typename P2>
452 class PyCallback2Impl:
public PyCallbackImplBase
455 using TCallback = util::Callback2<P1, P2>;
456 using TFunctor = Functor2Python<P1, P2>;
457 using TDispatcher = util::impl::Dispatcher2Function<P1, P2, TFunctor>;
459 PyCallback2Impl(TCallback callback): callback_(std::move(callback)) {}
460 const TCallback& callable()
const {
return callback_; }
462 PyObject* call(PyObject* args)
const override
464 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
465 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
467 if ( decodeTuple<S1, S2>(args, p1, p2) != 0 )
471 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2));
501template <
typename P1,
typename P2>
504 util::Callback2<P1, P2>,
505 impl::PyCallback2Impl<P1, P2>,
506 PyExportTraits< util::Callback2<P1, P2> >
509 static constexpr const char* py_typing =
"Callable[[P1!, P2!], None]";
511 static const char* className() {
return "Callback2"; }
520#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_3)
521# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_3
522# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_3
530 template <
typename P1,
typename P2,
typename P3>
531 class Functor3Python:
public FunctorPythonBase
534 Functor3Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
535 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3)
const
537 LockGIL LASS_UNUSED(lock);
538 this->call(makeTuple(p1, p2, p3));
542 template <
typename P1,
typename P2,
typename P3>
543 class PyCallback3Impl:
public PyCallbackImplBase
546 using TCallback = util::Callback3<P1, P2, P3>;
547 using TFunctor = Functor3Python<P1, P2, P3>;
548 using TDispatcher = util::impl::Dispatcher3Function<P1, P2, P3, TFunctor>;
550 PyCallback3Impl(TCallback callback): callback_(std::move(callback)) {}
551 const TCallback& callable()
const {
return callback_; }
553 PyObject* call(PyObject* args)
const override
555 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
556 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
557 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
559 if ( decodeTuple<S1, S2, S3>(args, p1, p2, p3) != 0 )
563 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3));
593template <
typename P1,
typename P2,
typename P3>
596 util::Callback3<P1, P2, P3>,
597 impl::PyCallback3Impl<P1, P2, P3>,
598 PyExportTraits< util::Callback3<P1, P2, P3> >
601 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!], None]";
603 static const char* className() {
return "Callback3"; }
612#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_4)
613# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_4
614# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_4
622 template <
typename P1,
typename P2,
typename P3,
typename P4>
623 class Functor4Python:
public FunctorPythonBase
626 Functor4Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
627 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4)
const
629 LockGIL LASS_UNUSED(lock);
630 this->call(makeTuple(p1, p2, p3, p4));
634 template <
typename P1,
typename P2,
typename P3,
typename P4>
635 class PyCallback4Impl:
public PyCallbackImplBase
638 using TCallback = util::Callback4<P1, P2, P3, P4>;
639 using TFunctor = Functor4Python<P1, P2, P3, P4>;
640 using TDispatcher = util::impl::Dispatcher4Function<P1, P2, P3, P4, TFunctor>;
642 PyCallback4Impl(TCallback callback): callback_(std::move(callback)) {}
643 const TCallback& callable()
const {
return callback_; }
645 PyObject* call(PyObject* args)
const override
647 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
648 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
649 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
650 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
652 if ( decodeTuple<S1, S2, S3, S4>(args, p1, p2, p3, p4) != 0 )
656 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4));
686template <
typename P1,
typename P2,
typename P3,
typename P4>
689 util::Callback4<P1, P2, P3, P4>,
690 impl::PyCallback4Impl<P1, P2, P3, P4>,
691 PyExportTraits< util::Callback4<P1, P2, P3, P4> >
694 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!], None]";
696 static const char* className() {
return "Callback4"; }
705#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_5)
706# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_5
707# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_5
715 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
716 class Functor5Python:
public FunctorPythonBase
719 Functor5Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
720 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5)
const
722 LockGIL LASS_UNUSED(lock);
723 this->call(makeTuple(p1, p2, p3, p4, p5));
727 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
728 class PyCallback5Impl:
public PyCallbackImplBase
731 using TCallback = util::Callback5<P1, P2, P3, P4, P5>;
732 using TFunctor = Functor5Python<P1, P2, P3, P4, P5>;
733 using TDispatcher = util::impl::Dispatcher5Function<P1, P2, P3, P4, P5, TFunctor>;
735 PyCallback5Impl(TCallback callback): callback_(std::move(callback)) {}
736 const TCallback& callable()
const {
return callback_; }
738 PyObject* call(PyObject* args)
const override
740 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
741 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
742 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
743 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
744 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
746 if ( decodeTuple<S1, S2, S3, S4, S5>(args, p1, p2, p3, p4, p5) != 0 )
750 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5));
780template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
783 util::Callback5<P1, P2, P3, P4, P5>,
784 impl::PyCallback5Impl<P1, P2, P3, P4, P5>,
785 PyExportTraits< util::Callback5<P1, P2, P3, P4, P5> >
788 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!], None]";
790 static const char* className() {
return "Callback5"; }
799#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_6)
800# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_6
801# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_6
809 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
810 class Functor6Python:
public FunctorPythonBase
813 Functor6Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
814 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6)
const
816 LockGIL LASS_UNUSED(lock);
817 this->call(makeTuple(p1, p2, p3, p4, p5, p6));
821 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
822 class PyCallback6Impl:
public PyCallbackImplBase
825 using TCallback = util::Callback6<P1, P2, P3, P4, P5, P6>;
826 using TFunctor = Functor6Python<P1, P2, P3, P4, P5, P6>;
827 using TDispatcher = util::impl::Dispatcher6Function<P1, P2, P3, P4, P5, P6, TFunctor>;
829 PyCallback6Impl(TCallback callback): callback_(std::move(callback)) {}
830 const TCallback& callable()
const {
return callback_; }
832 PyObject* call(PyObject* args)
const override
834 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
835 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
836 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
837 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
838 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
839 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
841 if ( decodeTuple<S1, S2, S3, S4, S5, S6>(args, p1, p2, p3, p4, p5, p6) != 0 )
845 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6));
875template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
878 util::Callback6<P1, P2, P3, P4, P5, P6>,
879 impl::PyCallback6Impl<P1, P2, P3, P4, P5, P6>,
880 PyExportTraits< util::Callback6<P1, P2, P3, P4, P5, P6> >
883 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!], None]";
885 static const char* className() {
return "Callback6"; }
894#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_7)
895# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_7
896# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_7
904 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
905 class Functor7Python:
public FunctorPythonBase
908 Functor7Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
909 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7)
const
911 LockGIL LASS_UNUSED(lock);
912 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7));
916 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
917 class PyCallback7Impl:
public PyCallbackImplBase
920 using TCallback = util::Callback7<P1, P2, P3, P4, P5, P6, P7>;
921 using TFunctor = Functor7Python<P1, P2, P3, P4, P5, P6, P7>;
922 using TDispatcher = util::impl::Dispatcher7Function<P1, P2, P3, P4, P5, P6, P7, TFunctor>;
924 PyCallback7Impl(TCallback callback): callback_(std::move(callback)) {}
925 const TCallback& callable()
const {
return callback_; }
927 PyObject* call(PyObject* args)
const override
929 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
930 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
931 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
932 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
933 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
934 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
935 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
937 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7>(args, p1, p2, p3, p4, p5, p6, p7) != 0 )
941 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7));
971template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
974 util::Callback7<P1, P2, P3, P4, P5, P6, P7>,
975 impl::PyCallback7Impl<P1, P2, P3, P4, P5, P6, P7>,
976 PyExportTraits< util::Callback7<P1, P2, P3, P4, P5, P6, P7> >
979 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!], None]";
981 static const char* className() {
return "Callback7"; }
990#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_8)
991# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_8
992# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_8
1000 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
1001 class Functor8Python:
public FunctorPythonBase
1004 Functor8Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1005 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8)
const
1007 LockGIL LASS_UNUSED(lock);
1008 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8));
1012 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
1013 class PyCallback8Impl:
public PyCallbackImplBase
1016 using TCallback = util::Callback8<P1, P2, P3, P4, P5, P6, P7, P8>;
1017 using TFunctor = Functor8Python<P1, P2, P3, P4, P5, P6, P7, P8>;
1018 using TDispatcher = util::impl::Dispatcher8Function<P1, P2, P3, P4, P5, P6, P7, P8, TFunctor>;
1020 PyCallback8Impl(TCallback callback): callback_(std::move(callback)) {}
1021 const TCallback& callable()
const {
return callback_; }
1023 PyObject* call(PyObject* args)
const override
1025 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1026 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1027 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1028 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1029 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1030 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1031 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1032 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1034 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8>(args, p1, p2, p3, p4, p5, p6, p7, p8) != 0 )
1038 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8));
1041 TCallback callback_;
1068template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
1071 util::Callback8<P1, P2, P3, P4, P5, P6, P7, P8>,
1072 impl::PyCallback8Impl<P1, P2, P3, P4, P5, P6, P7, P8>,
1073 PyExportTraits< util::Callback8<P1, P2, P3, P4, P5, P6, P7, P8> >
1076 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!], None]";
1078 static const char* className() {
return "Callback8"; }
1087#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_9)
1088# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_9
1089# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_9
1097 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
1098 class Functor9Python:
public FunctorPythonBase
1101 Functor9Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1102 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9)
const
1104 LockGIL LASS_UNUSED(lock);
1105 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9));
1109 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
1110 class PyCallback9Impl:
public PyCallbackImplBase
1113 using TCallback = util::Callback9<P1, P2, P3, P4, P5, P6, P7, P8, P9>;
1114 using TFunctor = Functor9Python<P1, P2, P3, P4, P5, P6, P7, P8, P9>;
1115 using TDispatcher = util::impl::Dispatcher9Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, TFunctor>;
1117 PyCallback9Impl(TCallback callback): callback_(std::move(callback)) {}
1118 const TCallback& callable()
const {
return callback_; }
1120 PyObject* call(PyObject* args)
const override
1122 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1123 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1124 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1125 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1126 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1127 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1128 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1129 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1130 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1132 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9) != 0 )
1136 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9));
1139 TCallback callback_;
1166template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
1169 util::Callback9<P1, P2, P3, P4, P5, P6, P7, P8, P9>,
1170 impl::PyCallback9Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9>,
1171 PyExportTraits< util::Callback9<P1, P2, P3, P4, P5, P6, P7, P8, P9> >
1174 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!], None]";
1176 static const char* className() {
return "Callback9"; }
1185#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_10)
1186# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_10
1187# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_10
1195 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
1196 class Functor10Python:
public FunctorPythonBase
1199 Functor10Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1200 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10)
const
1202 LockGIL LASS_UNUSED(lock);
1203 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10));
1207 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
1208 class PyCallback10Impl:
public PyCallbackImplBase
1211 using TCallback = util::Callback10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>;
1212 using TFunctor = Functor10Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>;
1213 using TDispatcher = util::impl::Dispatcher10Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, TFunctor>;
1215 PyCallback10Impl(TCallback callback): callback_(std::move(callback)) {}
1216 const TCallback& callable()
const {
return callback_; }
1218 PyObject* call(PyObject* args)
const override
1220 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1221 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1222 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1223 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1224 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1225 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1226 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1227 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1228 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1229 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1231 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) != 0 )
1235 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10));
1238 TCallback callback_;
1265template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
1268 util::Callback10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>,
1269 impl::PyCallback10Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>,
1270 PyExportTraits< util::Callback10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >
1273 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!], None]";
1275 static const char* className() {
return "Callback10"; }
1284#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_11)
1285# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_11
1286# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_11
1294 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
1295 class Functor11Python:
public FunctorPythonBase
1298 Functor11Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1299 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11)
const
1301 LockGIL LASS_UNUSED(lock);
1302 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11));
1306 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
1307 class PyCallback11Impl:
public PyCallbackImplBase
1310 using TCallback = util::Callback11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>;
1311 using TFunctor = Functor11Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>;
1312 using TDispatcher = util::impl::Dispatcher11Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, TFunctor>;
1314 PyCallback11Impl(TCallback callback): callback_(std::move(callback)) {}
1315 const TCallback& callable()
const {
return callback_; }
1317 PyObject* call(PyObject* args)
const override
1319 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1320 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1321 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1322 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1323 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1324 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1325 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1326 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1327 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1328 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1329 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
1331 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) != 0 )
1335 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11));
1338 TCallback callback_;
1365template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
1366struct PyExportTraits<
util::Callback11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >:
1368 util::Callback11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>,
1369 impl::PyCallback11Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>,
1370 PyExportTraits< util::Callback11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >
1373 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!], None]";
1375 static const char* className() {
return "Callback11"; }
1384#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_12)
1385# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_12
1386# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_12
1394 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
1395 class Functor12Python:
public FunctorPythonBase
1398 Functor12Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1399 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12)
const
1401 LockGIL LASS_UNUSED(lock);
1402 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
1406 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
1407 class PyCallback12Impl:
public PyCallbackImplBase
1410 using TCallback = util::Callback12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>;
1411 using TFunctor = Functor12Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>;
1412 using TDispatcher = util::impl::Dispatcher12Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, TFunctor>;
1414 PyCallback12Impl(TCallback callback): callback_(std::move(callback)) {}
1415 const TCallback& callable()
const {
return callback_; }
1417 PyObject* call(PyObject* args)
const override
1419 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1420 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1421 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1422 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1423 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1424 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1425 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1426 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1427 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1428 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1429 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
1430 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
1432 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) != 0 )
1436 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12));
1439 TCallback callback_;
1466template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
1467struct PyExportTraits<
util::Callback12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> >:
1469 util::Callback12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>,
1470 impl::PyCallback12Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>,
1471 PyExportTraits< util::Callback12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> >
1474 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!], None]";
1476 static const char* className() {
return "Callback12"; }
1485#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_13)
1486# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_13
1487# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_13
1495 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
1496 class Functor13Python:
public FunctorPythonBase
1499 Functor13Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1500 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13)
const
1502 LockGIL LASS_UNUSED(lock);
1503 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13));
1507 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
1508 class PyCallback13Impl:
public PyCallbackImplBase
1511 using TCallback = util::Callback13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>;
1512 using TFunctor = Functor13Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>;
1513 using TDispatcher = util::impl::Dispatcher13Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, TFunctor>;
1515 PyCallback13Impl(TCallback callback): callback_(std::move(callback)) {}
1516 const TCallback& callable()
const {
return callback_; }
1518 PyObject* call(PyObject* args)
const override
1520 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1521 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1522 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1523 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1524 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1525 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1526 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1527 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1528 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1529 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1530 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
1531 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
1532 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
1534 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) != 0 )
1538 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13));
1541 TCallback callback_;
1568template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
1569struct PyExportTraits<
util::Callback13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> >:
1571 util::Callback13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>,
1572 impl::PyCallback13Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>,
1573 PyExportTraits< util::Callback13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> >
1576 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!], None]";
1578 static const char* className() {
return "Callback13"; }
1587#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_14)
1588# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_14
1589# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_14
1597 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
1598 class Functor14Python:
public FunctorPythonBase
1601 Functor14Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1602 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13,
typename util::CallTraits<P14>::TParam p14)
const
1604 LockGIL LASS_UNUSED(lock);
1605 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14));
1609 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
1610 class PyCallback14Impl:
public PyCallbackImplBase
1613 using TCallback = util::Callback14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>;
1614 using TFunctor = Functor14Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>;
1615 using TDispatcher = util::impl::Dispatcher14Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, TFunctor>;
1617 PyCallback14Impl(TCallback callback): callback_(std::move(callback)) {}
1618 const TCallback& callable()
const {
return callback_; }
1620 PyObject* call(PyObject* args)
const override
1622 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1623 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1624 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1625 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1626 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1627 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1628 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1629 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1630 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1631 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1632 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
1633 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
1634 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
1635 typedef ArgumentTraits<P14> TArg14;
typedef typename TArg14::TStorage S14; S14 p14 = S14();
1637 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) != 0 )
1641 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13), TArg14::arg(p14));
1644 TCallback callback_;
1671template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
1672struct PyExportTraits<
util::Callback14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> >:
1674 util::Callback14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>,
1675 impl::PyCallback14Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>,
1676 PyExportTraits< util::Callback14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> >
1679 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!, P14!], None]";
1681 static const char* className() {
return "Callback14"; }
1690#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_15)
1691# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_15
1692# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_15
1700 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
1701 class Functor15Python:
public FunctorPythonBase
1704 Functor15Python(
const TPyObjPtr& callable): FunctorPythonBase(callable) {}
1705 void operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13,
typename util::CallTraits<P14>::TParam p14,
typename util::CallTraits<P15>::TParam p15)
const
1707 LockGIL LASS_UNUSED(lock);
1708 this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15));
1712 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
1713 class PyCallback15Impl:
public PyCallbackImplBase
1716 using TCallback = util::Callback15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>;
1717 using TFunctor = Functor15Python<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>;
1718 using TDispatcher = util::impl::Dispatcher15Function<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, TFunctor>;
1720 PyCallback15Impl(TCallback callback): callback_(std::move(callback)) {}
1721 const TCallback& callable()
const {
return callback_; }
1723 PyObject* call(PyObject* args)
const override
1725 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1726 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
1727 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
1728 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
1729 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
1730 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
1731 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
1732 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
1733 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
1734 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
1735 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
1736 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
1737 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
1738 typedef ArgumentTraits<P14> TArg14;
typedef typename TArg14::TStorage S14; S14 p14 = S14();
1739 typedef ArgumentTraits<P15> TArg15;
typedef typename TArg15::TStorage S15; S15 p15 = S15();
1741 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14, S15>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) != 0 )
1745 return Caller<void>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13), TArg14::arg(p14), TArg15::arg(p15));
1748 TCallback callback_;
1775template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
1776struct PyExportTraits<
util::Callback15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> >:
1778 util::Callback15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>,
1779 impl::PyCallback15Impl<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>,
1780 PyExportTraits< util::Callback15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> >
1783 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!, P14!, P15!], None]";
1785 static const char* className() {
return "Callback15"; }
1798#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R0)
1799# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R0
1800# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R0
1808 template <
typename R>
1809 class FunctorPythonR0:
public FunctorPythonRBase<R>
1812 FunctorPythonR0(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
1813 R operator()()
const
1815 LockGIL LASS_UNUSED(lock);
1820 template <
typename R>
1821 class PyCallbackR0Impl:
public PyCallbackImplBase
1824 using TCallback = util::CallbackR0<R>;
1825 using TFunctor = FunctorPythonR0<R>;
1826 using TDispatcher = util::impl::DispatcherR0Function<R, TFunctor>;
1828 PyCallbackR0Impl(TCallback callback): callback_(std::move(callback)) {}
1829 const TCallback& callable()
const {
return callback_; }
1831 PyObject* call(PyObject* args)
const override
1833 if ( decodeTuple(args) != 0 )
1837 return Caller<R>::template callFunction<const TCallback&>(callback_);
1840 TCallback callback_;
1867template <
typename R>
1870 util::CallbackR0<R>,
1871 impl::PyCallbackR0Impl<R>,
1872 PyExportTraits< util::CallbackR0<R> >
1875 static constexpr const char* py_typing =
"Callable[[], R!]";
1877 static const char* className() {
return "CallbackR0"; }
1886#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R1)
1887# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R1
1888# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R1
1896 template <
typename R,
typename P1>
1897 class FunctorPythonR1:
public FunctorPythonRBase<R>
1900 FunctorPythonR1(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
1901 R operator()(
typename util::CallTraits<P1>::TParam p1)
const
1903 LockGIL LASS_UNUSED(lock);
1904 return this->call(makeTuple(p1));
1908 template <
typename R,
typename P1>
1909 class PyCallbackR1Impl:
public PyCallbackImplBase
1912 using TCallback = util::CallbackR1<R, P1>;
1913 using TFunctor = FunctorPythonR1<R, P1>;
1914 using TDispatcher = util::impl::DispatcherR1Function<R, P1, TFunctor>;
1916 PyCallbackR1Impl(TCallback callback): callback_(std::move(callback)) {}
1917 const TCallback& callable()
const {
return callback_; }
1919 PyObject* call(PyObject* args)
const override
1921 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
1923 if ( decodeTuple<S1>(args, p1) != 0 )
1927 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1));
1930 TCallback callback_;
1958template <
typename R,
typename P1>
1961 util::CallbackR1<R, P1>,
1962 impl::PyCallbackR1Impl<R, P1>,
1963 PyExportTraits< util::CallbackR1<R, P1> >
1966 static constexpr const char* py_typing =
"Callable[[P1!], R!]";
1968 static const char* className() {
return "CallbackR1"; }
1977#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R2)
1978# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R2
1979# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R2
1987 template <
typename R,
typename P1,
typename P2>
1988 class FunctorPythonR2:
public FunctorPythonRBase<R>
1991 FunctorPythonR2(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
1992 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2)
const
1994 LockGIL LASS_UNUSED(lock);
1995 return this->call(makeTuple(p1, p2));
1999 template <
typename R,
typename P1,
typename P2>
2000 class PyCallbackR2Impl:
public PyCallbackImplBase
2003 using TCallback = util::CallbackR2<R, P1, P2>;
2004 using TFunctor = FunctorPythonR2<R, P1, P2>;
2005 using TDispatcher = util::impl::DispatcherR2Function<R, P1, P2, TFunctor>;
2007 PyCallbackR2Impl(TCallback callback): callback_(std::move(callback)) {}
2008 const TCallback& callable()
const {
return callback_; }
2010 PyObject* call(PyObject* args)
const override
2012 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2013 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2015 if ( decodeTuple<S1, S2>(args, p1, p2) != 0 )
2019 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2));
2022 TCallback callback_;
2050template <
typename R,
typename P1,
typename P2>
2053 util::CallbackR2<R, P1, P2>,
2054 impl::PyCallbackR2Impl<R, P1, P2>,
2055 PyExportTraits< util::CallbackR2<R, P1, P2> >
2058 static constexpr const char* py_typing =
"Callable[[P1!, P2!], R!]";
2060 static const char* className() {
return "CallbackR2"; }
2069#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R3)
2070# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R3
2071# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R3
2079 template <
typename R,
typename P1,
typename P2,
typename P3>
2080 class FunctorPythonR3:
public FunctorPythonRBase<R>
2083 FunctorPythonR3(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2084 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3)
const
2086 LockGIL LASS_UNUSED(lock);
2087 return this->call(makeTuple(p1, p2, p3));
2091 template <
typename R,
typename P1,
typename P2,
typename P3>
2092 class PyCallbackR3Impl:
public PyCallbackImplBase
2095 using TCallback = util::CallbackR3<R, P1, P2, P3>;
2096 using TFunctor = FunctorPythonR3<R, P1, P2, P3>;
2097 using TDispatcher = util::impl::DispatcherR3Function<R, P1, P2, P3, TFunctor>;
2099 PyCallbackR3Impl(TCallback callback): callback_(std::move(callback)) {}
2100 const TCallback& callable()
const {
return callback_; }
2102 PyObject* call(PyObject* args)
const override
2104 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2105 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2106 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2108 if ( decodeTuple<S1, S2, S3>(args, p1, p2, p3) != 0 )
2112 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3));
2115 TCallback callback_;
2143template <
typename R,
typename P1,
typename P2,
typename P3>
2146 util::CallbackR3<R, P1, P2, P3>,
2147 impl::PyCallbackR3Impl<R, P1, P2, P3>,
2148 PyExportTraits< util::CallbackR3<R, P1, P2, P3> >
2151 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!], R!]";
2153 static const char* className() {
return "CallbackR3"; }
2162#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R4)
2163# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R4
2164# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R4
2172 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4>
2173 class FunctorPythonR4:
public FunctorPythonRBase<R>
2176 FunctorPythonR4(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2177 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4)
const
2179 LockGIL LASS_UNUSED(lock);
2180 return this->call(makeTuple(p1, p2, p3, p4));
2184 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4>
2185 class PyCallbackR4Impl:
public PyCallbackImplBase
2188 using TCallback = util::CallbackR4<R, P1, P2, P3, P4>;
2189 using TFunctor = FunctorPythonR4<R, P1, P2, P3, P4>;
2190 using TDispatcher = util::impl::DispatcherR4Function<R, P1, P2, P3, P4, TFunctor>;
2192 PyCallbackR4Impl(TCallback callback): callback_(std::move(callback)) {}
2193 const TCallback& callable()
const {
return callback_; }
2195 PyObject* call(PyObject* args)
const override
2197 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2198 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2199 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2200 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2202 if ( decodeTuple<S1, S2, S3, S4>(args, p1, p2, p3, p4) != 0 )
2206 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4));
2209 TCallback callback_;
2237template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4>
2240 util::CallbackR4<R, P1, P2, P3, P4>,
2241 impl::PyCallbackR4Impl<R, P1, P2, P3, P4>,
2242 PyExportTraits< util::CallbackR4<R, P1, P2, P3, P4> >
2245 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!], R!]";
2247 static const char* className() {
return "CallbackR4"; }
2256#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R5)
2257# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R5
2258# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R5
2266 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
2267 class FunctorPythonR5:
public FunctorPythonRBase<R>
2270 FunctorPythonR5(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2271 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5)
const
2273 LockGIL LASS_UNUSED(lock);
2274 return this->call(makeTuple(p1, p2, p3, p4, p5));
2278 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
2279 class PyCallbackR5Impl:
public PyCallbackImplBase
2282 using TCallback = util::CallbackR5<R, P1, P2, P3, P4, P5>;
2283 using TFunctor = FunctorPythonR5<R, P1, P2, P3, P4, P5>;
2284 using TDispatcher = util::impl::DispatcherR5Function<R, P1, P2, P3, P4, P5, TFunctor>;
2286 PyCallbackR5Impl(TCallback callback): callback_(std::move(callback)) {}
2287 const TCallback& callable()
const {
return callback_; }
2289 PyObject* call(PyObject* args)
const override
2291 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2292 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2293 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2294 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2295 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2297 if ( decodeTuple<S1, S2, S3, S4, S5>(args, p1, p2, p3, p4, p5) != 0 )
2301 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5));
2304 TCallback callback_;
2332template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
2335 util::CallbackR5<R, P1, P2, P3, P4, P5>,
2336 impl::PyCallbackR5Impl<R, P1, P2, P3, P4, P5>,
2337 PyExportTraits< util::CallbackR5<R, P1, P2, P3, P4, P5> >
2340 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!], R!]";
2342 static const char* className() {
return "CallbackR5"; }
2351#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R6)
2352# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R6
2353# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R6
2361 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
2362 class FunctorPythonR6:
public FunctorPythonRBase<R>
2365 FunctorPythonR6(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2366 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6)
const
2368 LockGIL LASS_UNUSED(lock);
2369 return this->call(makeTuple(p1, p2, p3, p4, p5, p6));
2373 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
2374 class PyCallbackR6Impl:
public PyCallbackImplBase
2377 using TCallback = util::CallbackR6<R, P1, P2, P3, P4, P5, P6>;
2378 using TFunctor = FunctorPythonR6<R, P1, P2, P3, P4, P5, P6>;
2379 using TDispatcher = util::impl::DispatcherR6Function<R, P1, P2, P3, P4, P5, P6, TFunctor>;
2381 PyCallbackR6Impl(TCallback callback): callback_(std::move(callback)) {}
2382 const TCallback& callable()
const {
return callback_; }
2384 PyObject* call(PyObject* args)
const override
2386 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2387 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2388 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2389 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2390 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2391 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2393 if ( decodeTuple<S1, S2, S3, S4, S5, S6>(args, p1, p2, p3, p4, p5, p6) != 0 )
2397 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6));
2400 TCallback callback_;
2428template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
2431 util::CallbackR6<R, P1, P2, P3, P4, P5, P6>,
2432 impl::PyCallbackR6Impl<R, P1, P2, P3, P4, P5, P6>,
2433 PyExportTraits< util::CallbackR6<R, P1, P2, P3, P4, P5, P6> >
2436 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!], R!]";
2438 static const char* className() {
return "CallbackR6"; }
2447#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R7)
2448# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R7
2449# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R7
2457 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
2458 class FunctorPythonR7:
public FunctorPythonRBase<R>
2461 FunctorPythonR7(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2462 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7)
const
2464 LockGIL LASS_UNUSED(lock);
2465 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7));
2469 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
2470 class PyCallbackR7Impl:
public PyCallbackImplBase
2473 using TCallback = util::CallbackR7<R, P1, P2, P3, P4, P5, P6, P7>;
2474 using TFunctor = FunctorPythonR7<R, P1, P2, P3, P4, P5, P6, P7>;
2475 using TDispatcher = util::impl::DispatcherR7Function<R, P1, P2, P3, P4, P5, P6, P7, TFunctor>;
2477 PyCallbackR7Impl(TCallback callback): callback_(std::move(callback)) {}
2478 const TCallback& callable()
const {
return callback_; }
2480 PyObject* call(PyObject* args)
const override
2482 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2483 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2484 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2485 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2486 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2487 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2488 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2490 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7>(args, p1, p2, p3, p4, p5, p6, p7) != 0 )
2494 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7));
2497 TCallback callback_;
2525template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
2528 util::CallbackR7<R, P1, P2, P3, P4, P5, P6, P7>,
2529 impl::PyCallbackR7Impl<R, P1, P2, P3, P4, P5, P6, P7>,
2530 PyExportTraits< util::CallbackR7<R, P1, P2, P3, P4, P5, P6, P7> >
2533 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!], R!]";
2535 static const char* className() {
return "CallbackR7"; }
2544#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R8)
2545# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R8
2546# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R8
2554 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
2555 class FunctorPythonR8:
public FunctorPythonRBase<R>
2558 FunctorPythonR8(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2559 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8)
const
2561 LockGIL LASS_UNUSED(lock);
2562 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8));
2566 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
2567 class PyCallbackR8Impl:
public PyCallbackImplBase
2570 using TCallback = util::CallbackR8<R, P1, P2, P3, P4, P5, P6, P7, P8>;
2571 using TFunctor = FunctorPythonR8<R, P1, P2, P3, P4, P5, P6, P7, P8>;
2572 using TDispatcher = util::impl::DispatcherR8Function<R, P1, P2, P3, P4, P5, P6, P7, P8, TFunctor>;
2574 PyCallbackR8Impl(TCallback callback): callback_(std::move(callback)) {}
2575 const TCallback& callable()
const {
return callback_; }
2577 PyObject* call(PyObject* args)
const override
2579 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2580 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2581 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2582 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2583 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2584 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2585 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2586 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
2588 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8>(args, p1, p2, p3, p4, p5, p6, p7, p8) != 0 )
2592 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8));
2595 TCallback callback_;
2623template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
2626 util::CallbackR8<R, P1, P2, P3, P4, P5, P6, P7, P8>,
2627 impl::PyCallbackR8Impl<R, P1, P2, P3, P4, P5, P6, P7, P8>,
2628 PyExportTraits< util::CallbackR8<R, P1, P2, P3, P4, P5, P6, P7, P8> >
2631 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!], R!]";
2633 static const char* className() {
return "CallbackR8"; }
2642#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R9)
2643# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R9
2644# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R9
2652 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
2653 class FunctorPythonR9:
public FunctorPythonRBase<R>
2656 FunctorPythonR9(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2657 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9)
const
2659 LockGIL LASS_UNUSED(lock);
2660 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9));
2664 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
2665 class PyCallbackR9Impl:
public PyCallbackImplBase
2668 using TCallback = util::CallbackR9<R, P1, P2, P3, P4, P5, P6, P7, P8, P9>;
2669 using TFunctor = FunctorPythonR9<R, P1, P2, P3, P4, P5, P6, P7, P8, P9>;
2670 using TDispatcher = util::impl::DispatcherR9Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, TFunctor>;
2672 PyCallbackR9Impl(TCallback callback): callback_(std::move(callback)) {}
2673 const TCallback& callable()
const {
return callback_; }
2675 PyObject* call(PyObject* args)
const override
2677 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2678 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2679 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2680 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2681 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2682 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2683 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2684 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
2685 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
2687 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9) != 0 )
2691 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9));
2694 TCallback callback_;
2722template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9>
2725 util::CallbackR9<R, P1, P2, P3, P4, P5, P6, P7, P8, P9>,
2726 impl::PyCallbackR9Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9>,
2727 PyExportTraits< util::CallbackR9<R, P1, P2, P3, P4, P5, P6, P7, P8, P9> >
2730 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!], R!]";
2732 static const char* className() {
return "CallbackR9"; }
2741#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R10)
2742# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R10
2743# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R10
2751 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
2752 class FunctorPythonR10:
public FunctorPythonRBase<R>
2755 FunctorPythonR10(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2756 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10)
const
2758 LockGIL LASS_UNUSED(lock);
2759 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10));
2763 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
2764 class PyCallbackR10Impl:
public PyCallbackImplBase
2767 using TCallback = util::CallbackR10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>;
2768 using TFunctor = FunctorPythonR10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>;
2769 using TDispatcher = util::impl::DispatcherR10Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, TFunctor>;
2771 PyCallbackR10Impl(TCallback callback): callback_(std::move(callback)) {}
2772 const TCallback& callable()
const {
return callback_; }
2774 PyObject* call(PyObject* args)
const override
2776 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2777 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2778 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2779 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2780 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2781 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2782 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2783 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
2784 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
2785 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
2787 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) != 0 )
2791 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10));
2794 TCallback callback_;
2822template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10>
2823struct PyExportTraits<
util::CallbackR10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >:
2825 util::CallbackR10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>,
2826 impl::PyCallbackR10Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>,
2827 PyExportTraits< util::CallbackR10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >
2830 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!], R!]";
2832 static const char* className() {
return "CallbackR10"; }
2841#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R11)
2842# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R11
2843# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R11
2851 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
2852 class FunctorPythonR11:
public FunctorPythonRBase<R>
2855 FunctorPythonR11(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2856 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11)
const
2858 LockGIL LASS_UNUSED(lock);
2859 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11));
2863 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
2864 class PyCallbackR11Impl:
public PyCallbackImplBase
2867 using TCallback = util::CallbackR11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>;
2868 using TFunctor = FunctorPythonR11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>;
2869 using TDispatcher = util::impl::DispatcherR11Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, TFunctor>;
2871 PyCallbackR11Impl(TCallback callback): callback_(std::move(callback)) {}
2872 const TCallback& callable()
const {
return callback_; }
2874 PyObject* call(PyObject* args)
const override
2876 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2877 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2878 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2879 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2880 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2881 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2882 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2883 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
2884 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
2885 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
2886 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
2888 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) != 0 )
2892 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11));
2895 TCallback callback_;
2923template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11>
2924struct PyExportTraits<
util::CallbackR11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >:
2926 util::CallbackR11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>,
2927 impl::PyCallbackR11Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>,
2928 PyExportTraits< util::CallbackR11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> >
2931 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!], R!]";
2933 static const char* className() {
return "CallbackR11"; }
2942#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R12)
2943# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R12
2944# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R12
2952 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
2953 class FunctorPythonR12:
public FunctorPythonRBase<R>
2956 FunctorPythonR12(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
2957 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12)
const
2959 LockGIL LASS_UNUSED(lock);
2960 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
2964 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
2965 class PyCallbackR12Impl:
public PyCallbackImplBase
2968 using TCallback = util::CallbackR12<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>;
2969 using TFunctor = FunctorPythonR12<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>;
2970 using TDispatcher = util::impl::DispatcherR12Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, TFunctor>;
2972 PyCallbackR12Impl(TCallback callback): callback_(std::move(callback)) {}
2973 const TCallback& callable()
const {
return callback_; }
2975 PyObject* call(PyObject* args)
const override
2977 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
2978 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
2979 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
2980 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
2981 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
2982 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
2983 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
2984 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
2985 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
2986 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
2987 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
2988 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
2990 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) != 0 )
2994 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12));
2997 TCallback callback_;
3025template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12>
3026struct PyExportTraits<
util::CallbackR12<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> >:
3028 util::CallbackR12<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>,
3029 impl::PyCallbackR12Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>,
3030 PyExportTraits< util::CallbackR12<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> >
3033 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!], R!]";
3035 static const char* className() {
return "CallbackR12"; }
3044#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R13)
3045# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R13
3046# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R13
3054 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
3055 class FunctorPythonR13:
public FunctorPythonRBase<R>
3058 FunctorPythonR13(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
3059 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13)
const
3061 LockGIL LASS_UNUSED(lock);
3062 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13));
3066 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
3067 class PyCallbackR13Impl:
public PyCallbackImplBase
3070 using TCallback = util::CallbackR13<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>;
3071 using TFunctor = FunctorPythonR13<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>;
3072 using TDispatcher = util::impl::DispatcherR13Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, TFunctor>;
3074 PyCallbackR13Impl(TCallback callback): callback_(std::move(callback)) {}
3075 const TCallback& callable()
const {
return callback_; }
3077 PyObject* call(PyObject* args)
const override
3079 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
3080 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
3081 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
3082 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
3083 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
3084 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
3085 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
3086 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
3087 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
3088 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
3089 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
3090 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
3091 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
3093 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) != 0 )
3097 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13));
3100 TCallback callback_;
3128template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13>
3129struct PyExportTraits<
util::CallbackR13<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> >:
3131 util::CallbackR13<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>,
3132 impl::PyCallbackR13Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>,
3133 PyExportTraits< util::CallbackR13<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13> >
3136 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!], R!]";
3138 static const char* className() {
return "CallbackR13"; }
3147#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R14)
3148# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R14
3149# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R14
3157 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
3158 class FunctorPythonR14:
public FunctorPythonRBase<R>
3161 FunctorPythonR14(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
3162 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13,
typename util::CallTraits<P14>::TParam p14)
const
3164 LockGIL LASS_UNUSED(lock);
3165 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14));
3169 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
3170 class PyCallbackR14Impl:
public PyCallbackImplBase
3173 using TCallback = util::CallbackR14<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>;
3174 using TFunctor = FunctorPythonR14<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>;
3175 using TDispatcher = util::impl::DispatcherR14Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, TFunctor>;
3177 PyCallbackR14Impl(TCallback callback): callback_(std::move(callback)) {}
3178 const TCallback& callable()
const {
return callback_; }
3180 PyObject* call(PyObject* args)
const override
3182 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
3183 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
3184 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
3185 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
3186 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
3187 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
3188 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
3189 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
3190 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
3191 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
3192 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
3193 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
3194 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
3195 typedef ArgumentTraits<P14> TArg14;
typedef typename TArg14::TStorage S14; S14 p14 = S14();
3197 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) != 0 )
3201 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13), TArg14::arg(p14));
3204 TCallback callback_;
3232template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14>
3233struct PyExportTraits<
util::CallbackR14<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> >:
3235 util::CallbackR14<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>,
3236 impl::PyCallbackR14Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>,
3237 PyExportTraits< util::CallbackR14<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14> >
3240 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!, P14!], R!]";
3242 static const char* className() {
return "CallbackR14"; }
3251#if defined(LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_R15)
3252# ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R15
3253# define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H_CALLBACK_R15
3261 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
3262 class FunctorPythonR15:
public FunctorPythonRBase<R>
3265 FunctorPythonR15(
const TPyObjPtr& callable): FunctorPythonRBase<R>(callable) {}
3266 R operator()(
typename util::CallTraits<P1>::TParam p1,
typename util::CallTraits<P2>::TParam p2,
typename util::CallTraits<P3>::TParam p3,
typename util::CallTraits<P4>::TParam p4,
typename util::CallTraits<P5>::TParam p5,
typename util::CallTraits<P6>::TParam p6,
typename util::CallTraits<P7>::TParam p7,
typename util::CallTraits<P8>::TParam p8,
typename util::CallTraits<P9>::TParam p9,
typename util::CallTraits<P10>::TParam p10,
typename util::CallTraits<P11>::TParam p11,
typename util::CallTraits<P12>::TParam p12,
typename util::CallTraits<P13>::TParam p13,
typename util::CallTraits<P14>::TParam p14,
typename util::CallTraits<P15>::TParam p15)
const
3268 LockGIL LASS_UNUSED(lock);
3269 return this->call(makeTuple(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15));
3273 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
3274 class PyCallbackR15Impl:
public PyCallbackImplBase
3277 using TCallback = util::CallbackR15<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>;
3278 using TFunctor = FunctorPythonR15<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>;
3279 using TDispatcher = util::impl::DispatcherR15Function<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, TFunctor>;
3281 PyCallbackR15Impl(TCallback callback): callback_(std::move(callback)) {}
3282 const TCallback& callable()
const {
return callback_; }
3284 PyObject* call(PyObject* args)
const override
3286 typedef ArgumentTraits<P1> TArg1;
typedef typename TArg1::TStorage S1; S1 p1 = S1();
3287 typedef ArgumentTraits<P2> TArg2;
typedef typename TArg2::TStorage S2; S2 p2 = S2();
3288 typedef ArgumentTraits<P3> TArg3;
typedef typename TArg3::TStorage S3; S3 p3 = S3();
3289 typedef ArgumentTraits<P4> TArg4;
typedef typename TArg4::TStorage S4; S4 p4 = S4();
3290 typedef ArgumentTraits<P5> TArg5;
typedef typename TArg5::TStorage S5; S5 p5 = S5();
3291 typedef ArgumentTraits<P6> TArg6;
typedef typename TArg6::TStorage S6; S6 p6 = S6();
3292 typedef ArgumentTraits<P7> TArg7;
typedef typename TArg7::TStorage S7; S7 p7 = S7();
3293 typedef ArgumentTraits<P8> TArg8;
typedef typename TArg8::TStorage S8; S8 p8 = S8();
3294 typedef ArgumentTraits<P9> TArg9;
typedef typename TArg9::TStorage S9; S9 p9 = S9();
3295 typedef ArgumentTraits<P10> TArg10;
typedef typename TArg10::TStorage S10; S10 p10 = S10();
3296 typedef ArgumentTraits<P11> TArg11;
typedef typename TArg11::TStorage S11; S11 p11 = S11();
3297 typedef ArgumentTraits<P12> TArg12;
typedef typename TArg12::TStorage S12; S12 p12 = S12();
3298 typedef ArgumentTraits<P13> TArg13;
typedef typename TArg13::TStorage S13; S13 p13 = S13();
3299 typedef ArgumentTraits<P14> TArg14;
typedef typename TArg14::TStorage S14; S14 p14 = S14();
3300 typedef ArgumentTraits<P15> TArg15;
typedef typename TArg15::TStorage S15; S15 p15 = S15();
3302 if ( decodeTuple<S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14, S15>(args, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) != 0 )
3306 return Caller<R>::template callFunction<const TCallback&>(callback_, TArg1::arg(p1), TArg2::arg(p2), TArg3::arg(p3), TArg4::arg(p4), TArg5::arg(p5), TArg6::arg(p6), TArg7::arg(p7), TArg8::arg(p8), TArg9::arg(p9), TArg10::arg(p10), TArg11::arg(p11), TArg12::arg(p12), TArg13::arg(p13), TArg14::arg(p14), TArg15::arg(p15));
3309 TCallback callback_;
3337template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15>
3338struct PyExportTraits<
util::CallbackR15<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> >:
3340 util::CallbackR15<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>,
3341 impl::PyCallbackR15Impl<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>,
3342 PyExportTraits< util::CallbackR15<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15> >
3345 static constexpr const char* py_typing =
"Callable[[P1!, P2!, P3!, P4!, P5!, P6!, P7!, P8!, P9!, P10!, P11!, P12!, P13!, P14!, P15!], R!]";
3347 static const char* className() {
return "CallbackR15"; }
acquire the GIL for the current scope.
void addMessageHeader(const char *header)
Prepend a message to the current Python exception value.
void fetchAndThrowPythonException(std::string loc)
Fetch the current Python exception and throw it as a C++ PythonException.
PyObjectPtr< PyObject >::Type TPyObjPtr
PyObjectPtr to a PyObject.
#define PY_HEADER(t_parentClass)
Place as first line of your Pythonized class.
PyObject * fromSharedPtrToNakedCast(const util::SharedPtr< T, PyObjectStorage, PyObjectCounter > &object)
fromSharedPtrToNakedCast.
Comprehensive C++ to Python binding library.
general utility, debug facilities, ...
Library for Assembled Shared Sources.
Helper class to implement PyExportTraits for Callback types.
by copy, general case assumes shadow type or PyObjectPlus based type.