Library of Assembled Shared Sources
pycallback_export_traits.inl
Go to the documentation of this file.
1/*
2 * *** ATTENTION! DO NOT MODIFY THIS FILE DIRECTLY! ***
3 *
4 * It has automatically been generated from pycallback_export_traits.tmpl.inl
5 * by param_expander.py on Tue Oct 7 01:22:05 2025.
6 */
7
8/** @file
9 * @author Bram de Greve (bram@cocamware.com)
10 * @author Tom De Muer (tom@cocamware.com)
11 *
12 * *** BEGIN LICENSE INFORMATION ***
13 *
14 * The contents of this file are subject to the Common Public Attribution License
15 * Version 1.0 (the "License"); you may not use this file except in compliance with
16 * the License. You may obtain a copy of the License at
17 * http://lass.sourceforge.net/cpal-license. The License is based on the
18 * Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover
19 * use of software over a computer network and provide for limited attribution for
20 * the Original Developer. In addition, Exhibit A has been modified to be consistent
21 * with Exhibit B.
22 *
23 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
24 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
25 * language governing rights and limitations under the License.
26 *
27 * The Original Code is LASS - Library of Assembled Shared Sources.
28 *
29 * The Initial Developer of the Original Code is Bram de Greve and Tom De Muer.
30 * The Original Developer is the Initial Developer.
31 *
32 * All portions of the code written by the Initial Developer are:
33 * Copyright (C) 2004-2025 the Initial Developer.
34 * All Rights Reserved.
35 *
36 * Contributor(s):
37 *
38 * Alternatively, the contents of this file may be used under the terms of the
39 * GNU General Public License Version 2 or later (the GPL), in which case the
40 * provisions of GPL are applicable instead of those above. If you wish to allow use
41 * of your version of this file only under the terms of the GPL and not to allow
42 * others to use your version of this file under the CPAL, indicate your decision by
43 * deleting the provisions above and replace them with the notice and other
44 * provisions required by the GPL License. If you do not delete the provisions above,
45 * a recipient may use your version of this file under either the CPAL or the GPL.
46 *
47 * *** END LICENSE INFORMATION ***
48 */
49
50#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYCALLBACK_EXPORT_TRAITS_H
51#define LASS_GUARDIAN_OF_INCLUSION_UTIL_PYCALLBACK_EXPORT_TRAITS_H
52
53namespace lass
54{
55namespace python
56{
57
58template <>
59struct PyExportTraits<lass::util::MultiCallback0>
60{
61 static constexpr const char* py_typing = "Callable[[], None]";
62
63 typedef lass::util::MultiCallback0 TCallback;
64 typedef lass::util::Callback0 TNonMultiCallback;
65 static PyObject* build(const lass::util::MultiCallback0& callback)
66 {
67 return new lass::python::MultiCallback(callback);
68 }
69 static int get(PyObject* obj, lass::util::MultiCallback0& callback)
70 {
71 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
72 {
73 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
74 callback = *almost->get();
75 return 0;
76 }
77 // see if we can convert from a callable object into a regular callback and add that
78 // to the multi-callback
79
80 TNonMultiCallback tempCallback;
81 int rv = pyGetSimpleObject(obj, tempCallback);
82 if (rv)
83 return rv;
84 callback.reset();
85 callback.add(tempCallback);
86 return 0;
87 }
88};
89
90
91
92template
93<
94 typename P1
95>
96struct PyExportTraits<lass::util::MultiCallback1< P1 > >
97{
98 static constexpr const char* py_typing = "Callable[[P1], None]";
99
100 typedef lass::util::MultiCallback1< P1 > TCallback;
101 static PyObject* build(const TCallback& callback)
102 {
103 return new lass::python::MultiCallback(callback);
104 }
105 static int get(PyObject* obj, TCallback& callback)
106 {
107 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
108 {
109 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
110 callback = *almost->get();
111 return 0;
112 }
113 // add error handling code
114 return 1;
115 }
116};
117
118template
119<
120 typename P1, typename P2
121>
122struct PyExportTraits<lass::util::MultiCallback2< P1, P2 > >
123{
124 static constexpr const char* py_typing = "Callable[[P1, P2], None]";
125
126 typedef lass::util::MultiCallback2< P1, P2 > TCallback;
127 static PyObject* build(const TCallback& callback)
128 {
129 return new lass::python::MultiCallback(callback);
130 }
131 static int get(PyObject* obj, TCallback& callback)
132 {
133 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
134 {
135 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
136 callback = *almost->get();
137 return 0;
138 }
139 // add error handling code
140 return 1;
141 }
142};
143
144template
145<
146 typename P1, typename P2, typename P3
147>
148struct PyExportTraits<lass::util::MultiCallback3< P1, P2, P3 > >
149{
150 static constexpr const char* py_typing = "Callable[[P1, P2, P3], None]";
151
152 typedef lass::util::MultiCallback3< P1, P2, P3 > TCallback;
153 static PyObject* build(const TCallback& callback)
154 {
155 return new lass::python::MultiCallback(callback);
156 }
157 static int get(PyObject* obj, TCallback& callback)
158 {
159 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
160 {
161 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
162 callback = *almost->get();
163 return 0;
164 }
165 // add error handling code
166 return 1;
167 }
168};
169
170template
171<
172 typename P1, typename P2, typename P3, typename P4
173>
174struct PyExportTraits<lass::util::MultiCallback4< P1, P2, P3, P4 > >
175{
176 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4], None]";
177
178 typedef lass::util::MultiCallback4< P1, P2, P3, P4 > TCallback;
179 static PyObject* build(const TCallback& callback)
180 {
181 return new lass::python::MultiCallback(callback);
182 }
183 static int get(PyObject* obj, TCallback& callback)
184 {
185 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
186 {
187 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
188 callback = *almost->get();
189 return 0;
190 }
191 // add error handling code
192 return 1;
193 }
194};
195
196template
197<
198 typename P1, typename P2, typename P3, typename P4, typename P5
199>
200struct PyExportTraits<lass::util::MultiCallback5< P1, P2, P3, P4, P5 > >
201{
202 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5], None]";
203
204 typedef lass::util::MultiCallback5< P1, P2, P3, P4, P5 > TCallback;
205 static PyObject* build(const TCallback& callback)
206 {
207 return new lass::python::MultiCallback(callback);
208 }
209 static int get(PyObject* obj, TCallback& callback)
210 {
211 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
212 {
213 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
214 callback = *almost->get();
215 return 0;
216 }
217 // add error handling code
218 return 1;
219 }
220};
221
222template
223<
224 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6
225>
226struct PyExportTraits<lass::util::MultiCallback6< P1, P2, P3, P4, P5, P6 > >
227{
228 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6], None]";
229
230 typedef lass::util::MultiCallback6< P1, P2, P3, P4, P5, P6 > TCallback;
231 static PyObject* build(const TCallback& callback)
232 {
233 return new lass::python::MultiCallback(callback);
234 }
235 static int get(PyObject* obj, TCallback& callback)
236 {
237 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
238 {
239 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
240 callback = *almost->get();
241 return 0;
242 }
243 // add error handling code
244 return 1;
245 }
246};
247
248template
249<
250 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7
251>
252struct PyExportTraits<lass::util::MultiCallback7< P1, P2, P3, P4, P5, P6, P7 > >
253{
254 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7], None]";
255
256 typedef lass::util::MultiCallback7< P1, P2, P3, P4, P5, P6, P7 > TCallback;
257 static PyObject* build(const TCallback& callback)
258 {
259 return new lass::python::MultiCallback(callback);
260 }
261 static int get(PyObject* obj, TCallback& callback)
262 {
263 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
264 {
265 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
266 callback = *almost->get();
267 return 0;
268 }
269 // add error handling code
270 return 1;
271 }
272};
273
274template
275<
276 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8
277>
278struct PyExportTraits<lass::util::MultiCallback8< P1, P2, P3, P4, P5, P6, P7, P8 > >
279{
280 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8], None]";
281
282 typedef lass::util::MultiCallback8< P1, P2, P3, P4, P5, P6, P7, P8 > TCallback;
283 static PyObject* build(const TCallback& callback)
284 {
285 return new lass::python::MultiCallback(callback);
286 }
287 static int get(PyObject* obj, TCallback& callback)
288 {
289 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
290 {
291 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
292 callback = *almost->get();
293 return 0;
294 }
295 // add error handling code
296 return 1;
297 }
298};
299
300template
301<
302 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9
303>
304struct PyExportTraits<lass::util::MultiCallback9< P1, P2, P3, P4, P5, P6, P7, P8, P9 > >
305{
306 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9], None]";
307
308 typedef lass::util::MultiCallback9< P1, P2, P3, P4, P5, P6, P7, P8, P9 > TCallback;
309 static PyObject* build(const TCallback& callback)
310 {
311 return new lass::python::MultiCallback(callback);
312 }
313 static int get(PyObject* obj, TCallback& callback)
314 {
315 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
316 {
317 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
318 callback = *almost->get();
319 return 0;
320 }
321 // add error handling code
322 return 1;
323 }
324};
325
326template
327<
328 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10
329>
330struct PyExportTraits<lass::util::MultiCallback10< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 > >
331{
332 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10], None]";
333
334 typedef lass::util::MultiCallback10< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 > TCallback;
335 static PyObject* build(const TCallback& callback)
336 {
337 return new lass::python::MultiCallback(callback);
338 }
339 static int get(PyObject* obj, TCallback& callback)
340 {
341 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
342 {
343 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
344 callback = *almost->get();
345 return 0;
346 }
347 // add error handling code
348 return 1;
349 }
350};
351
352template
353<
354 typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11
355>
356struct PyExportTraits<lass::util::MultiCallback11< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 > >
357{
358 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11], None]";
359
360 typedef lass::util::MultiCallback11< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 > TCallback;
361 static PyObject* build(const TCallback& callback)
362 {
363 return new lass::python::MultiCallback(callback);
364 }
365 static int get(PyObject* obj, TCallback& callback)
366 {
367 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
368 {
369 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
370 callback = *almost->get();
371 return 0;
372 }
373 // add error handling code
374 return 1;
375 }
376};
377
378template
379<
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
381>
382struct PyExportTraits<lass::util::MultiCallback12< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 > >
383{
384 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12], None]";
385
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)
388 {
389 return new lass::python::MultiCallback(callback);
390 }
391 static int get(PyObject* obj, TCallback& callback)
392 {
393 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
394 {
395 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
396 callback = *almost->get();
397 return 0;
398 }
399 // add error handling code
400 return 1;
401 }
402};
403
404template
405<
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
407>
408struct PyExportTraits<lass::util::MultiCallback13< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13 > >
409{
410 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13], None]";
411
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)
414 {
415 return new lass::python::MultiCallback(callback);
416 }
417 static int get(PyObject* obj, TCallback& callback)
418 {
419 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
420 {
421 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
422 callback = *almost->get();
423 return 0;
424 }
425 // add error handling code
426 return 1;
427 }
428};
429
430template
431<
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
433>
434struct PyExportTraits<lass::util::MultiCallback14< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14 > >
435{
436 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14], None]";
437
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)
440 {
441 return new lass::python::MultiCallback(callback);
442 }
443 static int get(PyObject* obj, TCallback& callback)
444 {
445 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
446 {
447 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
448 callback = *almost->get();
449 return 0;
450 }
451 // add error handling code
452 return 1;
453 }
454};
455
456template
457<
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
459>
460struct PyExportTraits<lass::util::MultiCallback15< P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 > >
461{
462 static constexpr const char* py_typing = "Callable[[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15], None]";
463
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)
466 {
467 return new lass::python::MultiCallback(callback);
468 }
469 static int get(PyObject* obj, TCallback& callback)
470 {
471 if (obj->ob_type == MultiCallback::_lassPyClassDef.type())
472 {
473 lass::util::SharedPtr<TCallback>* almost = static_cast<lass::util::SharedPtr<TCallback>*>(static_cast<MultiCallback*>(obj)->raw(false));
474 callback = *almost->get();
475 return 0;
476 }
477 // add error handling code
478 return 1;
479 }
480};
481
482
483}
484}
485
486#endif
487
488// EOF
Comprehensive C++ to Python binding library.
Library for Assembled Shared Sources.
Definition config.h:53
by copy, general case assumes shadow type or PyObjectPlus based type.