Skip to content

Commit

Permalink
Fix collectIfDone() for more than three arguments
Browse files Browse the repository at this point in the history
collectIfDone(...) was calling cimpl->collect(...) for the specializations with more than three arguments.
Also reordered template specializations in Collect.hpp.

Signed-off-by: Johannes Meyer <[email protected]>
  • Loading branch information
meyerj authored and francisco-miguel-almeida committed Apr 9, 2019
1 parent c6768b0 commit da78139
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions rtt/internal/Collect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,14 @@ namespace RTT
};

template<class Ft, class BaseImpl>
struct CollectImpl<6,Ft,BaseImpl>
struct CollectImpl<5,Ft,BaseImpl>
: public BaseImpl
{
typedef typename boost::function<Ft>::arg1_type arg1_type;
typedef typename boost::function<Ft>::arg2_type arg2_type;
typedef typename boost::function<Ft>::arg3_type arg3_type;
typedef typename boost::function<Ft>::arg4_type arg4_type;
typedef typename boost::function<Ft>::arg5_type arg5_type;
typedef typename boost::function<Ft>::arg6_type arg6_type;
virtual ~CollectImpl() {}

/**
Expand All @@ -238,25 +237,26 @@ namespace RTT
* arg1_type(void) F
* @return
*/
virtual SendStatus collect(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
virtual SendStatus collect(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5)
{
return BaseImpl::collect_impl(a1,a2,a3,a4,a5,a6);
return BaseImpl::collect_impl(a1,a2,a3,a4,a5);
}
virtual SendStatus collectIfDone(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
virtual SendStatus collectIfDone(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5)
{
return BaseImpl::collectIfDone_impl(a1,a2,a3,a4,a5,a6);
return BaseImpl::collectIfDone_impl(a1,a2,a3,a4,a5);
}
};

template<class Ft, class BaseImpl>
struct CollectImpl<5,Ft,BaseImpl>
struct CollectImpl<6,Ft,BaseImpl>
: public BaseImpl
{
typedef typename boost::function<Ft>::arg1_type arg1_type;
typedef typename boost::function<Ft>::arg2_type arg2_type;
typedef typename boost::function<Ft>::arg3_type arg3_type;
typedef typename boost::function<Ft>::arg4_type arg4_type;
typedef typename boost::function<Ft>::arg5_type arg5_type;
typedef typename boost::function<Ft>::arg6_type arg6_type;
virtual ~CollectImpl() {}

/**
Expand All @@ -272,13 +272,13 @@ namespace RTT
* arg1_type(void) F
* @return
*/
virtual SendStatus collect(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5)
virtual SendStatus collect(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
{
return BaseImpl::collect_impl(a1,a2,a3,a4,a5);
return BaseImpl::collect_impl(a1,a2,a3,a4,a5,a6);
}
virtual SendStatus collectIfDone(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5)
virtual SendStatus collectIfDone(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6)
{
return BaseImpl::collectIfDone_impl(a1,a2,a3,a4,a5);
return BaseImpl::collectIfDone_impl(a1,a2,a3,a4,a5,a6);
}
};

Expand Down
6 changes: 3 additions & 3 deletions rtt/internal/CollectSignature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace RTT
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4) const
{
if (cimpl)
return cimpl->collect(t1, t2, t3, t4);
return cimpl->collectIfDone(t1, t2, t3, t4);
return SendFailure;
}
protected:
Expand Down Expand Up @@ -290,7 +290,7 @@ namespace RTT
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5) const
{
if (cimpl)
return cimpl->collect(t1, t2, t3, t4, t5);
return cimpl->collectIfDone(t1, t2, t3, t4, t5);
return SendFailure;
}
protected:
Expand Down Expand Up @@ -324,7 +324,7 @@ namespace RTT
SendStatus collectIfDone(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6) const
{
if (cimpl)
return cimpl->collect(t1, t2, t3, t4, t5, t6);
return cimpl->collectIfDone(t1, t2, t3, t4, t5, t6);
return SendFailure;
}
protected:
Expand Down

0 comments on commit da78139

Please sign in to comment.