diff --git a/include/eigenpy/user-type.hpp b/include/eigenpy/user-type.hpp index a9b0ece59..8c1948866 100644 --- a/include/eigenpy/user-type.hpp +++ b/include/eigenpy/user-type.hpp @@ -289,6 +289,28 @@ namespace eigenpy return true; } + + /// \brief Get the class object for a wrapped type that has been exposed + /// through Boost.Python. + template + boost::python::object getInstanceClass() + { + // Query into the registry for type T. + namespace bp = boost::python; + bp::type_info type = bp::type_id(); + const bp::converter::registration* registration = + bp::converter::registry::query(type); + + // If the class is not registered, return None. + if (!registration) { + //std::cerr<<"Class Not Registered. Returning Empty."< handle(bp::borrowed(registration->get_class_object())); + return bp::object(handle); + } + template int registerNewType(PyTypeObject * py_type_ptr = NULL) {