[Mockpp-commits] mockpp/mockpp/chaining ChainableMockMethod0.h,1.5,1.6 ChainableMockMethod1.h,1.5,1.
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-10-31 19:01:50
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30977/chaining Modified Files: ChainableMockMethod0.h ChainableMockMethod1.h ChainableMockMethod2.h ChainableMockMethod3.h ChainableMockMethod4.h ChainableMockMethod5.h ChainableMockMethod6.h CountedChainableMethod.h InvocationN.h gen_chainablemethod_N.pl gen_countchainable_N.pl Log Message: fixes bcb5 Index: ChainableMockMethod6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod6.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ChainableMockMethod6.h 29 Oct 2005 21:00:26 -0000 1.3 +++ ChainableMockMethod6.h 31 Oct 2005 19:01:00 -0000 1.4 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: ChainableMockMethod2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod2.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod2.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod2.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: ChainableMockMethod3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod3.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod3.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod3.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: gen_countchainable_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/gen_countchainable_N.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gen_countchainable_N.pl 30 Oct 2005 13:51:43 -0000 1.1 +++ gen_countchainable_N.pl 31 Oct 2005 19:01:00 -0000 1.2 @@ -51,7 +51,8 @@ #ifndef MOCKPP_COUNTEDCHAINABLEMETHOD_H #define MOCKPP_COUNTEDCHAINABLEMETHOD_H -#include <mockpp/CountParameters.h>"; +#include <mockpp/CountParameters.h> +"; for ($p = 0; $p <= $totalNumArgs; ++$p) { print OUT " #include <mockpp/chaining/ChainableMockMethod" . $p . ".h>";} @@ -61,6 +62,8 @@ namespace mockpp { + +#ifndef MOCKPP_COUNTED_WEAKNESS template<unsigned params> class SwitchChainable @@ -123,27 +126,95 @@ print OUT " template< typename R - , typename P1 = NoParameter"; + , typename P1 = NoParameter"; for($p = 2; $p <= $totalNumArgs; ++$p) { print OUT " , typename P" . $p . " = NoParameter"; }; print OUT "> class ChainableMockMethod - : public SwitchChainable<CountParameters<R, " . $templateArgs . ">::value > + : public SwitchChainable<CountParameters<R, " . $templateArgs . ">::value > ::template Method<R, " . $templateArgs . "> - ::ChainableMockMethodType + ::ChainableMockMethodType { public: - - ChainableMockMethod(const String &name, ChainableMockObject *parent ) + + ChainableMockMethod(const String &name, ChainableMockObject *parent ) : SwitchChainable<CountParameters<R, " . $templateArgs . ">::value > ::template Method<R, " . $templateArgs . "> ::ChainableMockMethodType(name, parent) { + } +}; + + +#else // MOCKPP_COUNTED_WEAKNESS + + +template< typename R + , typename P1 = NoParameter"; + +for($p = 2; $p <= $totalNumArgs+1; ++$p) { print OUT " + , typename P" . $p . " = NoParameter"; }; + +print OUT "> +class ChainableMockMethod +{ +}; + +"; + +for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) { + + $templateParms = ""; + $templateParms_colon = ""; + for ($i = 1; $i <= $numArgs; ++$i) { + if ($i > 1) { + $templateParms .= ", "; + } + $templateParms .= "typename P$i"; + } + if ($numArgs > 0) { + $templateParms_colon = ", " . $templateParms; } + + + $templateArgs_colon = ""; + $_ = $templateParms; + s/typename //g; + $templateArgs = $_; + if ($numArgs > 0) { + $templateArgs_colon = ", ". $templateArgs; } + + $noParamArgs = $templateArgs; + for ($i = $numArgs+1; $i <= $totalNumArgs; ++$i) { + if ($i > 1) { + $noParamArgs .= ", "; } + $noParamArgs .= "NoParameter"; + } + + +print OUT " +template<typename R" . $templateParms_colon . "> +class ChainableMockMethod<R, " . $noParamArgs . "> + : public ChainableMockMethod" . $numArgs . "<R" . $templateArgs_colon . "> +{ + public: + + ChainableMockMethod<R, " . $noParamArgs . "> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod" . $numArgs . "<R" . $templateArgs_colon . ">(name, parent) + { + } }; +"; + +} + +print OUT " +#endif // MOCKPP_COUNTED_WEAKNESS + } // ns mockpp Index: CountedChainableMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/CountedChainableMethod.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CountedChainableMethod.h 30 Oct 2005 13:51:43 -0000 1.1 +++ CountedChainableMethod.h 31 Oct 2005 19:01:00 -0000 1.2 @@ -32,6 +32,7 @@ #define MOCKPP_COUNTEDCHAINABLEMETHOD_H #include <mockpp/CountParameters.h> + #include <mockpp/chaining/ChainableMockMethod0.h> #include <mockpp/chaining/ChainableMockMethod1.h> #include <mockpp/chaining/ChainableMockMethod2.h> @@ -43,6 +44,8 @@ namespace mockpp { + +#ifndef MOCKPP_COUNTED_WEAKNESS template<unsigned params> class SwitchChainable @@ -205,21 +208,138 @@ , typename P5 = NoParameter , typename P6 = NoParameter> class ChainableMockMethod - : public SwitchChainable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value > + : public SwitchChainable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value > ::template Method<R, P1, P2, P3, P4, P5, P6> - ::ChainableMockMethodType + ::ChainableMockMethodType { public: - - ChainableMockMethod(const String &name, ChainableMockObject *parent ) + + ChainableMockMethod(const String &name, ChainableMockObject *parent ) : SwitchChainable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value > ::template Method<R, P1, P2, P3, P4, P5, P6> ::ChainableMockMethodType(name, parent) { - } + } +}; + + +#else // MOCKPP_COUNTED_WEAKNESS + + +template< typename R + , typename P1 = NoParameter + , typename P2 = NoParameter + , typename P3 = NoParameter + , typename P4 = NoParameter + , typename P5 = NoParameter + , typename P6 = NoParameter + , typename P7 = NoParameter> +class ChainableMockMethod +{ +}; + + +template<typename R> +class ChainableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> + : public ChainableMockMethod0<R> +{ + public: + + ChainableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod0<R>(name, parent) + { + } +}; + + +template<typename R, typename P1> +class ChainableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> + : public ChainableMockMethod1<R, P1> +{ + public: + + ChainableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod1<R, P1>(name, parent) + { + } +}; + + +template<typename R, typename P1, typename P2> +class ChainableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> + : public ChainableMockMethod2<R, P1, P2> +{ + public: + + ChainableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod2<R, P1, P2>(name, parent) + { + } }; +template<typename R, typename P1, typename P2, typename P3> +class ChainableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> + : public ChainableMockMethod3<R, P1, P2, P3> +{ + public: + + ChainableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod3<R, P1, P2, P3>(name, parent) + { + } +}; + + +template<typename R, typename P1, typename P2, typename P3, typename P4> +class ChainableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> + : public ChainableMockMethod4<R, P1, P2, P3, P4> +{ + public: + + ChainableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod4<R, P1, P2, P3, P4>(name, parent) + { + } +}; + + +template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5> +class ChainableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> + : public ChainableMockMethod5<R, P1, P2, P3, P4, P5> +{ + public: + + ChainableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod5<R, P1, P2, P3, P4, P5>(name, parent) + { + } +}; + + +template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6> +class ChainableMockMethod<R, P1, P2, P3, P4, P5, P6> + : public ChainableMockMethod6<R, P1, P2, P3, P4, P5, P6> +{ + public: + + ChainableMockMethod<R, P1, P2, P3, P4, P5, P6> + (const String &name, ChainableMockObject *parent ) + : ChainableMockMethod6<R, P1, P2, P3, P4, P5, P6>(name, parent) + { + } +}; + + +#endif // MOCKPP_COUNTED_WEAKNESS + + } // ns mockpp Index: ChainableMockMethod4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod4.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod4.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod4.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: gen_chainablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/gen_chainablemethod_N.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gen_chainablemethod_N.pl 29 Oct 2005 21:00:26 -0000 1.3 +++ gen_chainablemethod_N.pl 31 Oct 2005 19:01:00 -0000 1.4 @@ -231,6 +231,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: ChainableMockMethod5.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod5.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod5.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod5.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: ChainableMockMethod0.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod0.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod0.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod0.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; Index: ChainableMockMethod1.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainableMockMethod1.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChainableMockMethod1.h 29 Oct 2005 21:00:26 -0000 1.5 +++ ChainableMockMethod1.h 31 Oct 2005 19:01:00 -0000 1.6 @@ -93,6 +93,8 @@ } }; + friend class ChainerFor; + private: mutable CoreMockType coremock; |