swig.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 INRIA
3 //
4 
5 #ifndef __eigenpy_swig_hpp__
6 #define __eigenpy_swig_hpp__
7 
8 #include "eigenpy/fwd.hpp"
9 
10 namespace eigenpy
11 {
12  struct PySwigObject
13  {
14  PyObject_HEAD
15  void * ptr;
16  const char * desc;
17  };
18 
19  inline PySwigObject * get_PySwigObject(PyObject * pyObj)
20  {
21  if(!PyObject_HasAttrString(pyObj,"this"))
22  return NULL;
23 
24  PyObject * this_ptr = PyObject_GetAttrString(pyObj,"this");
25  if(this_ptr == NULL)
26  return NULL;
27  PySwigObject * swig_obj = reinterpret_cast<PySwigObject*>(this_ptr);
28 
29  return swig_obj;
30  }
31 }
32 
33 #endif // ifndef __eigenpy_swig_hpp__
PySwigObject * get_PySwigObject(PyObject *pyObj)
Definition: swig.hpp:19
PyObject_HEAD void * ptr
Definition: swig.hpp:15
const char * desc
Definition: swig.hpp:16


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Apr 17 2021 02:37:59