Skip to content

Commit

Permalink
core: avoid duplicate registration
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent committed Sep 3, 2024
1 parent e576541 commit 6552b9a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/type_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
#include <boost/python.hpp>
#include <boost/type_index.hpp>

#include "eigenpy/registration.hpp"

namespace bp = boost::python;

namespace eigenpy {

void exposeStdTypeIndex() {
typedef std::type_index Self;
if (register_symbolic_link_to_registered_type<Self>()) return;

bp::class_<Self>(
"std_type_index",
"The class type_index holds implementation-specific information about a "
Expand Down Expand Up @@ -42,6 +48,8 @@ void exposeStdTypeIndex() {

void exposeBoostTypeIndex() {
typedef boost::typeindex::type_index Self;
if (register_symbolic_link_to_registered_type<Self>()) return;

bp::class_<Self>(
"boost_type_index",
"The class type_index holds implementation-specific information about a "
Expand All @@ -66,7 +74,6 @@ void exposeBoostTypeIndex() {
"Human readible name.");
}

namespace eigenpy {
void exposeTypeInfo() {
exposeStdTypeIndex();
exposeBoostTypeIndex();
Expand Down

0 comments on commit 6552b9a

Please sign in to comment.