Invoker.hpp
Go to the documentation of this file.
00001 /***************************************************************************
00002   tag: FMTC  do nov 2 13:05:58 CET 2006  Invoker.hpp
00003 
00004                         Invoker.hpp -  description
00005                            -------------------
00006     begin                : do november 02 2006
00007     copyright            : (C) 2006 FMTC
00008     email                : peter.soetens@fmtc.be
00009 
00010  ***************************************************************************
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU General Public                   *
00013  *   License as published by the Free Software Foundation;                 *
00014  *   version 2 of the License.                                             *
00015  *                                                                         *
00016  *   As a special exception, you may use this file as part of a free       *
00017  *   software library without restriction.  Specifically, if other files   *
00018  *   instantiate templates or use macros or inline functions from this     *
00019  *   file, or you compile this file and link it with other files to        *
00020  *   produce an executable, this file does not by itself cause the         *
00021  *   resulting executable to be covered by the GNU General Public          *
00022  *   License.  This exception does not however invalidate any other        *
00023  *   reasons why the executable file might be covered by the GNU General   *
00024  *   Public License.                                                       *
00025  *                                                                         *
00026  *   This library is distributed in the hope that it will be useful,       *
00027  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00028  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00029  *   Lesser General Public License for more details.                       *
00030  *                                                                         *
00031  *   You should have received a copy of the GNU General Public             *
00032  *   License along with this library; if not, write to the Free Software   *
00033  *   Foundation, Inc., 59 Temple Place,                                    *
00034  *   Suite 330, Boston, MA  02111-1307  USA                                *
00035  *                                                                         *
00036  ***************************************************************************/
00037 
00038 
00039 #ifndef ORO_INVOKER_HPP
00040 #define ORO_INVOKER_HPP
00041 
00042 #include <boost/function.hpp>
00043 #include <boost/function_types/function_type.hpp>
00044 #include <boost/type_traits.hpp>
00045 #include "InvokerBase.hpp"
00046 #include "Return.hpp"
00047 
00048 namespace RTT
00049 {
00050     namespace internal
00051     {
00052         template<int, class F, class BaseImpl>
00053         struct InvokerImpl;
00054 
00060         template<class F, class BaseImpl>
00061         struct Invoker
00062             : public InvokerImpl<boost::function_traits<F>::arity, F, BaseImpl>
00063         {};
00064 
00065         template<class F, class BaseImpl>
00066         struct InvokerImpl<0,F,BaseImpl>
00067             : public Return<F,BaseImpl> // inherits from BaseImpl
00068         {
00069             typedef typename boost::function_traits<F>::result_type result_type;
00073             result_type call()
00074             {
00075                 return BaseImpl::call_impl();
00076             }
00077 
00078             SendHandle<F> send()
00079             {
00080                 return BaseImpl::send_impl();
00081             }
00082 
00083         };
00084 
00085         template<class F, class BaseImpl>
00086         struct InvokerImpl<1,F,BaseImpl>
00087             : public Return<F,BaseImpl>
00088         {
00089             typedef typename boost::function_traits<F>::result_type result_type;
00090             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00094             result_type call(arg1_type a1)
00095             {
00096                 return BaseImpl::template call_impl<arg1_type>( a1 );
00097             }
00098             result_type ret(arg1_type a1)
00099             {
00100                 return BaseImpl::template ret_impl<arg1_type>( a1 );
00101             }
00102             result_type ret()
00103             {
00104                 return BaseImpl::ret_impl();
00105             }
00106             SendHandle<F> send(arg1_type a1)
00107             {
00108                 return BaseImpl::template send_impl<arg1_type>( a1 );
00109             }
00110         };
00111 
00112         template<class F, class BaseImpl>
00113         struct InvokerImpl<2,F,BaseImpl>
00114             : public Return<F,BaseImpl>
00115         {
00116             typedef typename boost::function_traits<F>::result_type result_type;
00117             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00118             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00119 
00123             result_type call(arg1_type t1, arg2_type t2)
00124             {
00125                 return BaseImpl::template call_impl<arg1_type, arg2_type>(t1, t2);
00126             }
00127 
00128             result_type ret(arg1_type t1, arg2_type t2)
00129             {
00130                 return BaseImpl::template ret_impl<arg1_type, arg2_type>(t1, t2);
00131             }
00132 
00133             result_type ret()
00134             {
00135                 return BaseImpl::ret_impl();
00136             }
00137 
00138             SendHandle<F> send(arg1_type t1, arg2_type t2)
00139             {
00140                 return BaseImpl::template send_impl<arg1_type, arg2_type>(t1, t2);
00141             }
00142         };
00143 
00144         template<class F, class BaseImpl>
00145         struct InvokerImpl<3,F,BaseImpl>
00146             : public Return<F,BaseImpl>
00147         {
00148             typedef typename boost::function_traits<F>::result_type result_type;
00149             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00150             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00151             typedef typename boost::function_traits<F>::arg3_type arg3_type;
00152 
00156             result_type call(arg1_type t1, arg2_type t2, arg3_type t3)
00157             {
00158                 return BaseImpl::template call_impl<arg1_type, arg2_type, arg3_type>(t1, t2, t3);
00159             }
00160 
00161             result_type ret(arg1_type t1, arg2_type t2, arg3_type t3)
00162             {
00163                 return BaseImpl::template ret_impl<arg1_type, arg2_type, arg3_type>(t1, t2, t3);
00164             }
00165 
00166             result_type ret()
00167             {
00168                 return BaseImpl::ret_impl();
00169             }
00170 
00171             SendHandle<F> send(arg1_type t1, arg2_type t2, arg3_type t3)
00172             {
00173                 return BaseImpl::template send_impl<arg1_type, arg2_type, arg3_type>(t1, t2, t3);
00174             }
00175 
00176         };
00177 
00178         template<class F, class BaseImpl>
00179         struct InvokerImpl<4,F,BaseImpl>
00180             : public Return<F,BaseImpl>
00181         {
00182             typedef typename boost::function_traits<F>::result_type result_type;
00183             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00184             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00185             typedef typename boost::function_traits<F>::arg3_type arg3_type;
00186             typedef typename boost::function_traits<F>::arg4_type arg4_type;
00187 
00191             result_type call(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4)
00192             {
00193                 return BaseImpl::template call_impl<arg1_type, arg2_type, arg3_type, arg4_type>(t1, t2, t3, t4);
00194             }
00195 
00196             result_type ret(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4)
00197             {
00198                 return BaseImpl::template ret_impl<arg1_type, arg2_type, arg3_type, arg4_type>(t1, t2, t3, t4);
00199             }
00200 
00201             result_type ret()
00202             {
00203                 return BaseImpl::ret_impl();
00204             }
00205 
00206             SendHandle<F> send(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4)
00207             {
00208                 return BaseImpl::template send_impl<arg1_type, arg2_type, arg3_type, arg4_type>(t1, t2, t3, t4);
00209             }
00210 
00211         };
00212 
00213         template<class F, class BaseImpl>
00214         struct InvokerImpl<5,F,BaseImpl>
00215             : public Return<F,BaseImpl>
00216         {
00217             typedef typename boost::function_traits<F>::result_type result_type;
00218             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00219             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00220             typedef typename boost::function_traits<F>::arg3_type arg3_type;
00221             typedef typename boost::function_traits<F>::arg4_type arg4_type;
00222             typedef typename boost::function_traits<F>::arg5_type arg5_type;
00223 
00227             result_type call(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5)
00228             {
00229                 return BaseImpl::template call_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type>(t1, t2, t3, t4, t5);
00230             }
00231 
00232             result_type ret(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5)
00233             {
00234                 return BaseImpl::template ret_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type>(t1, t2, t3, t4, t5);
00235             }
00236 
00237             result_type ret()
00238             {
00239                 return BaseImpl::ret_impl();
00240             }
00241 
00242             SendHandle<F> send(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5)
00243             {
00244                 return BaseImpl::template send_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type>(t1, t2, t3, t4, t5);
00245             }
00246 
00247         };
00248 
00249         template<class F, class BaseImpl>
00250         struct InvokerImpl<6,F,BaseImpl>
00251             : public Return<F,BaseImpl>
00252         {
00253             typedef typename boost::function_traits<F>::result_type result_type;
00254             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00255             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00256             typedef typename boost::function_traits<F>::arg3_type arg3_type;
00257             typedef typename boost::function_traits<F>::arg4_type arg4_type;
00258             typedef typename boost::function_traits<F>::arg5_type arg5_type;
00259             typedef typename boost::function_traits<F>::arg6_type arg6_type;
00260 
00264             result_type call(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6)
00265             {
00266                 return BaseImpl::template call_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type>(t1, t2, t3, t4, t5, t6);
00267             }
00268 
00269             result_type ret(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6)
00270             {
00271                 return BaseImpl::template ret_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type>(t1, t2, t3, t4, t5, t6);
00272             }
00273 
00274             result_type ret()
00275             {
00276                 return BaseImpl::ret_impl();
00277             }
00278 
00279             SendHandle<F> send(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6)
00280             {
00281                 return BaseImpl::template send_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type>(t1, t2, t3, t4, t5, t6);
00282             }
00283 
00284         };
00285 
00286         template<class F, class BaseImpl>
00287         struct InvokerImpl<7,F,BaseImpl>
00288             : public Return<F,BaseImpl>
00289         {
00290             typedef typename boost::function_traits<F>::result_type result_type;
00291             typedef typename boost::function_traits<F>::arg1_type arg1_type;
00292             typedef typename boost::function_traits<F>::arg2_type arg2_type;
00293             typedef typename boost::function_traits<F>::arg3_type arg3_type;
00294             typedef typename boost::function_traits<F>::arg4_type arg4_type;
00295             typedef typename boost::function_traits<F>::arg5_type arg5_type;
00296             typedef typename boost::function_traits<F>::arg6_type arg6_type;
00297             typedef typename boost::function_traits<F>::arg7_type arg7_type;
00298 
00302             result_type call(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6, arg7_type t7)
00303             {
00304                 return BaseImpl::template call_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type>(t1, t2, t3, t4, t5, t6, t7);
00305             }
00306 
00307             result_type ret(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6, arg7_type t7)
00308             {
00309                 return BaseImpl::template ret_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type>(t1, t2, t3, t4, t5, t6, t7);
00310             }
00311 
00312             result_type ret()
00313             {
00314                 return BaseImpl::ret_impl();
00315             }
00316 
00317             SendHandle<F> send(arg1_type t1, arg2_type t2, arg3_type t3, arg4_type t4, arg5_type t5, arg6_type t6, arg7_type t7)
00318             {
00319                 return BaseImpl::template send_impl<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type>(t1, t2, t3, t4, t5, t6, t7);
00320             }
00321 
00322         };
00323 
00324    }
00325 }
00326 #endif


rtt
Author(s): RTT Developers
autogenerated on Wed Aug 26 2015 16:15:49