00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef MOCKPP_COUNTEDVISITABLEMETHOD_H
00032 #define MOCKPP_COUNTEDVISITABLEMETHOD_H
00033
00034 #include <mockpp/CountParameters.h>
00035
00036 #include <mockpp/visiting/VisitableMockMethod0.h>
00037 #include <mockpp/visiting/VisitableMockMethod1.h>
00038 #include <mockpp/visiting/VisitableMockMethod2.h>
00039 #include <mockpp/visiting/VisitableMockMethod3.h>
00040 #include <mockpp/visiting/VisitableMockMethod4.h>
00041 #include <mockpp/visiting/VisitableMockMethod5.h>
00042 #include <mockpp/visiting/VisitableMockMethod6.h>
00043
00044
00045 MOCKPP_NS_START
00046
00047
00048 #ifndef MOCKPP_COUNTED_WEAKNESS
00049
00050
00055 template<unsigned params>
00056 class SwitchVisitable
00057 {
00058 };
00059
00060
00065 template<>
00066 class SwitchVisitable<0>
00067 {
00068 public:
00069
00072 template< typename R
00073 , typename P1
00074 , typename P2
00075 , typename P3
00076 , typename P4
00077 , typename P5
00078 , typename P6>
00079 class Method
00080 {
00081 public:
00082
00083 typedef VisitableMockMethod0<R> VisitableMockMethodType;
00084 };
00085 };
00086
00087
00092 template<>
00093 class SwitchVisitable<1>
00094 {
00095 public:
00096
00099 template< typename R
00100 , typename P1
00101 , typename P2
00102 , typename P3
00103 , typename P4
00104 , typename P5
00105 , typename P6>
00106 class Method
00107 {
00108 public:
00109
00110 typedef VisitableMockMethod1<R, P1> VisitableMockMethodType;
00111 };
00112 };
00113
00114
00119 template<>
00120 class SwitchVisitable<2>
00121 {
00122 public:
00123
00126 template< typename R
00127 , typename P1
00128 , typename P2
00129 , typename P3
00130 , typename P4
00131 , typename P5
00132 , typename P6>
00133 class Method
00134 {
00135 public:
00136
00137 typedef VisitableMockMethod2<R, P1, P2> VisitableMockMethodType;
00138 };
00139 };
00140
00141
00146 template<>
00147 class SwitchVisitable<3>
00148 {
00149 public:
00150
00153 template< typename R
00154 , typename P1
00155 , typename P2
00156 , typename P3
00157 , typename P4
00158 , typename P5
00159 , typename P6>
00160 class Method
00161 {
00162 public:
00163
00164 typedef VisitableMockMethod3<R, P1, P2, P3> VisitableMockMethodType;
00165 };
00166 };
00167
00168
00173 template<>
00174 class SwitchVisitable<4>
00175 {
00176 public:
00177
00180 template< typename R
00181 , typename P1
00182 , typename P2
00183 , typename P3
00184 , typename P4
00185 , typename P5
00186 , typename P6>
00187 class Method
00188 {
00189 public:
00190
00191 typedef VisitableMockMethod4<R, P1, P2, P3, P4> VisitableMockMethodType;
00192 };
00193 };
00194
00195
00200 template<>
00201 class SwitchVisitable<5>
00202 {
00203 public:
00204
00207 template< typename R
00208 , typename P1
00209 , typename P2
00210 , typename P3
00211 , typename P4
00212 , typename P5
00213 , typename P6>
00214 class Method
00215 {
00216 public:
00217
00218 typedef VisitableMockMethod5<R, P1, P2, P3, P4, P5> VisitableMockMethodType;
00219 };
00220 };
00221
00222
00227 template<>
00228 class SwitchVisitable<6>
00229 {
00230 public:
00231
00234 template< typename R
00235 , typename P1
00236 , typename P2
00237 , typename P3
00238 , typename P4
00239 , typename P5
00240 , typename P6>
00241 class Method
00242 {
00243 public:
00244
00245 typedef VisitableMockMethod6<R, P1, P2, P3, P4, P5, P6> VisitableMockMethodType;
00246 };
00247 };
00248
00249
00253 template< typename R
00254 , typename P1 = NoParameter
00255 , typename P2 = NoParameter
00256 , typename P3 = NoParameter
00257 , typename P4 = NoParameter
00258 , typename P5 = NoParameter
00259 , typename P6 = NoParameter>
00260 class VisitableMockMethod
00261 : public SwitchVisitable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value>
00262 #ifdef MOCKPP_NO_TEMPLATE_HINT
00263 ::Method<R, P1, P2, P3, P4, P5, P6>
00264 #else
00265 ::template Method<R, P1, P2, P3, P4, P5, P6>
00266 #endif
00267 ::VisitableMockMethodType
00268 {
00269 public:
00270
00275 VisitableMockMethod(const String &name, VisitableMockObject *parent )
00276 : SwitchVisitable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value >
00277 #ifdef MOCKPP_NO_TEMPLATE_HINT
00278 ::Method<R, P1, P2, P3, P4, P5, P6>
00279 #else
00280 ::template Method<R, P1, P2, P3, P4, P5, P6>
00281 #endif
00282 ::VisitableMockMethodType(name, parent)
00283 {
00284 }
00285 };
00286
00287
00288 #else // MOCKPP_COUNTED_WEAKNESS
00289
00290
00295 template< typename R
00296 , typename P1 = NoParameter
00297 , typename P2 = NoParameter
00298 , typename P3 = NoParameter
00299 , typename P4 = NoParameter
00300 , typename P5 = NoParameter
00301 , typename P6 = NoParameter
00302 , typename P7 = NoParameter>
00303 class VisitableMockMethod
00304 {
00305 };
00306
00307
00311 template<typename R>
00312 class VisitableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter>
00313 : public VisitableMockMethod0<R>
00314 {
00315 public:
00316
00321 VisitableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter>
00322 (const String &name, VisitableMockObject *parent )
00323 : VisitableMockMethod0<R>(name, parent)
00324 {
00325 }
00326 };
00327
00328
00332 template<typename R, typename P1>
00333 class VisitableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter>
00334 : public VisitableMockMethod1<R, P1>
00335 {
00336 public:
00337
00342 VisitableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter>
00343 (const String &name, VisitableMockObject *parent )
00344 : VisitableMockMethod1<R, P1>(name, parent)
00345 {
00346 }
00347 };
00348
00349
00353 template<typename R, typename P1, typename P2>
00354 class VisitableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter>
00355 : public VisitableMockMethod2<R, P1, P2>
00356 {
00357 public:
00358
00363 VisitableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter>
00364 (const String &name, VisitableMockObject *parent )
00365 : VisitableMockMethod2<R, P1, P2>(name, parent)
00366 {
00367 }
00368 };
00369
00370
00374 template<typename R, typename P1, typename P2, typename P3>
00375 class VisitableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter>
00376 : public VisitableMockMethod3<R, P1, P2, P3>
00377 {
00378 public:
00379
00384 VisitableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter>
00385 (const String &name, VisitableMockObject *parent )
00386 : VisitableMockMethod3<R, P1, P2, P3>(name, parent)
00387 {
00388 }
00389 };
00390
00391
00395 template<typename R, typename P1, typename P2, typename P3, typename P4>
00396 class VisitableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter>
00397 : public VisitableMockMethod4<R, P1, P2, P3, P4>
00398 {
00399 public:
00400
00405 VisitableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter>
00406 (const String &name, VisitableMockObject *parent )
00407 : VisitableMockMethod4<R, P1, P2, P3, P4>(name, parent)
00408 {
00409 }
00410 };
00411
00412
00416 template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
00417 class VisitableMockMethod<R, P1, P2, P3, P4, P5, NoParameter>
00418 : public VisitableMockMethod5<R, P1, P2, P3, P4, P5>
00419 {
00420 public:
00421
00426 VisitableMockMethod<R, P1, P2, P3, P4, P5, NoParameter>
00427 (const String &name, VisitableMockObject *parent )
00428 : VisitableMockMethod5<R, P1, P2, P3, P4, P5>(name, parent)
00429 {
00430 }
00431 };
00432
00433
00437 template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
00438 class VisitableMockMethod<R, P1, P2, P3, P4, P5, P6>
00439 : public VisitableMockMethod6<R, P1, P2, P3, P4, P5, P6>
00440 {
00441 public:
00442
00447 VisitableMockMethod<R, P1, P2, P3, P4, P5, P6>
00448 (const String &name, VisitableMockObject *parent )
00449 : VisitableMockMethod6<R, P1, P2, P3, P4, P5, P6>(name, parent)
00450 {
00451 }
00452 };
00453
00454
00455 #endif // MOCKPP_COUNTED_WEAKNESS
00456
00457
00458 MOCKPP_NS_END
00459
00460
00461 #endif // MOCKPP_COUNTEDVISITABLEMETHOD_H
00462