18 #ifndef __se3_check_hpp__ 19 #define __se3_check_hpp__ 21 #include "pinocchio/multibody/model.hpp" 22 #include "pinocchio/multibody/data.hpp" 23 #include <boost/fusion/container/list.hpp> 24 #include <boost/fusion/container/generation/make_list.hpp> 26 #ifndef PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE 27 #define PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE 5 34 template<
typename AlgorithmCheckerDerived>
37 inline AlgorithmCheckerDerived& derived()
38 {
return *
static_cast< AlgorithmCheckerDerived*
>(
this); }
40 inline const AlgorithmCheckerDerived& derived()
const 41 {
return *
static_cast<const AlgorithmCheckerDerived*
>(
this); }
43 inline bool checkModel(
const Model & model)
const {
return derived().checkModel_impl(model); }
46 #define DEFINE_ALGO_CHECKER(NAME) \ 47 struct NAME##Checker : public AlgorithmCheckerBase<NAME##Checker> \ 49 inline bool checkModel_impl( const Model& ) const; \ 53 DEFINE_ALGO_CHECKER(Parent);
55 #if !defined(BOOST_FUSION_HAS_VARIADIC_LIST) 56 template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE,
class D,boost::fusion::
void_)>
60 typedef typename boost::fusion::list<BOOST_PP_ENUM_PARAMS(PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE,D)> ArgType;
63 : checkerList(checkerList) {}
67 bool checkModel_impl(
const Model & model)
const;
69 const ArgType & checkerList;
72 #define MAKE_ALGO_CHECKER_LIST(z,n,_) \ 74 template<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class D)> \ 75 AlgorithmCheckerList<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),D)> makeAlgoCheckerList(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n) , D, const & arg)) \ 76 { return AlgorithmCheckerList<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),D)>(boost::fusion::make_list(BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),arg))); } \ 78 BOOST_PP_REPEAT(PINOCCHIO_ALGO_CHECKER_LIST_MAX_LIST_SIZE, MAKE_ALGO_CHECKER_LIST, BOOST_PP_EMPTY)
83 typedef typename boost::fusion::list<D...> ArgType;
86 : checkerList(checkerList) {}
90 bool checkModel_impl(
const Model & model)
const;
92 const ArgType & checkerList;
115 #include "pinocchio/algorithm/check.hxx" 117 #endif // ifndef __se3_check_hpp__
bool checkData(const Model &model, const Data &data)
CRTP class describing the API of the checkers.
Checker having a list of Checker as input argument.