Verified Commit b11b284e authored by Justin Carpentier's avatar Justin Carpentier
Browse files

visitor/binary: fix missing runner

parent b136d1bb
......@@ -33,6 +33,18 @@ namespace pinocchio
return visitor(jmodel1.derived(),jmodel2.derived());
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ArgsTmp>
static ReturnType run(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel1,
const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel2,
JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata1,
JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata2,
ArgsTmp args)
{
typedef JointModelTpl<Scalar,Options,JointCollectionTpl> JointModel;
InternalVisitorModelAndData<JointModel,JointModel,ArgsTmp> visitor(jdata1,jdata2,args);
return boost::apply_visitor(visitor,jmodel1,jmodel2);
}
template<typename JointModelDerived1, typename JointModelDerived2>
static ReturnType run(const JointModelBase<JointModelDerived1> & jmodel1,
const JointModelBase<JointModelDerived2> & jmodel2,
......@@ -43,6 +55,17 @@ namespace pinocchio
return visitor(jmodel1.derived(),jmodel2.derived());
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
static ReturnType run(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel1,
const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel2,
JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata1,
JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata2)
{
typedef JointModelTpl<Scalar,Options,JointCollectionTpl> JointModel;
InternalVisitorModelAndData<JointModel,JointModel,NoArg> visitor(jdata1,jdata2);
return boost::apply_visitor(visitor,jmodel1,jmodel2);
}
template<typename JointModelDerived1, typename JointModelDerived2, typename ArgsTmp>
static ReturnType run(const JointModelBase<JointModelDerived1> & jmodel1,
const JointModelBase<JointModelDerived2> & jmodel2,
......@@ -52,6 +75,15 @@ namespace pinocchio
return visitor(jmodel1.derived(),jmodel2.derived());
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ArgsTmp>
static ReturnType run(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel1,
const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel2,
ArgsTmp args)
{
InternalVisitorModel<ArgsTmp> visitor(args);
return boost::apply_visitor(visitor,jmodel1,jmodel2);
}
template<typename JointModelDerived1, typename JointModelDerived2>
static ReturnType run(const JointModelBase<JointModelDerived1> & jmodel1,
const JointModelBase<JointModelDerived2> & jmodel2)
......@@ -60,6 +92,14 @@ namespace pinocchio
return visitor(jmodel1.derived(),jmodel2.derived());
}
template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
static ReturnType run(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel1,
const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel2)
{
InternalVisitorModel<NoArg> visitor;
return boost::apply_visitor(visitor,jmodel1,jmodel2);
}
private:
template<typename JointModel1, typename JointModel2, typename ArgType>
......@@ -84,10 +124,9 @@ namespace pinocchio
return bf::invoke(&JointVisitorDerived::template algo<JointModelDerived1,JointModelDerived2>,
bf::append(boost::ref(jmodel1.derived()),
boost::ref(jmodel2.derived()),
boost::ref(jdata1),
boost::ref(jdata2),
args)
);
boost::ref(boost::get<typename JointModelBase<JointModelDerived1>::JointDataDerived >(jdata1)),
boost::ref(boost::get<typename JointModelBase<JointModelDerived2>::JointDataDerived >(jdata2)),
args));
}
JointData1 & jdata1;
......@@ -115,9 +154,8 @@ namespace pinocchio
return bf::invoke(&JointVisitorDerived::template algo<JointModelDerived1,JointModelDerived2>,
bf::make_vector(boost::ref(jmodel1.derived()),
boost::ref(jmodel2.derived()),
boost::ref(jdata1),
boost::ref(jdata2))
);
boost::ref(boost::get<typename JointModelBase<JointModelDerived1>::JointDataDerived >(jdata1)),
boost::ref(boost::get<typename JointModelBase<JointModelDerived2>::JointDataDerived >(jdata2))));
}
JointData1 & jdata1;
......@@ -132,11 +170,11 @@ namespace pinocchio
: args(args)
{}
template<typename JointModelDerived1, typename JointModelDerived2>
ReturnType operator()(const JointModelBase<JointModelDerived1> & jmodel1,
const JointModelBase<JointModelDerived2> & jmodel2) const
template<typename JointModel1, typename JointModel2>
ReturnType operator()(const JointModelBase<JointModel1> & jmodel1,
const JointModelBase<JointModel2> & jmodel2) const
{
return bf::invoke(&JointVisitorDerived::template algo<JointModelDerived1,JointModelDerived2>,
return bf::invoke(&JointVisitorDerived::template algo<JointModel1,JointModel2>,
bf::append(boost::ref(jmodel1.derived()),
boost::ref(jmodel2.derived()),
args));
......@@ -151,13 +189,13 @@ namespace pinocchio
{
InternalVisitorModel() {}
template<typename JointModelDerived1, typename JointModelDerived2>
ReturnType operator()(const JointModelBase<JointModelDerived1> & jmodel1,
const JointModelBase<JointModelDerived2> & jmodel2) const
template<typename JointModel1, typename JointModel2>
ReturnType operator()(const JointModelBase<JointModel1> & jmodel1,
const JointModelBase<JointModel2> & jmodel2) const
{
return JointVisitorDerived::
template algo<JointModelDerived1,JointModelDerived2>(jmodel1.derived(),
jmodel2.derived());
template algo<JointModel1,JointModel2>(jmodel1.derived(),
jmodel2.derived());
}
};
......@@ -167,4 +205,3 @@ namespace pinocchio
} // namespace pinocchio
#endif // ifndef __pinocchio_multibody_visitior_joint_binary_visitor_hpp__
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