sprint 1-alpha
sprint/function/detail/adapter.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 *   sprint::adapter
00003 *
00004 *   Copyright (C) 2005-2011  Paolo Medici <www.pmx.it>
00005 *
00006 *  This library is free software; you can redistribute it and/or
00007 *  modify it under the terms of the GNU Lesser General Public
00008 *  License as published by the Free Software Foundation; either
00009 *  version 2.1 of the License, or (at your option) any later version.
00010 *
00011 *  This library is distributed in the hope that it will be useful,
00012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 *  Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public
00017 *  License along with this library; if not, write to the Free Software
00018 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 *
00020 *******************************************************************************/
00021 
00022 #ifndef _SPRINT_DETAIL_FUNCTION_adapter_H
00023 #define _SPRINT_DETAIL_FUNCTION_adapter_H
00024 
00025 // $generated on Oct 30 2011 11:42:48$
00026 
00031 #include <sprint/function/function.h>
00032 
00033 namespace sprint {
00034         namespace detail {
00035 
00037 template<class R, class _Invoker>
00038 class adapter0: public function0<R> {
00039         typename _Invoker::ParamType m_p;
00040  public:
00041         adapter0( const typename _Invoker::ParamType & p) : m_p(p) { }
00042         virtual ~adapter0() { }
00043         virtual R operator()(void) { return _Invoker::run(m_p); }
00044 };
00045 
00046 template<class _Invoker>
00047 class adapter0<void, _Invoker>: public function0<void> {
00048         typename _Invoker::ParamType m_p;
00049  public:
00050         adapter0( const typename _Invoker::ParamType & p) : m_p(p) { }
00051         virtual ~adapter0() { }
00052         virtual void operator()(void) { _Invoker::run(m_p); }
00053  };
00054 
00056 template<class R, class _Invoker, class P1>
00057 class adapter1: public function1<R, P1> {
00058         typename _Invoker::ParamType m_p;
00059  public:
00060         adapter1( const typename _Invoker::ParamType & p) : m_p(p) { }
00061         virtual ~adapter1() { }
00062         virtual R operator()(P1 p1) { return _Invoker::run(m_p, p1); }
00063 };
00064 
00065 template<class _Invoker,class P1>
00066 class adapter1<void, _Invoker, P1>: public function1<void, P1> {
00067         typename _Invoker::ParamType m_p;
00068  public:
00069         adapter1( const typename _Invoker::ParamType & p) : m_p(p) { }
00070         virtual ~adapter1() { }
00071         virtual void operator()(P1 p1) { _Invoker::run(m_p, p1); }
00072  };
00073 
00075 template<class R, class _Invoker, class P1, class P2>
00076 class adapter2: public function2<R, P1, P2> {
00077         typename _Invoker::ParamType m_p;
00078  public:
00079         adapter2( const typename _Invoker::ParamType & p) : m_p(p) { }
00080         virtual ~adapter2() { }
00081         virtual R operator()(P1 p1, P2 p2) { return _Invoker::run(m_p, p1, p2); }
00082 };
00083 
00084 template<class _Invoker,class P1, class P2>
00085 class adapter2<void, _Invoker, P1, P2>: public function2<void, P1, P2> {
00086         typename _Invoker::ParamType m_p;
00087  public:
00088         adapter2( const typename _Invoker::ParamType & p) : m_p(p) { }
00089         virtual ~adapter2() { }
00090         virtual void operator()(P1 p1, P2 p2) { _Invoker::run(m_p, p1, p2); }
00091  };
00092 
00094 template<class R, class _Invoker, class P1, class P2, class P3>
00095 class adapter3: public function3<R, P1, P2, P3> {
00096         typename _Invoker::ParamType m_p;
00097  public:
00098         adapter3( const typename _Invoker::ParamType & p) : m_p(p) { }
00099         virtual ~adapter3() { }
00100         virtual R operator()(P1 p1, P2 p2, P3 p3) { return _Invoker::run(m_p, p1, p2, p3); }
00101 };
00102 
00103 template<class _Invoker,class P1, class P2, class P3>
00104 class adapter3<void, _Invoker, P1, P2, P3>: public function3<void, P1, P2, P3> {
00105         typename _Invoker::ParamType m_p;
00106  public:
00107         adapter3( const typename _Invoker::ParamType & p) : m_p(p) { }
00108         virtual ~adapter3() { }
00109         virtual void operator()(P1 p1, P2 p2, P3 p3) { _Invoker::run(m_p, p1, p2, p3); }
00110  };
00111 
00113 template<class R, class _Invoker, class P1, class P2, class P3, class P4>
00114 class adapter4: public function4<R, P1, P2, P3, P4> {
00115         typename _Invoker::ParamType m_p;
00116  public:
00117         adapter4( const typename _Invoker::ParamType & p) : m_p(p) { }
00118         virtual ~adapter4() { }
00119         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4) { return _Invoker::run(m_p, p1, p2, p3, p4); }
00120 };
00121 
00122 template<class _Invoker,class P1, class P2, class P3, class P4>
00123 class adapter4<void, _Invoker, P1, P2, P3, P4>: public function4<void, P1, P2, P3, P4> {
00124         typename _Invoker::ParamType m_p;
00125  public:
00126         adapter4( const typename _Invoker::ParamType & p) : m_p(p) { }
00127         virtual ~adapter4() { }
00128         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4) { _Invoker::run(m_p, p1, p2, p3, p4); }
00129  };
00130 
00132 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5>
00133 class adapter5: public function5<R, P1, P2, P3, P4, P5> {
00134         typename _Invoker::ParamType m_p;
00135  public:
00136         adapter5( const typename _Invoker::ParamType & p) : m_p(p) { }
00137         virtual ~adapter5() { }
00138         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { return _Invoker::run(m_p, p1, p2, p3, p4, p5); }
00139 };
00140 
00141 template<class _Invoker,class P1, class P2, class P3, class P4, class P5>
00142 class adapter5<void, _Invoker, P1, P2, P3, P4, P5>: public function5<void, P1, P2, P3, P4, P5> {
00143         typename _Invoker::ParamType m_p;
00144  public:
00145         adapter5( const typename _Invoker::ParamType & p) : m_p(p) { }
00146         virtual ~adapter5() { }
00147         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { _Invoker::run(m_p, p1, p2, p3, p4, p5); }
00148  };
00149 
00151 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6>
00152 class adapter6: public function6<R, P1, P2, P3, P4, P5, P6> {
00153         typename _Invoker::ParamType m_p;
00154  public:
00155         adapter6( const typename _Invoker::ParamType & p) : m_p(p) { }
00156         virtual ~adapter6() { }
00157         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6); }
00158 };
00159 
00160 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6>
00161 class adapter6<void, _Invoker, P1, P2, P3, P4, P5, P6>: public function6<void, P1, P2, P3, P4, P5, P6> {
00162         typename _Invoker::ParamType m_p;
00163  public:
00164         adapter6( const typename _Invoker::ParamType & p) : m_p(p) { }
00165         virtual ~adapter6() { }
00166         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6); }
00167  };
00168 
00170 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6, class P7>
00171 class adapter7: public function7<R, P1, P2, P3, P4, P5, P6, P7> {
00172         typename _Invoker::ParamType m_p;
00173  public:
00174         adapter7( const typename _Invoker::ParamType & p) : m_p(p) { }
00175         virtual ~adapter7() { }
00176         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7); }
00177 };
00178 
00179 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6, class P7>
00180 class adapter7<void, _Invoker, P1, P2, P3, P4, P5, P6, P7>: public function7<void, P1, P2, P3, P4, P5, P6, P7> {
00181         typename _Invoker::ParamType m_p;
00182  public:
00183         adapter7( const typename _Invoker::ParamType & p) : m_p(p) { }
00184         virtual ~adapter7() { }
00185         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7); }
00186  };
00187 
00189 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
00190 class adapter8: public function8<R, P1, P2, P3, P4, P5, P6, P7, P8> {
00191         typename _Invoker::ParamType m_p;
00192  public:
00193         adapter8( const typename _Invoker::ParamType & p) : m_p(p) { }
00194         virtual ~adapter8() { }
00195         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8); }
00196 };
00197 
00198 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
00199 class adapter8<void, _Invoker, P1, P2, P3, P4, P5, P6, P7, P8>: public function8<void, P1, P2, P3, P4, P5, P6, P7, P8> {
00200         typename _Invoker::ParamType m_p;
00201  public:
00202         adapter8( const typename _Invoker::ParamType & p) : m_p(p) { }
00203         virtual ~adapter8() { }
00204         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8); }
00205  };
00206 
00208 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
00209 class adapter9: public function9<R, P1, P2, P3, P4, P5, P6, P7, P8, P9> {
00210         typename _Invoker::ParamType m_p;
00211  public:
00212         adapter9( const typename _Invoker::ParamType & p) : m_p(p) { }
00213         virtual ~adapter9() { }
00214         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9); }
00215 };
00216 
00217 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
00218 class adapter9<void, _Invoker, P1, P2, P3, P4, P5, P6, P7, P8, P9>: public function9<void, P1, P2, P3, P4, P5, P6, P7, P8, P9> {
00219         typename _Invoker::ParamType m_p;
00220  public:
00221         adapter9( const typename _Invoker::ParamType & p) : m_p(p) { }
00222         virtual ~adapter9() { }
00223         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9); }
00224  };
00225 
00227 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>
00228 class adapter10: public function10<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> {
00229         typename _Invoker::ParamType m_p;
00230  public:
00231         adapter10( const typename _Invoker::ParamType & p) : m_p(p) { }
00232         virtual ~adapter10() { }
00233         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }
00234 };
00235 
00236 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>
00237 class adapter10<void, _Invoker, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>: public function10<void, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> {
00238         typename _Invoker::ParamType m_p;
00239  public:
00240         adapter10( const typename _Invoker::ParamType & p) : m_p(p) { }
00241         virtual ~adapter10() { }
00242         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }
00243  };
00244 
00246 template<class R, class _Invoker, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>
00247 class adapter11: public function11<R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> {
00248         typename _Invoker::ParamType m_p;
00249  public:
00250         adapter11( const typename _Invoker::ParamType & p) : m_p(p) { }
00251         virtual ~adapter11() { }
00252         virtual R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { return _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); }
00253 };
00254 
00255 template<class _Invoker,class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>
00256 class adapter11<void, _Invoker, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>: public function11<void, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> {
00257         typename _Invoker::ParamType m_p;
00258  public:
00259         adapter11( const typename _Invoker::ParamType & p) : m_p(p) { }
00260         virtual ~adapter11() { }
00261         virtual void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { _Invoker::run(m_p, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); }
00262  };
00263 
00264 
00265         } // detail
00266 } // sprint
00267 
00268 #endif
00269 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines