Skip to content
Snippets Groups Projects
Verified Commit 27e7add1 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: add registration static method to EigenFromPy

parent 6aedd37e
No related branches found
No related tags found
No related merge requests found
Subproject commit ab4c798680d0a3ba4e84d3b7f25cc42d336eca1b Subproject commit 242dc450ae43ca2182987c9588c21e8aab32d61c
...@@ -410,6 +410,15 @@ namespace eigenpy ...@@ -410,6 +410,15 @@ namespace eigenpy
memory->convertible = storage; memory->convertible = storage;
} }
static void registration()
{
bp::converter::registry::push_back
(reinterpret_cast<void *(*)(_object *)>(&EigenFromPy::convertible),
&EigenFromPy::construct,bp::type_id<MatType>());
}
};
}; };
#define numpy_import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } } #define numpy_import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } }
...@@ -425,10 +434,7 @@ namespace eigenpy ...@@ -425,10 +434,7 @@ namespace eigenpy
{ {
static void registration() static void registration()
{ {
bp::converter::registry::push_back EigenFromPy<MatType>::registration();
(reinterpret_cast<void *(*)(_object *)>(&EigenFromPy<MatType>::convertible),
&EigenFromPy<MatType>::construct,bp::type_id<MatType>());
// Add also conversion to Eigen::MatrixBase<MatType> // Add also conversion to Eigen::MatrixBase<MatType>
bp::converter::registry::push_back bp::converter::registry::push_back
(reinterpret_cast<void *(*)(_object *)>(&EigenFromPy<MatType>::convertible), (reinterpret_cast<void *(*)(_object *)>(&EigenFromPy<MatType>::convertible),
...@@ -450,7 +456,6 @@ namespace eigenpy ...@@ -450,7 +456,6 @@ namespace eigenpy
}; };
#endif #endif
template<typename MatType> template<typename MatType>
void enableEigenPySpecific() void enableEigenPySpecific()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment