50#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYCALLBACK_EXPORT_TRAITS_H
51#define LASS_GUARDIAN_OF_INCLUSION_UTIL_PYCALLBACK_EXPORT_TRAITS_H
61 static constexpr const char* py_typing =
"Callable[[], None]";
63 typedef lass::util::MultiCallback0 TCallback;
64 typedef lass::util::Callback0 TNonMultiCallback;
65 static PyObject* build(
const lass::util::MultiCallback0& callback)
67 return new lass::python::MultiCallback(callback);
69 static int get(PyObject* obj, lass::util::MultiCallback0& callback)
71 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
73 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
74 callback = *almost->get();
80 TNonMultiCallback tempCallback;
81 int rv = pyGetSimpleObject(obj, tempCallback);
85 callback.add(tempCallback);
98 static constexpr const char* py_typing =
"Callable[[P1], None]";
100 typedef lass::util::MultiCallback1< P1 > TCallback;
101 static PyObject* build(
const TCallback& callback)
103 return new lass::python::MultiCallback(callback);
105 static int get(PyObject* obj, TCallback& callback)
107 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
109 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
110 callback = *almost->get();
120 typename P1,
typename P2
124 static constexpr const char* py_typing =
"Callable[[P1, P2], None]";
126 typedef lass::util::MultiCallback2< P1, P2 > TCallback;
127 static PyObject* build(
const TCallback& callback)
129 return new lass::python::MultiCallback(callback);
131 static int get(PyObject* obj, TCallback& callback)
133 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
135 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
136 callback = *almost->get();
146 typename P1,
typename P2,
typename P3
150 static constexpr const char* py_typing =
"Callable[[P1, P2, P3], None]";
152 typedef lass::util::MultiCallback3< P1, P2, P3 > TCallback;
153 static PyObject* build(
const TCallback& callback)
155 return new lass::python::MultiCallback(callback);
157 static int get(PyObject* obj, TCallback& callback)
159 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
161 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
162 callback = *almost->get();
172 typename P1,
typename P2,
typename P3,
typename P4
174struct PyExportTraits<lass::util::MultiCallback4< P1, P2, P3, P4 > >
176 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4], None]";
178 typedef lass::util::MultiCallback4< P1, P2, P3, P4 > TCallback;
179 static PyObject* build(
const TCallback& callback)
181 return new lass::python::MultiCallback(callback);
183 static int get(PyObject* obj, TCallback& callback)
185 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
187 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
188 callback = *almost->get();
198 typename P1,
typename P2,
typename P3,
typename P4,
typename P5
200struct PyExportTraits<lass::util::MultiCallback5< P1, P2, P3, P4, P5 > >
202 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5], None]";
204 typedef lass::util::MultiCallback5< P1, P2, P3, P4, P5 > TCallback;
205 static PyObject* build(
const TCallback& callback)
207 return new lass::python::MultiCallback(callback);
209 static int get(PyObject* obj, TCallback& callback)
211 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
213 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
214 callback = *almost->get();
224 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6
226struct PyExportTraits<lass::util::MultiCallback6< P1, P2, P3, P4, P5, P6 > >
228 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6], None]";
230 typedef lass::util::MultiCallback6< P1, P2, P3, P4, P5, P6 > TCallback;
231 static PyObject* build(
const TCallback& callback)
233 return new lass::python::MultiCallback(callback);
235 static int get(PyObject* obj, TCallback& callback)
237 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
239 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
240 callback = *almost->get();
250 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7
252struct PyExportTraits<lass::util::MultiCallback7< P1, P2, P3, P4, P5, P6, P7 > >
254 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7], None]";
256 typedef lass::util::MultiCallback7< P1, P2, P3, P4, P5, P6, P7 > TCallback;
257 static PyObject* build(
const TCallback& callback)
259 return new lass::python::MultiCallback(callback);
261 static int get(PyObject* obj, TCallback& callback)
263 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
265 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
266 callback = *almost->get();
276 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8
278struct PyExportTraits<lass::util::MultiCallback8< P1, P2, P3, P4, P5, P6, P7, P8 > >
280 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8], None]";
282 typedef lass::util::MultiCallback8< P1, P2, P3, P4, P5, P6, P7, P8 > TCallback;
283 static PyObject* build(
const TCallback& callback)
285 return new lass::python::MultiCallback(callback);
287 static int get(PyObject* obj, TCallback& callback)
289 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
291 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
292 callback = *almost->get();
302 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9
304struct PyExportTraits<lass::util::MultiCallback9< P1, P2, P3, P4, P5, P6, P7, P8, P9 > >
306 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9], None]";
308 typedef lass::util::MultiCallback9< P1, P2, P3, P4, P5, P6, P7, P8, P9 > TCallback;
309 static PyObject* build(
const TCallback& callback)
311 return new lass::python::MultiCallback(callback);
313 static int get(PyObject* obj, TCallback& callback)
315 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
317 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
318 callback = *almost->get();
328 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10
330struct PyExportTraits<lass::util::MultiCallback10< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 > >
332 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10], None]";
334 typedef lass::util::MultiCallback10< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 > TCallback;
335 static PyObject* build(
const TCallback& callback)
337 return new lass::python::MultiCallback(callback);
339 static int get(PyObject* obj, TCallback& callback)
341 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
343 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
344 callback = *almost->get();
354 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11
356struct PyExportTraits<lass::util::MultiCallback11< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 > >
358 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11], None]";
360 typedef lass::util::MultiCallback11< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 > TCallback;
361 static PyObject* build(
const TCallback& callback)
363 return new lass::python::MultiCallback(callback);
365 static int get(PyObject* obj, TCallback& callback)
367 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
369 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
370 callback = *almost->get();
380 typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12
382struct PyExportTraits<lass::util::MultiCallback12< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 > >
384 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12], None]";
386 typedef lass::util::MultiCallback12< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 > TCallback;
387 static PyObject* build(
const TCallback& callback)
389 return new lass::python::MultiCallback(callback);
391 static int get(PyObject* obj, TCallback& callback)
393 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
395 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
396 callback = *almost->get();
406 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
408struct PyExportTraits<lass::util::MultiCallback13< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13 > >
410 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13], None]";
412 typedef lass::util::MultiCallback13< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13 > TCallback;
413 static PyObject* build(
const TCallback& callback)
415 return new lass::python::MultiCallback(callback);
417 static int get(PyObject* obj, TCallback& callback)
419 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
421 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
422 callback = *almost->get();
432 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
434struct PyExportTraits<lass::util::MultiCallback14< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14 > >
436 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14], None]";
438 typedef lass::util::MultiCallback14< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14 > TCallback;
439 static PyObject* build(
const TCallback& callback)
441 return new lass::python::MultiCallback(callback);
443 static int get(PyObject* obj, TCallback& callback)
445 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
447 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
448 callback = *almost->get();
458 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
460struct PyExportTraits<lass::util::MultiCallback15< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 > >
462 static constexpr const char* py_typing =
"Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15], None]";
464 typedef lass::util::MultiCallback15< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 > TCallback;
465 static PyObject* build(
const TCallback& callback)
467 return new lass::python::MultiCallback(callback);
469 static int get(PyObject* obj, TCallback& callback)
471 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
473 lass::util::SharedPtr<TCallback>* almost =
static_cast<lass::util::SharedPtr<TCallback>*
>(
static_cast<MultiCallback*
>(obj)->raw(
false));
474 callback = *almost->get();
Comprehensive C++ to Python binding library.
Library for Assembled Shared Sources.
by copy, general case assumes shadow type or PyObjectPlus based type.