Commit 5bd8ef10 authored by Justin Carpentier's avatar Justin Carpentier

all: define struct call for common expose

parent 56d706a7
......@@ -19,18 +19,15 @@ namespace eigenpy
template<typename AngleAxis> class AngleAxisVisitor;
namespace internal
template<typename Scalar>
struct call< Eigen::AngleAxis<Scalar> >
{
template<typename Scalar>
struct call_expose< Eigen::AngleAxis<Scalar> >
typedef Eigen::AngleAxis<Scalar> AngleAxis;
static inline void expose()
{
typedef Eigen::AngleAxis<Scalar> type;
static inline void run()
{
AngleAxisVisitor<type>::expose();
}
};
} // namespace internal
AngleAxisVisitor<AngleAxis>::expose();
}
};
template<typename AngleAxis>
class AngleAxisVisitor
......
/*
* Copyright 2019, INRIA
* Copyright 2019 INRIA
*/
#ifndef __eigenpy_expose_hpp__
......@@ -9,18 +9,15 @@
namespace eigenpy
{
namespace internal
///
/// \brief Allows a template specialization.
///
template<typename T>
struct call
{
///
/// \brief Allows a template specialization.
///
template<typename T>
struct call_expose
{
static inline void run() { T::expose(); }
};
} // namespace internal
static inline void expose() { T::expose(); }
};
///
/// \brief Call the expose function of a given type T.
///
......@@ -28,7 +25,7 @@ namespace eigenpy
inline void expose()
{
if(!register_symbolic_link_to_registered_type<T>())
internal::call_expose<T>::run();
call<T>::expose();
}
}
......
......@@ -31,19 +31,16 @@ namespace eigenpy
template<typename QuaternionDerived> class QuaternionVisitor;
namespace internal
template<typename Scalar, int Options>
struct call< Eigen::Quaternion<Scalar,Options> >
{
template<typename Scalar, int Options>
struct call_expose< Eigen::Quaternion<Scalar,Options> >
typedef Eigen::Quaternion<Scalar,Options> Quaternion;
static inline void expose()
{
typedef Eigen::Quaternion<Scalar,Options> type;
static inline void run()
{
QuaternionVisitor<type>::expose();
}
};
} // namespace internal
QuaternionVisitor<Quaternion>::expose();
}
};
template<typename Quaternion>
class QuaternionVisitor
: public bp::def_visitor< QuaternionVisitor<Quaternion> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment