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_ConstraintSet_N_H
00032 #define MOCKPP_ConstraintSet_N_H
00033
00034
00035
00036
00037 MOCKPP_NS_START
00038
00039
00043 template <typename P1>
00044 class ConstraintSet1
00045 {
00046 public:
00047
00048 typedef P1 ValueType1;
00049
00053 ConstraintSet1( const ConstraintHolder<P1> &in_constraint1)
00054 : constraint1( in_constraint1 )
00055 {}
00056
00059 virtual ~ConstraintSet1()
00060 {}
00061
00066 template <typename I>
00067 bool matches( const I &invocation )
00068 {
00069 return constraint1->eval( invocation.getParameter1() );
00070 }
00071
00076 virtual String describeTo( String &buffer ) const
00077 {
00078 String fmt = MOCKPP_PCHAR( "%1" );
00079 fmt << constraint1->toString();
00080 buffer += fmt;
00081 return buffer;
00082 }
00083
00084 private:
00085
00086 const typename Constraint<P1>::AP constraint1;
00087 };
00088
00089
00093 template <typename P1, typename P2>
00094 class ConstraintSet2
00095 {
00096 public:
00097
00098 typedef P1 ValueType1;
00099 typedef P2 ValueType2;
00100
00105 ConstraintSet2( const ConstraintHolder<P1> &in_constraint1
00106 , const ConstraintHolder<P2> &in_constraint2)
00107 : constraint1( in_constraint1 )
00108 , constraint2( in_constraint2 )
00109 {}
00110
00113 virtual ~ConstraintSet2()
00114 {}
00115
00120 template <typename I>
00121 bool matches( const I &invocation )
00122 {
00123 return constraint1->eval( invocation.getParameter1() )
00124 && constraint2->eval( invocation.getParameter2() );
00125 }
00126
00131 virtual String describeTo( String &buffer ) const
00132 {
00133 String fmt = MOCKPP_PCHAR( "%1, %2" );
00134 fmt << constraint1->toString()
00135 << constraint2->toString();
00136 buffer += fmt;
00137 return buffer;
00138 }
00139
00140 private:
00141
00142 const typename Constraint<P1>::AP constraint1;
00143 const typename Constraint<P2>::AP constraint2;
00144 };
00145
00146
00150 template <typename P1, typename P2, typename P3>
00151 class ConstraintSet3
00152 {
00153 public:
00154
00155 typedef P1 ValueType1;
00156 typedef P2 ValueType2;
00157 typedef P3 ValueType3;
00158
00164 ConstraintSet3( const ConstraintHolder<P1> &in_constraint1
00165 , const ConstraintHolder<P2> &in_constraint2
00166 , const ConstraintHolder<P3> &in_constraint3)
00167 : constraint1( in_constraint1 )
00168 , constraint2( in_constraint2 )
00169 , constraint3( in_constraint3 )
00170 {}
00171
00174 virtual ~ConstraintSet3()
00175 {}
00176
00181 template <typename I>
00182 bool matches( const I &invocation )
00183 {
00184 return constraint1->eval( invocation.getParameter1() )
00185 && constraint2->eval( invocation.getParameter2() )
00186 && constraint3->eval( invocation.getParameter3() );
00187 }
00188
00193 virtual String describeTo( String &buffer ) const
00194 {
00195 String fmt = MOCKPP_PCHAR( "%1, %2, %3" );
00196 fmt << constraint1->toString()
00197 << constraint2->toString()
00198 << constraint3->toString();
00199 buffer += fmt;
00200 return buffer;
00201 }
00202
00203 private:
00204
00205 const typename Constraint<P1>::AP constraint1;
00206 const typename Constraint<P2>::AP constraint2;
00207 const typename Constraint<P3>::AP constraint3;
00208 };
00209
00210
00214 template <typename P1, typename P2, typename P3, typename P4>
00215 class ConstraintSet4
00216 {
00217 public:
00218
00219 typedef P1 ValueType1;
00220 typedef P2 ValueType2;
00221 typedef P3 ValueType3;
00222 typedef P4 ValueType4;
00223
00230 ConstraintSet4( const ConstraintHolder<P1> &in_constraint1
00231 , const ConstraintHolder<P2> &in_constraint2
00232 , const ConstraintHolder<P3> &in_constraint3
00233 , const ConstraintHolder<P4> &in_constraint4)
00234 : constraint1( in_constraint1 )
00235 , constraint2( in_constraint2 )
00236 , constraint3( in_constraint3 )
00237 , constraint4( in_constraint4 )
00238 {}
00239
00242 virtual ~ConstraintSet4()
00243 {}
00244
00249 template <typename I>
00250 bool matches( const I &invocation )
00251 {
00252 return constraint1->eval( invocation.getParameter1() )
00253 && constraint2->eval( invocation.getParameter2() )
00254 && constraint3->eval( invocation.getParameter3() )
00255 && constraint4->eval( invocation.getParameter4() );
00256 }
00257
00262 virtual String describeTo( String &buffer ) const
00263 {
00264 String fmt = MOCKPP_PCHAR( "%1, %2, %3, %4" );
00265 fmt << constraint1->toString()
00266 << constraint2->toString()
00267 << constraint3->toString()
00268 << constraint4->toString();
00269 buffer += fmt;
00270 return buffer;
00271 }
00272
00273 private:
00274
00275 const typename Constraint<P1>::AP constraint1;
00276 const typename Constraint<P2>::AP constraint2;
00277 const typename Constraint<P3>::AP constraint3;
00278 const typename Constraint<P4>::AP constraint4;
00279 };
00280
00281
00285 template <typename P1, typename P2, typename P3, typename P4, typename P5>
00286 class ConstraintSet5
00287 {
00288 public:
00289
00290 typedef P1 ValueType1;
00291 typedef P2 ValueType2;
00292 typedef P3 ValueType3;
00293 typedef P4 ValueType4;
00294 typedef P5 ValueType5;
00295
00303 ConstraintSet5( const ConstraintHolder<P1> &in_constraint1
00304 , const ConstraintHolder<P2> &in_constraint2
00305 , const ConstraintHolder<P3> &in_constraint3
00306 , const ConstraintHolder<P4> &in_constraint4
00307 , const ConstraintHolder<P5> &in_constraint5)
00308 : constraint1( in_constraint1 )
00309 , constraint2( in_constraint2 )
00310 , constraint3( in_constraint3 )
00311 , constraint4( in_constraint4 )
00312 , constraint5( in_constraint5 )
00313 {}
00314
00317 virtual ~ConstraintSet5()
00318 {}
00319
00324 template <typename I>
00325 bool matches( const I &invocation )
00326 {
00327 return constraint1->eval( invocation.getParameter1() )
00328 && constraint2->eval( invocation.getParameter2() )
00329 && constraint3->eval( invocation.getParameter3() )
00330 && constraint4->eval( invocation.getParameter4() )
00331 && constraint5->eval( invocation.getParameter5() );
00332 }
00333
00338 virtual String describeTo( String &buffer ) const
00339 {
00340 String fmt = MOCKPP_PCHAR( "%1, %2, %3, %4, %5" );
00341 fmt << constraint1->toString()
00342 << constraint2->toString()
00343 << constraint3->toString()
00344 << constraint4->toString()
00345 << constraint5->toString();
00346 buffer += fmt;
00347 return buffer;
00348 }
00349
00350 private:
00351
00352 const typename Constraint<P1>::AP constraint1;
00353 const typename Constraint<P2>::AP constraint2;
00354 const typename Constraint<P3>::AP constraint3;
00355 const typename Constraint<P4>::AP constraint4;
00356 const typename Constraint<P5>::AP constraint5;
00357 };
00358
00359
00363 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
00364 class ConstraintSet6
00365 {
00366 public:
00367
00368 typedef P1 ValueType1;
00369 typedef P2 ValueType2;
00370 typedef P3 ValueType3;
00371 typedef P4 ValueType4;
00372 typedef P5 ValueType5;
00373 typedef P6 ValueType6;
00374
00383 ConstraintSet6( const ConstraintHolder<P1> &in_constraint1
00384 , const ConstraintHolder<P2> &in_constraint2
00385 , const ConstraintHolder<P3> &in_constraint3
00386 , const ConstraintHolder<P4> &in_constraint4
00387 , const ConstraintHolder<P5> &in_constraint5
00388 , const ConstraintHolder<P6> &in_constraint6)
00389 : constraint1( in_constraint1 )
00390 , constraint2( in_constraint2 )
00391 , constraint3( in_constraint3 )
00392 , constraint4( in_constraint4 )
00393 , constraint5( in_constraint5 )
00394 , constraint6( in_constraint6 )
00395 {}
00396
00399 virtual ~ConstraintSet6()
00400 {}
00401
00406 template <typename I>
00407 bool matches( const I &invocation )
00408 {
00409 return constraint1->eval( invocation.getParameter1() )
00410 && constraint2->eval( invocation.getParameter2() )
00411 && constraint3->eval( invocation.getParameter3() )
00412 && constraint4->eval( invocation.getParameter4() )
00413 && constraint5->eval( invocation.getParameter5() )
00414 && constraint6->eval( invocation.getParameter6() );
00415 }
00416
00421 virtual String describeTo( String &buffer ) const
00422 {
00423 String fmt = MOCKPP_PCHAR( "%1, %2, %3, %4, %5, %6" );
00424 fmt << constraint1->toString()
00425 << constraint2->toString()
00426 << constraint3->toString()
00427 << constraint4->toString()
00428 << constraint5->toString()
00429 << constraint6->toString();
00430 buffer += fmt;
00431 return buffer;
00432 }
00433
00434 private:
00435
00436 const typename Constraint<P1>::AP constraint1;
00437 const typename Constraint<P2>::AP constraint2;
00438 const typename Constraint<P3>::AP constraint3;
00439 const typename Constraint<P4>::AP constraint4;
00440 const typename Constraint<P5>::AP constraint5;
00441 const typename Constraint<P6>::AP constraint6;
00442 };
00443
00444
00445 MOCKPP_NS_END
00446
00447
00448 #endif // MOCKPP_ConstraintSet_N_H
00449