.. _program_listing_file__tmp_ws_src_eigenpy_include_eigenpy_registration.hpp: Program Listing for File registration.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/eigenpy/include/eigenpy/registration.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright 2014-2019, CNRS * Copyright 2018-2019, INRIA */ #ifndef __eigenpy_registration_hpp__ #define __eigenpy_registration_hpp__ #include "eigenpy/fwd.hpp" #include "eigenpy/registration_class.hpp" namespace eigenpy { template inline bool check_registration() { const bp::type_info info = bp::type_id(); const bp::converter::registration* reg = bp::converter::registry::query(info); if (reg == NULL) return false; else if ((*reg).m_to_python == NULL) return false; return true; } template inline bool register_symbolic_link_to_registered_type() { if (eigenpy::check_registration()) { const bp::type_info info = bp::type_id(); const bp::converter::registration* reg = bp::converter::registry::query(info); bp::handle<> class_obj(reg->get_class_object()); bp::scope().attr(reg->get_class_object()->tp_name) = bp::object(class_obj); return true; } return false; } template inline bool register_symbolic_link_to_registered_type(const Visitor& visitor) { if (eigenpy::check_registration()) { const bp::type_info info = bp::type_id(); const bp::converter::registration* reg = bp::converter::registry::query(info); bp::handle<> class_obj(reg->get_class_object()); bp::object object(class_obj); bp::scope().attr(reg->get_class_object()->tp_name) = object; registration_class cl(object); cl.def(visitor); return true; } return false; } } // namespace eigenpy #endif // ifndef __eigenpy_registration_hpp__