PageRenderTime 37ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/python/swigrun/example.cxx

#
C++ | 20 lines | 15 code | 4 blank | 1 comment | 3 complexity | d8521b3b4852f90be6e595246a175536 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : example.cxx */
  2. #include <Python.h>
  3. #include "swigpyrun.h"
  4. #include "example.h"
  5. Manager* convert_to_Manager(PyObject *py_obj)
  6. {
  7. Manager* c_ptr;
  8. swig_type_info *ty = SWIG_TypeQuery("Manager *");
  9. printf("manager ty %p \n", ty);
  10. if (SWIG_ConvertPtr(py_obj, (void **) &c_ptr, ty, 0) == -1) {
  11. c_ptr = 0;
  12. } else {
  13. Py_XINCREF(py_obj);
  14. }
  15. return c_ptr;
  16. }