Salome HOME
Fix compilation on Linux (part 2)
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI.i
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 /* ModelHighAPI.i */
21 %module(directors="1") ModelHighAPI
22 %feature("director:except") {
23     if ($error != NULL) {
24       PyErr_Print();
25       std::cerr << std::endl;
26       throw Swig::DirectorMethodException();
27     }
28 }
29
30 %{
31   #include "ModelHighAPI_swig.h"
32
33   // fix for SWIG v2.0.4
34   #define SWIGPY_SLICE_ARG(obj) ((PyObject*)(obj))
35 %}
36
37 %include "doxyhelp.i"
38
39 // import other modules
40 %import "GeomAPI.i"
41 %import "ModelAPI.i"
42 %import "GeomDataAPI.i"
43
44 // to avoid error on this
45 #define MODELHIGHAPI_EXPORT
46
47 // standard definitions
48 %include "typemaps.i"
49 %include "std_list.i"
50 %include "std_pair.i"
51 %include "std_string.i"
52 %include "std_shared_ptr.i"
53
54 // directors
55 %feature("director") ModelHighAPI_Dumper;
56
57 // shared pointers
58 %shared_ptr(ModelHighAPI_Interface)
59 %shared_ptr(ModelHighAPI_Folder)
60
61 // typemaps
62
63 %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) {
64   if (PyFloat_Check($input) || PyLong_Check($input)) {
65     temp = ModelHighAPI_Double(PyFloat_AsDouble($input));
66     $1 = &temp;
67   } else if (PyUnicode_Check($input)) {
68     temp = ModelHighAPI_Double(PyUnicode_AsUTF8($input));
69     $1 = &temp;
70   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
71   } else {
72     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Double, float, int or string.");
73     return NULL;
74   }
75 }
76 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & {
77   $1 = ((PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
78 }
79
80 %typemap(in) const ModelHighAPI_Integer & (ModelHighAPI_Integer temp) {
81   if (PyLong_Check($input)) {
82     temp = ModelHighAPI_Integer(static_cast<int>(PyLong_AsLong($input)));
83     $1 = &temp;
84   } else if (PyUnicode_Check($input)) {
85     temp = ModelHighAPI_Integer(PyUnicode_AsUTF8($input));
86     $1 = &temp;
87   } else if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
88   } else {
89     PyErr_SetString(PyExc_ValueError, "argument must be ModelHighAPI_Integer, int or string.");
90     return NULL;
91   }
92 }
93 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Integer, const ModelHighAPI_Integer & {
94   $1 = ((PyLong_Check($input) || PyUnicode_Check($input)) && !PyBool_Check($input)) ? 1 : 0;
95 }
96
97 %typemap(in) const ModelHighAPI_RefAttr & (ModelHighAPI_RefAttr temp) {
98   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
99   std::shared_ptr<ModelAPI_Object> * temp_object;
100   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
101   ModelHighAPI_Selection* temp_selection;
102   int newmem = 0;
103   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
104     if (!temp_selection) {
105       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
106       return NULL;
107     }
108     temp = ModelHighAPI_RefAttr(std::shared_ptr<ModelAPI_Object>(temp_selection->resultSubShapePair().first));
109     if (newmem & SWIG_CAST_NEW_MEMORY) {
110       delete temp_selection;
111     }
112     $1 = &temp;
113   } else
114   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
115     if (!temp_attribute) {
116       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
117       return NULL;
118     }
119     temp = ModelHighAPI_RefAttr(*temp_attribute);
120     if (newmem & SWIG_CAST_NEW_MEMORY) {
121       delete temp_attribute;
122     }
123     $1 = &temp;
124   } else
125   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
126     if (!temp_object) {
127       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
128       return NULL;
129     }
130     temp = ModelHighAPI_RefAttr(*temp_object);
131     if (newmem & SWIG_CAST_NEW_MEMORY) {
132       delete temp_object;
133     }
134     $1 = &temp;
135   } else
136   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
137     if (!temp_interface) {
138       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
139       return NULL;
140     }
141     temp = ModelHighAPI_RefAttr(*temp_interface);
142     if (newmem & SWIG_CAST_NEW_MEMORY) {
143       delete temp_interface;
144     }
145     $1 = &temp;
146   } else
147   if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
148   } else {
149     PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_RefAttr, ModelHighAPI_Selection, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
150     return NULL;
151   }
152 }
153
154 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_RefAttr, const ModelHighAPI_RefAttr & {
155   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
156   std::shared_ptr<ModelAPI_Object> * temp_object;
157   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
158   ModelHighAPI_Selection* temp_selection;
159   int newmem = 0;
160   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
161     if (temp_attribute) {
162       $1 = 1;
163     } else {
164       $1 = 0;
165     }
166   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
167     if (temp_object) {
168       $1 = 1;
169     } else {
170       $1 = 0;
171     }
172   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
173     if (temp_interface) {
174       $1 = 1;
175     } else {
176       $1 = 0;
177     }
178   } else if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_selection, $descriptor(ModelHighAPI_Selection*), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
179     if (temp_selection) {
180       $1 = 1;
181     } else {
182       $1 = 0;
183     }
184   } else {
185     $1 = 0;
186   }
187 }
188
189 %typemap(in) const ModelHighAPI_Reference & (ModelHighAPI_Reference temp) {
190   std::shared_ptr<ModelAPI_Object> * temp_object;
191   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
192   int newmem = 0;
193   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
194     if (!temp_object) {
195       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
196       return NULL;
197     }
198     temp = ModelHighAPI_Reference(*temp_object);
199     if (newmem & SWIG_CAST_NEW_MEMORY) {
200       delete temp_object;
201     }
202     $1 = &temp;
203   } else
204   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
205     if (!temp_interface) {
206       PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
207       return NULL;
208     }
209     temp = ModelHighAPI_Reference(*temp_interface);
210     if (newmem & SWIG_CAST_NEW_MEMORY) {
211       delete temp_interface;
212     }
213     $1 = &temp;
214   } else
215   if ((SWIG_ConvertPtr($input, (void **)&$1, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
216   } else {
217     PyErr_SetString(PyExc_TypeError, "argument must be ModelHighAPI_Interface or ModelAPI_Object.");
218     return NULL;
219   }
220 }
221
222 %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Reference, const ModelHighAPI_Reference & {
223   std::shared_ptr<ModelAPI_Object> * temp_object;
224   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
225   int newmem = 0;
226   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
227     if (temp_object) {
228       $1 = 1;
229     } else {
230       $1 = 0;
231     }
232   } else
233   if ((SWIG_ConvertPtrAndOwn($input, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
234     if (temp_interface) {
235       $1 = 1;
236     } else {
237       $1 = 0;
238     }
239   } else {
240     $1 = 0;
241   }
242 }
243
244 %typemap(out) const ModelHighAPI_Selection & {
245   $1_basetype * ptr = new $1_basetype(*$1);
246   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
247 }
248
249 %typemap(out) const ModelHighAPI_Reference & {
250   $1_basetype * ptr = new $1_basetype(*$1);
251   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
252 }
253
254 %typemap(out) const ModelHighAPI_RefAttr & {
255   $1_basetype * ptr = new $1_basetype(*$1);
256   $result = SWIG_NewPointerObj( (void*) ptr, $1_descriptor, 1 );
257 }
258
259 // std::list -> []
260 %template(SelectionList) std::list<ModelHighAPI_Selection>;
261 %template(SelectionListList) std::list<std::list<ModelHighAPI_Selection> >;
262 %template(RefAttrList) std::list<ModelHighAPI_RefAttr>;
263 %template(RefList) std::list<ModelHighAPI_Reference>;
264 %template(DoubleAPIList) std::list<ModelHighAPI_Double>;
265 %template(IntegerAPIList) std::list<ModelHighAPI_Integer>;
266
267 // std::pair -> []
268 %template(ResultSubShapePair) std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >;
269 %template(StringsPair) std::pair<std::string, std::string>;
270
271
272 // fix compilarion error: 'res*' was not declared in this scope
273 %typemap(freearg) const std::list<ModelHighAPI_RefAttr> & {}
274 %typemap(freearg) const std::list<std::shared_ptr<ModelAPI_Object> > & {}
275 %typemap(freearg) const std::list<ModelHighAPI_Double> & {}
276 %typemap(freearg) const std::list<ModelHighAPI_Integer> & {}
277
278 %typemap(in) const std::list<ModelHighAPI_RefAttr> & (std::list<ModelHighAPI_RefAttr> temp) {
279   std::shared_ptr<ModelAPI_Attribute> * temp_attribute;
280   int newmem = 0;
281   if (PySequence_Check($input)) {
282     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
283       PyObject * item = PySequence_GetItem($input, i);
284       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_attribute, $descriptor(std::shared_ptr<ModelAPI_Attribute> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
285         if (!temp_attribute) {
286           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
287           return NULL;
288         }
289         temp.push_back(ModelHighAPI_RefAttr(*temp_attribute));
290         if (newmem & SWIG_CAST_NEW_MEMORY) {
291           delete temp_attribute;
292         }
293       }
294       Py_DECREF(item);
295     }
296     $1 = &temp;
297   } else {
298     PyErr_SetString(PyExc_ValueError, "argument must be list of ModelHighAPI_RefAttr, ModelHighAPI_Interface, ModelAPI_Attribute or ModelAPI_Object.");
299     return NULL;
300   }
301 }
302
303 %typemap(in) const std::list<std::shared_ptr<ModelAPI_Object> > & (std::list<std::shared_ptr<ModelAPI_Object> > temp) {
304   std::shared_ptr<ModelAPI_Object> * temp_object;
305   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
306   int newmem = 0;
307   if (PySequence_Check($input)) {
308     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
309       PyObject * item = PySequence_GetItem($input, i);
310       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
311         if (!temp_object) {
312           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
313           return NULL;
314         }
315         temp.push_back(*temp_object);
316         if (newmem & SWIG_CAST_NEW_MEMORY) {
317           delete temp_object;
318         }
319       } else
320       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
321         if (!temp_interface) {
322           PyErr_SetString(PyExc_TypeError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
323           return NULL;
324         }
325         temp.push_back((*temp_interface)->defaultResult());
326         if (newmem & SWIG_CAST_NEW_MEMORY) {
327           delete temp_interface;
328         }
329       }
330       Py_DECREF(item);
331     }
332     $1 = &temp;
333   } else {
334     PyErr_SetString(PyExc_ValueError, "argument must be list of ModelHighAPI_Interface or ModelAPI_Object.");
335     return NULL;
336   }
337 }
338
339 %typecheck(SWIG_TYPECHECK_POINTER) std::list<std::shared_ptr<ModelAPI_Object> >, const std::list<std::shared_ptr<ModelAPI_Object> >& {
340   std::shared_ptr<ModelAPI_Object> * temp_object;
341   std::shared_ptr<ModelHighAPI_Interface> * temp_interface;
342   int newmem = 0;
343   if (PySequence_Check($input)) {
344     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
345       PyObject * item = PySequence_GetItem($input, i);
346       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_object, $descriptor(std::shared_ptr<ModelAPI_Object> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
347         if (temp_object) {
348           $1 = 1;
349         } else {
350           $1 = 0;
351           break;
352         }
353       } else
354       if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_interface, $descriptor(std::shared_ptr<ModelHighAPI_Interface> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
355         if (temp_interface) {
356           $1 = 1;
357         } else {
358           $1 = 0;
359           break;
360         }
361       }
362       Py_DECREF(item);
363     }
364   } else {
365     $1 = 0;
366   }
367 }
368
369
370 %typemap(in) const std::list<int> & (std::list<int> temp) {
371   int newmem = 0;
372   if (PySequence_Check($input)) {
373     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
374       PyObject * item = PySequence_GetItem($input, i);
375       if (PyLong_Check(item)) {
376         temp.push_back((int)PyLong_AsLong(item));
377       } else {
378         PyErr_SetString(PyExc_TypeError, "argument must integet value.");
379         return NULL;
380       }
381       Py_DECREF(item);
382     }
383     $1 = &temp;
384   } else {
385     PyErr_SetString(PyExc_ValueError, "argument must be a tuple of integer values.");
386     return NULL;
387   }
388 }
389
390 %typecheck(SWIG_TYPECHECK_POINTER) std::list<int>, const std::list<int>& {
391   int newmem = 0;
392   if (PySequence_Check($input)) {
393     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
394       PyObject * item = PySequence_GetItem($input, i);
395       if (PyLong_Check(item)) {
396         $1 = 1;
397       } else {
398         $1 = 0;
399         break;
400       }
401       Py_DECREF(item);
402     }
403   } else {
404     $1 = 0;
405   }
406 }
407
408
409 %typemap(in) const std::list<double> & (std::list<double> temp) {
410   int newmem = 0;
411   if (PyTuple_Check($input)) {
412     for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) {
413       PyObject * item = PySequence_GetItem($input, i);
414       if (PyNumber_Check(item)) {
415         temp.push_back((double)PyFloat_AsDouble(item));
416       } else {
417         PyErr_SetString(PyExc_TypeError, "argument must double value.");
418         return NULL;
419       }
420       Py_DECREF(item);
421     }
422     $1 = &temp;
423   } else {
424     PyErr_SetString(PyExc_ValueError, "argument must be a tuple of double values.");
425     return NULL;
426   }
427 }
428
429 %typecheck(SWIG_TYPECHECK_POINTER) std::list<double>, const std::list<double>& {
430   int newmem = 0;
431   if (PyTuple_Check($input)) {
432     for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) {
433       PyObject * item = PySequence_GetItem($input, i);
434       if (PyNumber_Check(item)) {
435         $1 = 1;
436       } else {
437         $1 = 0;
438         break;
439       }
440       Py_DECREF(item);
441     }
442   } else {
443     $1 = 0;
444   }
445 }
446
447
448 %typemap(in) const std::list<ModelHighAPI_Double> & (std::list<ModelHighAPI_Double> temp) {
449   ModelHighAPI_Double * temp_double;
450   if (PySequence_Check($input)) {
451     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
452       PyObject * item = PySequence_GetItem($input, i);
453       if (PyFloat_Check(item) || PyLong_Check(item)) {
454         temp.push_back(ModelHighAPI_Double(PyFloat_AsDouble(item)));
455       } else if (PyUnicode_Check(item)) {
456         temp.push_back(ModelHighAPI_Double(PyUnicode_AsUTF8(item)));
457       } else if ((SWIG_ConvertPtr(item, (void **)&temp_double, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
458         temp.push_back(*temp_double);
459       } else {
460         PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Double, float, int or string.");
461         return NULL;
462       }
463       Py_DECREF(item);
464     }
465     $1 = &temp;
466   } else {
467     PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Double, float, int or string.");
468     return NULL;
469   }
470 }
471
472 %typecheck(SWIG_TYPECHECK_POINTER) std::list<ModelHighAPI_Double>, const std::list<ModelHighAPI_Double> & {
473   if (PySequence_Check($input)) {
474     $1 = 1;
475     for (Py_ssize_t i = 0; i < PySequence_Size($input) && $1; ++i) {
476       PyObject * item = PySequence_GetItem($input, i);
477       $1 = ((PyFloat_Check(item) || PyLong_Check(item) || PyUnicode_Check(item)) && !PyBool_Check(item)) ? 1 : 0;
478       Py_DECREF(item);
479     }
480   } else {
481     $1 = 0;
482   }
483 }
484
485
486 %typemap(in) const std::list<ModelHighAPI_Integer> & (std::list<ModelHighAPI_Integer> temp) {
487   ModelHighAPI_Integer * temp_int;
488   if (PySequence_Check($input)) {
489     for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
490       PyObject * item = PySequence_GetItem($input, i);
491       if (PyLong_Check(item)) {
492         temp.push_back(ModelHighAPI_Integer(PyLong_AsLong(item)));
493       } else if (PyUnicode_Check(item)) {
494         temp.push_back(ModelHighAPI_Integer(PyUnicode_AsUTF8(item)));
495       } else if ((SWIG_ConvertPtr(item, (void **)&temp_int, $1_descriptor, SWIG_POINTER_EXCEPTION)) == 0) {
496         temp.push_back(*temp_int);
497       } else {
498         PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Integer, int or string.");
499         return NULL;
500       }
501       Py_DECREF(item);
502     }
503     $1 = &temp;
504   } else {
505     PyErr_SetString(PyExc_ValueError, "argument must be a list of ModelHighAPI_Integer, int or string.");
506     return NULL;
507   }
508 }
509
510 %typecheck(SWIG_TYPECHECK_POINTER) std::list<ModelHighAPI_Integer>, const std::list<ModelHighAPI_Integer> & {
511   if (PySequence_Check($input)) {
512     $1 = 1;
513     for (Py_ssize_t i = 0; i < PySequence_Size($input) && $1; ++i) {
514       PyObject * item = PySequence_GetItem($input, i);
515       $1 = ((PyLong_Check(item) || PyUnicode_Check(item)) && !PyBool_Check(item)) ? 1 : 0;
516       Py_DECREF(item);
517     }
518   } else {
519     $1 = 0;
520   }
521 }
522
523
524 // all supported interfaces
525 %include "ModelHighAPI_Double.h"
526 %include "ModelHighAPI_Dumper.h"
527 %include "ModelHighAPI_Integer.h"
528 %include "ModelHighAPI_Interface.h"
529 %include "ModelHighAPI_Folder.h"
530 %include "ModelHighAPI_RefAttr.h"
531 %include "ModelHighAPI_Reference.h"
532 %include "ModelHighAPI_Selection.h"
533 %include "ModelHighAPI_Services.h"
534 %include "ModelHighAPI_Macro.h"
535 %include "ModelHighAPI_Tools.h"