eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
Loading...
Searching...
No Matches
swig.hpp
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
10namespace eigenpy {
12 PyObject_HEAD void* ptr;
13 const char* desc;
14};
15
16inline PySwigObject* get_PySwigObject(PyObject* pyObj) {
17 if (!PyObject_HasAttrString(pyObj, "this")) return NULL;
18
19 PyObject* this_ptr = PyObject_GetAttrString(pyObj, "this");
20 if (this_ptr == NULL) return NULL;
21 PySwigObject* swig_obj = reinterpret_cast<PySwigObject*>(this_ptr);
22
23 return swig_obj;
24}
25} // namespace eigenpy
26
27#endif // ifndef __eigenpy_swig_hpp__