[Mockpp-commits] mockpp/mockpp/chaining CoreMock.h,1.14,1.15 FIFOInvocationDispatcher.h,1.13,1.14 LI
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-04-03 21:50:06
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29266/mockpp/chaining Modified Files: CoreMock.h FIFOInvocationDispatcher.h LIFOInvocationDispatcher.h mockpp_pti.h Log Message: more efforts for msvc6 Index: mockpp_pti.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/mockpp_pti.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- mockpp_pti.h 3 Apr 2005 18:32:53 -0000 1.6 +++ mockpp_pti.h 3 Apr 2005 21:49:57 -0000 1.7 @@ -30,7 +30,6 @@ #ifndef MOCKPP_PTI_H #define MOCKPP_PTI_H - #ifdef MOCKPP_PTI_WEAKNESS // Partial Template Instantiation Weakness #include <mockpp/mockpp.h> @@ -62,15 +61,9 @@ #define MOCKPP_PTI_IMPLEMENT(I) /* empty by default */ #define MOCKPP_PTI_DECLARE(I) /* empty by default */ -#define MOCKPP_PTI_IMPLEMENT_BASICS /* empty by default */ #endif -/** @def MOCKPP_PTI_IMPLEMENT_BASICS - * Instantiate basic methods for compilers with - * weak template support. - */ - /** @def MOCKPP_PTI_IMPLEMENT * Instantiate specialized methods for compilers with * weak template support. Index: CoreMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/CoreMock.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- CoreMock.h 3 Apr 2005 18:32:53 -0000 1.14 +++ CoreMock.h 3 Apr 2005 21:49:57 -0000 1.15 @@ -126,44 +126,45 @@ }; -#define MOCKPP_COREMOCK_PTI_IMPL(I) -#define MOCKPP_COREMOCK_PTI_DECL(I) +#define MOCKPP_COREMOCK_PTI_IMPL(I) +#define MOCKPP_COREMOCK_PTI_DECL(I) #else // MOCKPP_PTI_WEAKNESS Partial Template Instantiation Weakness -/** Declare specialized methods for mockpp::CoreMock. - * Neccessary for compiler with weak template capabilities. + +/** Declare a specialized class for mockpp::CoreMock. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_COREMOCK_PTI_DECL(I) \ template<> \ void mockpp::CoreMock<void, I >; - -/** Implement specialized methods for mockpp::CoreMock. - * Neccessary for compiler with weak template capabilities. + +/** Implement a specialized class for mockpp::CoreMock. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_COREMOCK_PTI_IMPL(I) \ -namespace mockpp { \ +namespace mockpp { \ template<> \ -class CoreMock<void, I> : public AbstractDynamicChainingMock<void, I> \ -{ \ - public: \ - CoreMock<void, I>( InvocationDispatcher<void, I>::AP invocationDispatcher, \ - const String &name, \ - VerifiableList *parent) \ - : AbstractDynamicChainingMock<void, I>( invocationDispatcher, name, parent ) \ - {} \ - \ - CoreMock<void, I>( const String &name, VerifiableList *parent) \ - : AbstractDynamicChainingMock<void, I>( name, parent) \ - {} \ - \ - void mockpp::CoreMock<void, I >::invoke( const I &invocation ) \ +class CoreMock<void, I> : public AbstractDynamicChainingMock<void, I> \ +{ \ + public: \ + CoreMock<void, I>( InvocationDispatcher<void, I>::AP invocationDispatcher, \ + const String &name, \ + VerifiableList *parent) \ + : AbstractDynamicChainingMock<void, I>( invocationDispatcher, name, parent ) \ + {} \ + \ + CoreMock<void, I>( const String &name, VerifiableList *parent) \ + : AbstractDynamicChainingMock<void, I>( name, parent) \ + {} \ + \ + void invoke( const I &invocation ) \ { \ mockInvocation( invocation ); \ } \ -}; \ +}; \ } #endif Index: LIFOInvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/LIFOInvocationDispatcher.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- LIFOInvocationDispatcher.h 3 Apr 2005 18:32:53 -0000 1.13 +++ LIFOInvocationDispatcher.h 3 Apr 2005 21:49:57 -0000 1.14 @@ -107,40 +107,50 @@ }; -#else // MOCKPP_PTI_WEAKNESS Partial Template Instantiation Weakness +#define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_IMPL(I) +#define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_DECL(I) -#define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_IMPL(I) -#define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_DECL(I) +#else // MOCKPP_PTI_WEAKNESS Partial Template Instantiation Weakness -/** Declare specialized methods for mockpp::LIFOInvocationDispatcher. - * Neccessary for compiler with weak template capabilities. +/** Declare a specialized class for mockpp::LIFOInvocationDispatcher. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_DECL(I) \ template<> \ void mockpp::LIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ); -/** Implement specialized methods for mockpp::LIFOInvocationDispatcher. - * Neccessary for compiler with weak template capabilities. + +/** Implement a specialized class for mockpp::LIFOInvocationDispatcher. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_IMPL(I) \ +namespace mockpp { \ template<> \ -void mockpp::LIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ) \ +class LIFOInvocationDispatcher<void, I> : public AbstractInvocationDispatcher<void, I> \ { \ - Iterator it = this->invokables.rbegin(); \ - Iterator end = this->invokables.rend(); \ - for ( /**/; it != end; ++it ) \ + protected: \ + typedef AbstractInvocationDispatcher<void, I>::ReverseIterator Iterator; \ + \ + void dispatch( const I &invocation ) \ { \ - if ( ( *it ) ->matches( invocation ) ) \ + Iterator it = this->invokables.rbegin(); \ + Iterator end = this->invokables.rend(); \ + for ( /**/; it != end; ++it ) \ { \ - ( *it ) ->invoke( invocation ); \ - return; \ + if ( ( *it ) ->matches( invocation ) ) \ + { \ + ( *it ) ->invoke( invocation ); \ + return; \ + } \ } \ + \ + this->defaultStub->invoke( invocation ); \ } \ - \ - this->defaultStub->invoke( invocation ); \ -} \ +}; \ +} + #endif Index: FIFOInvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/FIFOInvocationDispatcher.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- FIFOInvocationDispatcher.h 3 Apr 2005 18:32:53 -0000 1.13 +++ FIFOInvocationDispatcher.h 3 Apr 2005 21:49:57 -0000 1.14 @@ -107,42 +107,50 @@ }; -#define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_IMPL(I) -#define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_DECL(I) +#define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_IMPL(I) +#define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_DECL(I) #else // MOCKPP_PTI_WEAKNESS Partial Template Instantiation Weakness -/** Declare specialized methods for mockpp::FIFOInvocationDispatcher. - * Neccessary for compiler with weak template capabilities. +/** Declare a specialized class for mockpp::FIFOInvocationDispatcher. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_DECL(I) \ template<> \ void mockpp::FIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ); -/** Implement specialized methods for mockpp::FIFOInvocationDispatcher. - * Neccessary for compiler with weak template capabilities. + +/** Implement a specialized class for mockpp::FIFOInvocationDispatcher. + * Neccessary for compilers with weak template capabilities. */ #define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_IMPL(I) \ +namespace mockpp { \ template<> \ -void mockpp::FIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ) \ +class FIFOInvocationDispatcher<void, I> : public AbstractInvocationDispatcher<void, I> \ { \ - Iterator it = this->invokables.begin(); \ - Iterator end = this->invokables.end(); \ - for ( /**/; it != end; ++it ) \ + protected: \ + typedef AbstractInvocationDispatcher<void, I>::Iterator Iterator; \ + \ + void dispatch( const I &invocation ) \ { \ - if ( ( *it ) ->matches( invocation ) ) \ + Iterator it = this->invokables.begin(); \ + Iterator end = this->invokables.end(); \ + for ( /**/; it != end; ++it ) \ { \ - ( *it ) ->invoke( invocation ); \ - return; \ + if ( ( *it ) ->matches( invocation ) ) \ + { \ + ( *it ) ->invoke( invocation ); \ + return; \ + } \ } \ + \ + this->defaultStub->invoke( invocation ); \ } \ -\ - this->defaultStub->invoke( invocation ); \ +}; \ } - #endif |