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_TriggerStub_H
00032 #define MOCKPP_TriggerStub_H
00033
00034 #include <mockpp/mockpp.h>
00035
00036 #include <mockpp/compat/Formatter.h>
00037
00038 #include <mockpp/stub/TypelessStub.h>
00039
00040 #include <mockpp/constraint/TriggeredConstraint.h>
00041
00042
00043 MOCKPP_NS_START
00044
00045
00050 template < typename T1
00051 >
00052 class TriggerStub1 : public TypelessStub<void>
00053 {
00054 public:
00055
00059 TriggerStub1( TriggeredConstraint<T1> *in_tc1
00060 )
00061 : tc1(in_tc1)
00062 {}
00063
00067 virtual void typelessInvoke()
00068 {
00069 tc1->trigger();
00070 }
00071
00076 virtual String describeTo( String &buffer ) const
00077 {
00078 String fmt;
00079 {
00080 String tcfmt;
00081 tc1->describeTo(tcfmt);
00082 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00083 fmt << tcfmt;
00084 }
00085
00086 fmt += MOCKPP_PCHAR("is void");
00087 buffer += fmt;
00088
00089 return buffer;
00090 }
00091
00092 private:
00093
00094 TriggeredConstraint<T1> *tc1;
00095 };
00096
00097
00102 template < typename T1
00103 , typename T2
00104 >
00105 class TriggerStub2 : public TypelessStub<void>
00106 {
00107 public:
00108
00113 TriggerStub2( TriggeredConstraint<T1> *in_tc1
00114 , TriggeredConstraint<T2> *in_tc2
00115 )
00116 : tc1(in_tc1)
00117 , tc2(in_tc2)
00118 {}
00119
00123 virtual void typelessInvoke()
00124 {
00125 tc1->trigger();
00126 tc2->trigger();
00127 }
00128
00133 virtual String describeTo( String &buffer ) const
00134 {
00135 String fmt;
00136 {
00137 String tcfmt;
00138 tc1->describeTo(tcfmt);
00139 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00140 fmt << tcfmt;
00141 }
00142
00143 {
00144 String tcfmt;
00145 tc2->describeTo(tcfmt);
00146 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00147 fmt << tcfmt;
00148 }
00149
00150 fmt += MOCKPP_PCHAR("is void");
00151 buffer += fmt;
00152
00153 return buffer;
00154 }
00155
00156 private:
00157
00158 TriggeredConstraint<T1> *tc1;
00159 TriggeredConstraint<T2> *tc2;
00160 };
00161
00162
00167 template < typename T1
00168 , typename T2
00169 , typename T3
00170 >
00171 class TriggerStub3 : public TypelessStub<void>
00172 {
00173 public:
00174
00180 TriggerStub3( TriggeredConstraint<T1> *in_tc1
00181 , TriggeredConstraint<T2> *in_tc2
00182 , TriggeredConstraint<T3> *in_tc3
00183 )
00184 : tc1(in_tc1)
00185 , tc2(in_tc2)
00186 , tc3(in_tc3)
00187 {}
00188
00192 virtual void typelessInvoke()
00193 {
00194 tc1->trigger();
00195 tc2->trigger();
00196 tc3->trigger();
00197 }
00198
00203 virtual String describeTo( String &buffer ) const
00204 {
00205 String fmt;
00206 {
00207 String tcfmt;
00208 tc1->describeTo(tcfmt);
00209 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00210 fmt << tcfmt;
00211 }
00212
00213 {
00214 String tcfmt;
00215 tc2->describeTo(tcfmt);
00216 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00217 fmt << tcfmt;
00218 }
00219
00220 {
00221 String tcfmt;
00222 tc3->describeTo(tcfmt);
00223 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00224 fmt << tcfmt;
00225 }
00226
00227 fmt += MOCKPP_PCHAR("is void");
00228 buffer += fmt;
00229
00230 return buffer;
00231 }
00232
00233 private:
00234
00235 TriggeredConstraint<T1> *tc1;
00236 TriggeredConstraint<T2> *tc2;
00237 TriggeredConstraint<T3> *tc3;
00238 };
00239
00240
00245 template < typename T1
00246 , typename T2
00247 , typename T3
00248 , typename T4
00249 >
00250 class TriggerStub4 : public TypelessStub<void>
00251 {
00252 public:
00253
00260 TriggerStub4( TriggeredConstraint<T1> *in_tc1
00261 , TriggeredConstraint<T2> *in_tc2
00262 , TriggeredConstraint<T3> *in_tc3
00263 , TriggeredConstraint<T4> *in_tc4
00264 )
00265 : tc1(in_tc1)
00266 , tc2(in_tc2)
00267 , tc3(in_tc3)
00268 , tc4(in_tc4)
00269 {}
00270
00274 virtual void typelessInvoke()
00275 {
00276 tc1->trigger();
00277 tc2->trigger();
00278 tc3->trigger();
00279 tc4->trigger();
00280 }
00281
00286 virtual String describeTo( String &buffer ) const
00287 {
00288 String fmt;
00289 {
00290 String tcfmt;
00291 tc1->describeTo(tcfmt);
00292 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00293 fmt << tcfmt;
00294 }
00295
00296 {
00297 String tcfmt;
00298 tc2->describeTo(tcfmt);
00299 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00300 fmt << tcfmt;
00301 }
00302
00303 {
00304 String tcfmt;
00305 tc3->describeTo(tcfmt);
00306 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00307 fmt << tcfmt;
00308 }
00309
00310 {
00311 String tcfmt;
00312 tc4->describeTo(tcfmt);
00313 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00314 fmt << tcfmt;
00315 }
00316
00317 fmt += MOCKPP_PCHAR("is void");
00318 buffer += fmt;
00319
00320 return buffer;
00321 }
00322
00323 private:
00324
00325 TriggeredConstraint<T1> *tc1;
00326 TriggeredConstraint<T2> *tc2;
00327 TriggeredConstraint<T3> *tc3;
00328 TriggeredConstraint<T4> *tc4;
00329 };
00330
00331
00336 template < typename T1
00337 , typename T2
00338 , typename T3
00339 , typename T4
00340 , typename T5
00341 >
00342 class TriggerStub5 : public TypelessStub<void>
00343 {
00344 public:
00345
00353 TriggerStub5( TriggeredConstraint<T1> *in_tc1
00354 , TriggeredConstraint<T2> *in_tc2
00355 , TriggeredConstraint<T3> *in_tc3
00356 , TriggeredConstraint<T4> *in_tc4
00357 , TriggeredConstraint<T5> *in_tc5
00358 )
00359 : tc1(in_tc1)
00360 , tc2(in_tc2)
00361 , tc3(in_tc3)
00362 , tc4(in_tc4)
00363 , tc5(in_tc5)
00364 {}
00365
00369 virtual void typelessInvoke()
00370 {
00371 tc1->trigger();
00372 tc2->trigger();
00373 tc3->trigger();
00374 tc4->trigger();
00375 tc5->trigger();
00376 }
00377
00382 virtual String describeTo( String &buffer ) const
00383 {
00384 String fmt;
00385 {
00386 String tcfmt;
00387 tc1->describeTo(tcfmt);
00388 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00389 fmt << tcfmt;
00390 }
00391
00392 {
00393 String tcfmt;
00394 tc2->describeTo(tcfmt);
00395 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00396 fmt << tcfmt;
00397 }
00398
00399 {
00400 String tcfmt;
00401 tc3->describeTo(tcfmt);
00402 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00403 fmt << tcfmt;
00404 }
00405
00406 {
00407 String tcfmt;
00408 tc4->describeTo(tcfmt);
00409 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00410 fmt << tcfmt;
00411 }
00412
00413 {
00414 String tcfmt;
00415 tc5->describeTo(tcfmt);
00416 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00417 fmt << tcfmt;
00418 }
00419
00420 fmt += MOCKPP_PCHAR("is void");
00421 buffer += fmt;
00422
00423 return buffer;
00424 }
00425
00426 private:
00427
00428 TriggeredConstraint<T1> *tc1;
00429 TriggeredConstraint<T2> *tc2;
00430 TriggeredConstraint<T3> *tc3;
00431 TriggeredConstraint<T4> *tc4;
00432 TriggeredConstraint<T5> *tc5;
00433 };
00434
00435
00440 template < typename T1
00441 , typename T2
00442 , typename T3
00443 , typename T4
00444 , typename T5
00445 , typename T6
00446 >
00447 class TriggerStub6 : public TypelessStub<void>
00448 {
00449 public:
00450
00459 TriggerStub6( TriggeredConstraint<T1> *in_tc1
00460 , TriggeredConstraint<T2> *in_tc2
00461 , TriggeredConstraint<T3> *in_tc3
00462 , TriggeredConstraint<T4> *in_tc4
00463 , TriggeredConstraint<T5> *in_tc5
00464 , TriggeredConstraint<T6> *in_tc6
00465 )
00466 : tc1(in_tc1)
00467 , tc2(in_tc2)
00468 , tc3(in_tc3)
00469 , tc4(in_tc4)
00470 , tc5(in_tc5)
00471 , tc6(in_tc6)
00472 {}
00473
00477 virtual void typelessInvoke()
00478 {
00479 tc1->trigger();
00480 tc2->trigger();
00481 tc3->trigger();
00482 tc4->trigger();
00483 tc5->trigger();
00484 tc6->trigger();
00485 }
00486
00491 virtual String describeTo( String &buffer ) const
00492 {
00493 String fmt;
00494 {
00495 String tcfmt;
00496 tc1->describeTo(tcfmt);
00497 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00498 fmt << tcfmt;
00499 }
00500
00501 {
00502 String tcfmt;
00503 tc2->describeTo(tcfmt);
00504 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00505 fmt << tcfmt;
00506 }
00507
00508 {
00509 String tcfmt;
00510 tc3->describeTo(tcfmt);
00511 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00512 fmt << tcfmt;
00513 }
00514
00515 {
00516 String tcfmt;
00517 tc4->describeTo(tcfmt);
00518 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00519 fmt << tcfmt;
00520 }
00521
00522 {
00523 String tcfmt;
00524 tc5->describeTo(tcfmt);
00525 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00526 fmt << tcfmt;
00527 }
00528
00529 {
00530 String tcfmt;
00531 tc6->describeTo(tcfmt);
00532 fmt += MOCKPP_PCHAR("triggers [%1]\n");
00533 fmt << tcfmt;
00534 }
00535
00536 fmt += MOCKPP_PCHAR("is void");
00537 buffer += fmt;
00538
00539 return buffer;
00540 }
00541
00542 private:
00543
00544 TriggeredConstraint<T1> *tc1;
00545 TriggeredConstraint<T2> *tc2;
00546 TriggeredConstraint<T3> *tc3;
00547 TriggeredConstraint<T4> *tc4;
00548 TriggeredConstraint<T5> *tc5;
00549 TriggeredConstraint<T6> *tc6;
00550 };
00551
00552
00553 MOCKPP_NS_END
00554
00555
00556 #endif // MOCKPP_TriggerStub_H
00557