File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 77#define __eigenpy_registration_hpp__
88
99#include < boost/python.hpp>
10+ #include < boost/python/scope.hpp>
1011
1112namespace eigenpy
1213{
@@ -29,6 +30,30 @@ namespace eigenpy
2930
3031 return true ;
3132 }
33+
34+ // /
35+ // / \brief Symlink to the current scope the already registered class T.
36+ // /
37+ // / \returns true if the type T is effectively symlinked.
38+ // /
39+ // / \tparam T The type to symlink.
40+ // /
41+ template <typename T>
42+ inline bool register_symbolic_link_to_registered_type ()
43+ {
44+ namespace bp = boost::python;
45+
46+ const bp::type_info info = bp::type_id<T>();
47+ const bp::converter::registration* reg = bp::converter::registry::query (info);
48+
49+ if (check_registration<T>())
50+ {
51+ bp::scope ().attr (info.name ()) = reg->get_class_object ();
52+ return true ;
53+ }
54+
55+ return false ;
56+ }
3257}
3358
3459#endif // ifndef __eigenpy_registration_hpp__
You can’t perform that action at this time.
0 commit comments