File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ SET(${PROJECT_NAME}_HEADERS
128128 include /eigenpy/ufunc.hpp
129129 include /eigenpy/register.hpp
130130 include /eigenpy/stride .hpp
131+ include /eigenpy/swig.hpp
131132 include /eigenpy/version .hpp
132133)
133134
Original file line number Diff line number Diff line change 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__
You can’t perform that action at this time.
0 commit comments