5 #ifndef __pinocchio_check_hpp__
6 #define __pinocchio_check_hpp__
10 #include <boost/fusion/container/list.hpp>
11 #include <boost/fusion/container/generation/make_list.hpp>
13 #ifndef PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE
14 #define PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE 5
21 template<
typename AlgorithmCheckerDerived>
24 inline AlgorithmCheckerDerived &
derived()
26 return *
static_cast<AlgorithmCheckerDerived *
>(
this);
29 inline const AlgorithmCheckerDerived &
derived()
const
31 return *
static_cast<const AlgorithmCheckerDerived *
>(
this);
34 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
41 #define PINOCCHIO_DEFINE_ALGO_CHECKER(NAME) \
42 struct NAME##Checker : public AlgorithmCheckerBase<NAME##Checker> \
44 template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl> \
45 inline bool checkModel_impl(const ModelTpl<Scalar, Options, JointCollectionTpl> &) const; \
51 #if !defined(BOOST_FUSION_HAS_VARIADIC_LIST)
52 template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
57 AlgorithmCheckerList<BOOST_PP_ENUM_PARAMS(PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE, D)>>
59 typedef typename boost::fusion::list<BOOST_PP_ENUM_PARAMS(
70 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
76 #define MAKE_ALGO_CHECKER_LIST(z, n, _) \
78 template<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), class D)> \
79 AlgorithmCheckerList<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), D)> makeAlgoCheckerList( \
80 BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n), D, const & arg)) \
82 return AlgorithmCheckerList<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), D)>( \
83 boost::fusion::make_list(BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), arg))); \
89 struct AlgorithmCheckerList : AlgorithmCheckerBase<AlgorithmCheckerList<D...>>
91 typedef typename boost::fusion::list<
D...>
ArgType;
100 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
107 AlgorithmCheckerList<
T...> makeAlgoCheckerList(
const T &... args)
109 return AlgorithmCheckerList<
T...>(boost::fusion::make_list(
args...));
120 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
122 const ModelTpl<Scalar, Options, JointCollectionTpl> &
model,
123 const DataTpl<Scalar, Options, JointCollectionTpl> &
data);
128 #include "pinocchio/algorithm/check.hxx"
130 #endif // ifndef __pinocchio_check_hpp__