[Bug 1034] New: Adding Operation to GlobalService with 5 arguments fails

http://bugs.orocos.org/show_bug.cgi?id=1034

Summary: Adding Operation to GlobalService with 5 arguments
fails
Product: Toolchain
Version: 2.5.0
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: ruben [dot] smits [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Created attachment 861
--> http://bugs.orocos.org/attachment.cgi?id=861
fix for bug

Hi,

I'm trying to add the following function to a Service as an operation:

void GetQuaternion(const Rotation& rot,double& x, double& y, double& z, double&
w){
rot.GetQuaternion(x,y,z,w);
}

gs->provides("KDL")->provides("Rotation")->addOperation("GetQuaternion",(void
(*)(const Rotation&, double&, double&, double&, double&)) &GetQuaternion).do\
c("");

When compiling this I get the following error:

n file included from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Return.hpp:42:0,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Invoker.hpp:46,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:46,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../Operation.hpp:46,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/OperationInterfacePartFused.hpp:72,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../Service.hpp:45,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../InputPort.hpp:45,
from
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/TemplateTypeInfo.hpp:45,
from
/home/rsmits/LBE/ros-workspace/rtt_geometry/kdl_typekit/src/kdlTypekit.hpp:51,
from
/home/rsmits/LBE/ros-workspace/rtt_geometry/kdl_typekit/src/kdlTypekitOperators.cpp:1:
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Collect.hpp:
In member function ‘RTT::SendStatus RTT::internal::CollectImpl<4, Ft,
BaseImpl>::collect(RTT::internal::CollectImpl<4, Ft, BaseImpl>::arg1_type,
RTT::internal::CollectImpl<4, Ft, BaseImpl>::arg2_type,
RTT::internal::CollectImpl<4, Ft, BaseImpl>::arg3_type,
RTT::internal::CollectImpl<4, Ft, BaseImpl>::arg4_type) [with Ft =
void(double&, double&, double&, double&), BaseImpl =
RTT::internal::LocalOperationCallerImpl<void(double&, double&, double&,
double&, const KDL::Rotation&)>, RTT::internal::CollectImpl<4, Ft,
BaseImpl>::arg1_type = double&, RTT::internal::CollectImpl<4, Ft,
BaseImpl>::arg2_type = double&, RTT::internal::CollectImpl<4, Ft,
BaseImpl>::arg3_type = double&, RTT::internal::CollectImpl<4, Ft,
BaseImpl>::arg4_type = double&]’:
/home/rsmits/LBE/ros-workspace/rtt_geometry/kdl_typekit/src/kdlTypekitOperators.cpp:79:1:
instantiated from here
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Collect.hpp:208:58:
error: no matching function for call to ‘RTT::internal::CollectImpl<4,
void(double&, double&, double&, double&),
RTT::internal::LocalOperationCallerImpl<void(double&, double&, double&,
double&, const KDL::Rotation&)> >::collect_impl(double&, double&, double&,
double&)’
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Collect.hpp:208:58:
note: candidates are:
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:290:24:
note: RTT::SendStatus
RTT::internal::LocalOperationCallerImpl<FunctionT>::collect_impl() [with
FunctionT = void(double&, double&, double&, double&, const KDL::Rotation&)]
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:290:24:
note: candidate expects 0 arguments, 4 provided
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:295:24:
note: template<class T1> RTT::SendStatus
RTT::internal::LocalOperationCallerImpl::collect_impl(T1&) [with T1 = T1,
FunctionT = void(double&, double&, double&, double&, const KDL::Rotation&)]
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:301:24:
note: template<class T1, class T2> RTT::SendStatus
RTT::internal::LocalOperationCallerImpl::collect_impl(T1&, T2&) [with T1 = T1,
T2 = T2, FunctionT = void(double&, double&, double&, double&, const
KDL::Rotation&)]
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/LocalOperationCaller.hpp:307:24:
note: template<class T1, class T2, class T3> RTT::SendStatus
RTT::internal::LocalOperationCallerImpl::collect_impl(T1&, T2&, T3&) [with T1 =
T1, T2 = T2, T3 = T3, FunctionT = void(double&, double&, double&, double&,
const KDL::Rotation&)]
/home/rsmits/LBE/ros-workspace/orocos_toolchain/log4cpp/../install/include/rtt/types/../internal/../internal/Collect.hpp:209:13:
warning: control reaches end of non-void function [-Wreturn-type]

Apparently operations with more than 3 arguments were not fully supported in
the LocalOperationCaller.hpp

The attached patch fixes the compile issue.

Ruben