Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef ORO_RETURN_BASE_HPP
00040 #define ORO_RETURN_BASE_HPP
00041
00042 #include <boost/type_traits.hpp>
00043
00044 namespace RTT
00045 {
00046 namespace internal
00047 {
00052 template<int, class F>
00053 struct ReturnBaseImpl;
00054
00059 template<class F>
00060 struct ReturnBase
00061 : public ReturnBaseImpl<boost::function_traits<F>::arity, F>
00062 {};
00063
00064
00065 template<class F>
00066 struct ReturnBaseImpl<0,F>
00067 {
00068 typedef typename boost::function_traits<F>::result_type result_type;
00069 virtual ~ReturnBaseImpl() {}
00070
00071 virtual result_type ret() = 0;
00072 };
00073
00074 template<class F>
00075 struct ReturnBaseImpl<1,F>
00076 {
00077 typedef typename boost::function_traits<F>::result_type result_type;
00078 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00079 virtual ~ReturnBaseImpl() {}
00080
00081 virtual result_type ret(arg1_type a1) = 0;
00082 virtual result_type ret() = 0;
00083 };
00084
00085 template<class F>
00086 struct ReturnBaseImpl<2,F>
00087 {
00088 typedef typename boost::function_traits<F>::result_type result_type;
00089 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00090 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00091 virtual ~ReturnBaseImpl() {}
00092
00093 virtual result_type ret(arg1_type a1, arg2_type a2) = 0;
00094 virtual result_type ret() = 0;
00095 };
00096
00097 template<class F>
00098 struct ReturnBaseImpl<3,F>
00099 {
00100 typedef typename boost::function_traits<F>::result_type result_type;
00101 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00102 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00103 typedef typename boost::function_traits<F>::arg3_type arg3_type;
00104 virtual ~ReturnBaseImpl() {}
00105
00106 virtual result_type ret(arg1_type a1, arg2_type a2, arg3_type a3) = 0;
00107 virtual result_type ret() = 0;
00108 };
00109
00110 template<class F>
00111 struct ReturnBaseImpl<4,F>
00112 {
00113 typedef typename boost::function_traits<F>::result_type result_type;
00114 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00115 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00116 typedef typename boost::function_traits<F>::arg3_type arg3_type;
00117 typedef typename boost::function_traits<F>::arg4_type arg4_type;
00118 virtual ~ReturnBaseImpl() {}
00119
00120 virtual result_type ret(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) = 0;
00121 virtual result_type ret() = 0;
00122 };
00123
00124 template<class F>
00125 struct ReturnBaseImpl<5,F>
00126 {
00127 typedef typename boost::function_traits<F>::result_type result_type;
00128 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00129 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00130 typedef typename boost::function_traits<F>::arg3_type arg3_type;
00131 typedef typename boost::function_traits<F>::arg4_type arg4_type;
00132 typedef typename boost::function_traits<F>::arg5_type arg5_type;
00133 virtual ~ReturnBaseImpl() {}
00134
00135 virtual result_type ret(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5) = 0;
00136 virtual result_type ret() = 0;
00137 };
00138
00139 template<class F>
00140 struct ReturnBaseImpl<6,F>
00141 {
00142 typedef typename boost::function_traits<F>::result_type result_type;
00143 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00144 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00145 typedef typename boost::function_traits<F>::arg3_type arg3_type;
00146 typedef typename boost::function_traits<F>::arg4_type arg4_type;
00147 typedef typename boost::function_traits<F>::arg5_type arg5_type;
00148 typedef typename boost::function_traits<F>::arg6_type arg6_type;
00149 virtual ~ReturnBaseImpl() {}
00150
00151 virtual result_type ret(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6) = 0;
00152 virtual result_type ret() = 0;
00153 };
00154
00155 template<class F>
00156 struct ReturnBaseImpl<7,F>
00157 {
00158 typedef typename boost::function_traits<F>::result_type result_type;
00159 typedef typename boost::function_traits<F>::arg1_type arg1_type;
00160 typedef typename boost::function_traits<F>::arg2_type arg2_type;
00161 typedef typename boost::function_traits<F>::arg3_type arg3_type;
00162 typedef typename boost::function_traits<F>::arg4_type arg4_type;
00163 typedef typename boost::function_traits<F>::arg5_type arg5_type;
00164 typedef typename boost::function_traits<F>::arg6_type arg6_type;
00165 typedef typename boost::function_traits<F>::arg7_type arg7_type;
00166 virtual ~ReturnBaseImpl() {}
00167
00168 virtual result_type ret(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, arg5_type a5, arg6_type a6, arg7_type a7) = 0;
00169 virtual result_type ret() = 0;
00170 };
00171 }
00172 }
00173 #endif