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_INVOCATION_N_H
00032 #define MOCKPP_INVOCATION_N_H
00033
00034
00035
00036
00037 MOCKPP_NS_START
00038
00039
00040
00044 template <typename P1>
00045 class Invocation1 : public Invocation
00046 {
00047 public:
00048
00049 enum { numParams = 1 };
00050
00051 typedef ConstraintSet1<P1> ConstraintSetType;
00052
00053 typedef P1 T1Type;
00054
00059 Invocation1( const String &objname
00060 , const P1 &in_param1)
00061 : Invocation( objname )
00062 , param1( in_param1 )
00063 {
00064 }
00065
00066 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00067
00072 virtual bool equals( const Invocation1<P1> &other ) const
00073 {
00074 return invocationComparison(param1, other.param1);
00075 }
00076
00081 bool equals( const InvocationBase &other ) const
00082 {
00083 MOCKPP_UNUSED(other);
00084 return false;
00085 }
00086
00087 #endif // MOCKPP_USE_INVOCATION_EQUALS
00088
00092 const P1 & getParameter1() const
00093 {
00094 return param1;
00095 }
00096
00100 virtual String describeParameters() const
00101 {
00102 String fmt = MOCKPP_PCHAR("%1");
00103 fmt << param1;
00104 return fmt;
00105 }
00106
00107 private:
00108
00109 const P1 & param1;
00110 };
00111
00112
00116 template <typename P1, typename P2>
00117 class Invocation2 : public Invocation
00118 {
00119 public:
00120
00121 enum { numParams = 2 };
00122
00123 typedef ConstraintSet2<P1, P2> ConstraintSetType;
00124
00125 typedef P1 T1Type;
00126 typedef P2 T2Type;
00127
00133 Invocation2( const String &objname
00134 , const P1 &in_param1
00135 , const P2 &in_param2)
00136 : Invocation( objname )
00137 , param1( in_param1 )
00138 , param2( in_param2 )
00139 {
00140 }
00141
00142 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00143
00148 virtual bool equals( const Invocation2<P1, P2> &other ) const
00149 {
00150 return invocationComparison(param1, other.param1)
00151 && invocationComparison(param2, other.param2);
00152 }
00153
00158 bool equals( const InvocationBase &other ) const
00159 {
00160 MOCKPP_UNUSED(other);
00161 return false;
00162 }
00163
00164 #endif // MOCKPP_USE_INVOCATION_EQUALS
00165
00169 const P1 & getParameter1() const
00170 {
00171 return param1;
00172 }
00173
00177 const P2 & getParameter2() const
00178 {
00179 return param2;
00180 }
00181
00185 virtual String describeParameters() const
00186 {
00187 String fmt = MOCKPP_PCHAR("%1, %2");
00188 fmt << param1
00189 << param2;
00190 return fmt;
00191 }
00192
00193 private:
00194
00195 const P1 & param1;
00196 const P2 & param2;
00197 };
00198
00199
00203 template <typename P1, typename P2, typename P3>
00204 class Invocation3 : public Invocation
00205 {
00206 public:
00207
00208 enum { numParams = 3 };
00209
00210 typedef ConstraintSet3<P1, P2, P3> ConstraintSetType;
00211
00212 typedef P1 T1Type;
00213 typedef P2 T2Type;
00214 typedef P3 T3Type;
00215
00222 Invocation3( const String &objname
00223 , const P1 &in_param1
00224 , const P2 &in_param2
00225 , const P3 &in_param3)
00226 : Invocation( objname )
00227 , param1( in_param1 )
00228 , param2( in_param2 )
00229 , param3( in_param3 )
00230 {
00231 }
00232
00233 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00234
00239 virtual bool equals( const Invocation3<P1, P2, P3> &other ) const
00240 {
00241 return invocationComparison(param1, other.param1)
00242 && invocationComparison(param2, other.param2)
00243 && invocationComparison(param3, other.param3);
00244 }
00245
00250 bool equals( const InvocationBase &other ) const
00251 {
00252 MOCKPP_UNUSED(other);
00253 return false;
00254 }
00255
00256 #endif // MOCKPP_USE_INVOCATION_EQUALS
00257
00261 const P1 & getParameter1() const
00262 {
00263 return param1;
00264 }
00265
00269 const P2 & getParameter2() const
00270 {
00271 return param2;
00272 }
00273
00277 const P3 & getParameter3() const
00278 {
00279 return param3;
00280 }
00281
00285 virtual String describeParameters() const
00286 {
00287 String fmt = MOCKPP_PCHAR("%1, %2, %3");
00288 fmt << param1
00289 << param2
00290 << param3;
00291 return fmt;
00292 }
00293
00294 private:
00295
00296 const P1 & param1;
00297 const P2 & param2;
00298 const P3 & param3;
00299 };
00300
00301
00305 template <typename P1, typename P2, typename P3, typename P4>
00306 class Invocation4 : public Invocation
00307 {
00308 public:
00309
00310 enum { numParams = 4 };
00311
00312 typedef ConstraintSet4<P1, P2, P3, P4> ConstraintSetType;
00313
00314 typedef P1 T1Type;
00315 typedef P2 T2Type;
00316 typedef P3 T3Type;
00317 typedef P4 T4Type;
00318
00326 Invocation4( const String &objname
00327 , const P1 &in_param1
00328 , const P2 &in_param2
00329 , const P3 &in_param3
00330 , const P4 &in_param4)
00331 : Invocation( objname )
00332 , param1( in_param1 )
00333 , param2( in_param2 )
00334 , param3( in_param3 )
00335 , param4( in_param4 )
00336 {
00337 }
00338
00339 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00340
00345 virtual bool equals( const Invocation4<P1, P2, P3, P4> &other ) const
00346 {
00347 return invocationComparison(param1, other.param1)
00348 && invocationComparison(param2, other.param2)
00349 && invocationComparison(param3, other.param3)
00350 && invocationComparison(param4, other.param4);
00351 }
00352
00357 bool equals( const InvocationBase &other ) const
00358 {
00359 MOCKPP_UNUSED(other);
00360 return false;
00361 }
00362
00363 #endif // MOCKPP_USE_INVOCATION_EQUALS
00364
00368 const P1 & getParameter1() const
00369 {
00370 return param1;
00371 }
00372
00376 const P2 & getParameter2() const
00377 {
00378 return param2;
00379 }
00380
00384 const P3 & getParameter3() const
00385 {
00386 return param3;
00387 }
00388
00392 const P4 & getParameter4() const
00393 {
00394 return param4;
00395 }
00396
00400 virtual String describeParameters() const
00401 {
00402 String fmt = MOCKPP_PCHAR("%1, %2, %3, %4");
00403 fmt << param1
00404 << param2
00405 << param3
00406 << param4;
00407 return fmt;
00408 }
00409
00410 private:
00411
00412 const P1 & param1;
00413 const P2 & param2;
00414 const P3 & param3;
00415 const P4 & param4;
00416 };
00417
00418
00422 template <typename P1, typename P2, typename P3, typename P4, typename P5>
00423 class Invocation5 : public Invocation
00424 {
00425 public:
00426
00427 enum { numParams = 5 };
00428
00429 typedef ConstraintSet5<P1, P2, P3, P4, P5> ConstraintSetType;
00430
00431 typedef P1 T1Type;
00432 typedef P2 T2Type;
00433 typedef P3 T3Type;
00434 typedef P4 T4Type;
00435 typedef P5 T5Type;
00436
00445 Invocation5( const String &objname
00446 , const P1 &in_param1
00447 , const P2 &in_param2
00448 , const P3 &in_param3
00449 , const P4 &in_param4
00450 , const P5 &in_param5)
00451 : Invocation( objname )
00452 , param1( in_param1 )
00453 , param2( in_param2 )
00454 , param3( in_param3 )
00455 , param4( in_param4 )
00456 , param5( in_param5 )
00457 {
00458 }
00459
00460 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00461
00466 virtual bool equals( const Invocation5<P1, P2, P3, P4, P5> &other ) const
00467 {
00468 return invocationComparison(param1, other.param1)
00469 && invocationComparison(param2, other.param2)
00470 && invocationComparison(param3, other.param3)
00471 && invocationComparison(param4, other.param4)
00472 && invocationComparison(param5, other.param5);
00473 }
00474
00479 bool equals( const InvocationBase &other ) const
00480 {
00481 MOCKPP_UNUSED(other);
00482 return false;
00483 }
00484
00485 #endif // MOCKPP_USE_INVOCATION_EQUALS
00486
00490 const P1 & getParameter1() const
00491 {
00492 return param1;
00493 }
00494
00498 const P2 & getParameter2() const
00499 {
00500 return param2;
00501 }
00502
00506 const P3 & getParameter3() const
00507 {
00508 return param3;
00509 }
00510
00514 const P4 & getParameter4() const
00515 {
00516 return param4;
00517 }
00518
00522 const P5 & getParameter5() const
00523 {
00524 return param5;
00525 }
00526
00530 virtual String describeParameters() const
00531 {
00532 String fmt = MOCKPP_PCHAR("%1, %2, %3, %4, %5");
00533 fmt << param1
00534 << param2
00535 << param3
00536 << param4
00537 << param5;
00538 return fmt;
00539 }
00540
00541 private:
00542
00543 const P1 & param1;
00544 const P2 & param2;
00545 const P3 & param3;
00546 const P4 & param4;
00547 const P5 & param5;
00548 };
00549
00550
00554 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
00555 class Invocation6 : public Invocation
00556 {
00557 public:
00558
00559 enum { numParams = 6 };
00560
00561 typedef ConstraintSet6<P1, P2, P3, P4, P5, P6> ConstraintSetType;
00562
00563 typedef P1 T1Type;
00564 typedef P2 T2Type;
00565 typedef P3 T3Type;
00566 typedef P4 T4Type;
00567 typedef P5 T5Type;
00568 typedef P6 T6Type;
00569
00579 Invocation6( const String &objname
00580 , const P1 &in_param1
00581 , const P2 &in_param2
00582 , const P3 &in_param3
00583 , const P4 &in_param4
00584 , const P5 &in_param5
00585 , const P6 &in_param6)
00586 : Invocation( objname )
00587 , param1( in_param1 )
00588 , param2( in_param2 )
00589 , param3( in_param3 )
00590 , param4( in_param4 )
00591 , param5( in_param5 )
00592 , param6( in_param6 )
00593 {
00594 }
00595
00596 #ifdef MOCKPP_USE_INVOCATION_EQUALS
00597
00602 virtual bool equals( const Invocation6<P1, P2, P3, P4, P5, P6> &other ) const
00603 {
00604 return invocationComparison(param1, other.param1)
00605 && invocationComparison(param2, other.param2)
00606 && invocationComparison(param3, other.param3)
00607 && invocationComparison(param4, other.param4)
00608 && invocationComparison(param5, other.param5)
00609 && invocationComparison(param6, other.param6);
00610 }
00611
00616 bool equals( const InvocationBase &other ) const
00617 {
00618 MOCKPP_UNUSED(other);
00619 return false;
00620 }
00621
00622 #endif // MOCKPP_USE_INVOCATION_EQUALS
00623
00627 const P1 & getParameter1() const
00628 {
00629 return param1;
00630 }
00631
00635 const P2 & getParameter2() const
00636 {
00637 return param2;
00638 }
00639
00643 const P3 & getParameter3() const
00644 {
00645 return param3;
00646 }
00647
00651 const P4 & getParameter4() const
00652 {
00653 return param4;
00654 }
00655
00659 const P5 & getParameter5() const
00660 {
00661 return param5;
00662 }
00663
00667 const P6 & getParameter6() const
00668 {
00669 return param6;
00670 }
00671
00675 virtual String describeParameters() const
00676 {
00677 String fmt = MOCKPP_PCHAR("%1, %2, %3, %4, %5, %6");
00678 fmt << param1
00679 << param2
00680 << param3
00681 << param4
00682 << param5
00683 << param6;
00684 return fmt;
00685 }
00686
00687 private:
00688
00689 const P1 & param1;
00690 const P2 & param2;
00691 const P3 & param3;
00692 const P4 & param4;
00693 const P5 & param5;
00694 const P6 & param6;
00695 };
00696
00697
00698 MOCKPP_NS_END
00699
00700
00701 #endif // MOCKPP_INVOCATION_N_H
00702