/tags/rel-1-3-24/SWIG/Examples/python/swigrun/example.cxx

# · C++ · 23 lines · 17 code · 5 blank · 1 comment · 3 complexity · 6ff1782bf2acdf20c0a1dace6561b103 MD5 · raw file

  1. /* File : example.cxx */
  2. #include <Python.h>
  3. #include "swigrun.swg"
  4. #include "pyrun.swg"
  5. #include "runtime.swg"
  6. #include "example.h"
  7. Manager* convert_to_Manager(PyObject *py_obj)
  8. {
  9. Manager* c_ptr;
  10. swig_type_info *ty = SWIG_TypeQuery("Manager *");
  11. printf("manager ty %x \n", ty);
  12. if (SWIG_ConvertPtr(py_obj, (void **) &c_ptr, ty, 0) == -1) {
  13. c_ptr = 0;
  14. } else {
  15. Py_XINCREF(py_obj);
  16. }
  17. return c_ptr;
  18. }