Verified Commit 422877f4 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: add function to easy expose a type

parent 3917a9cf
......@@ -82,6 +82,7 @@ SET(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_SOLVERS_HEADERS}
include/eigenpy/eigenpy.hpp
include/eigenpy/exception.hpp
include/eigenpy/expose.hpp
include/eigenpy/details.hpp
include/eigenpy/fwd.hpp
include/eigenpy/map.hpp
......
/*
* Copyright 2019, INRIA
*/
#ifndef __eigenpy_expose_hpp__
#define __eigenpy_expose_hpp__
#include "eigenpy/registration.hpp"
namespace eigenpy
{
namespace internal
{
///
/// \brief Allows a template specialization.
///
template<typename T>
struct call_expose
{
static inline void run() { T::expose(); }
};
} // namespace internal
///
/// \brief Call the expose function of a given type T.
///
template<typename T>
inline void expose()
{
if(not register_symbolic_link_to_registered_type<T>())
internal::call_expose<T>::run();
}
}
#endif // ifndef __eigenpy_expose_hpp__
......@@ -26,5 +26,7 @@
#define EIGENPY_DEFAULT_ALIGNMENT_VALUE Eigen::Unaligned
#endif
#include "eigenpy/expose.hpp"
#endif // ifndef __eigenpy_fwd_hpp__
Supports Markdown
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