[Mockpp-commits] mockpp/mockpp/chaining OnConsecutiveCalls.h,NONE,1.1 gen_consecutive_N.pl,NONE,1.1
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2006-04-07 19:54:20
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16579/mockpp/chaining Modified Files: ChainingMockObjectSupport.h Makefile.am Added Files: OnConsecutiveCalls.h gen_consecutive_N.pl Log Message: new generator script --- NEW FILE: OnConsecutiveCalls.h --- /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_consecutive_N.pl. $Id: OnConsecutiveCalls.h,v 1.1 2006/04/07 19:54:14 ewald-arnold Exp $ ***************************************************************************/ /************************************************************************** begin : Fri Apr 7 2006 copyright : (C) 2002-2006 by Ewald Arnold email : mockpp at ewald-arnold dot de This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #ifndef MOCKPP_ONCONSECUTIVECALLS_H #define MOCKPP_ONCONSECUTIVECALLS_H #include <mockpp/mockpp.h> // always first MOCKPP_NS_START /** Creates a sequence of 1 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 1 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 2 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 2 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 3 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 3 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 4 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 4 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 5 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 5 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 6 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 , TypelessStub<R> *stub6 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 6 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 , Stub<R, I> *stub6 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 7 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 , TypelessStub<R> *stub6 , TypelessStub<R> *stub7 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 7 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 , Stub<R, I> *stub6 , Stub<R, I> *stub7 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 8 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 , TypelessStub<R> *stub6 , TypelessStub<R> *stub7 , TypelessStub<R> *stub8 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 8 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 , Stub<R, I> *stub6 , Stub<R, I> *stub7 , Stub<R, I> *stub8 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 9 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @param stub9 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 , TypelessStub<R> *stub6 , TypelessStub<R> *stub7 , TypelessStub<R> *stub8 , TypelessStub<R> *stub9 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); vec.push_back( stub9); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 9 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @param stub9 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 , Stub<R, I> *stub6 , Stub<R, I> *stub7 , Stub<R, I> *stub8 , Stub<R, I> *stub9 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); vec.push_back( stub9); return new StubSequence<R, I>( vec.begin(), vec.end() ); } /** Creates a sequence of 10 typeless stubs. * @ingroup grp_stub_abbrev * @see mockpp::TypelessStubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @param stub9 the next stub * @param stub10 the next stub * @return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1 , TypelessStub<R> *stub2 , TypelessStub<R> *stub3 , TypelessStub<R> *stub4 , TypelessStub<R> *stub5 , TypelessStub<R> *stub6 , TypelessStub<R> *stub7 , TypelessStub<R> *stub8 , TypelessStub<R> *stub9 , TypelessStub<R> *stub10 ) { MOCKPP_STL::vector<TypelessStub<R>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); vec.push_back( stub9); vec.push_back( stub10); return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of 10 stubs. * @ingroup grp_stub_abbrev * @see mockpp::StubSequence * @param stub1 first stub * @param stub2 the next stub * @param stub3 the next stub * @param stub4 the next stub * @param stub5 the next stub * @param stub6 the next stub * @param stub7 the next stub * @param stub8 the next stub * @param stub9 the next stub * @param stub10 the next stub * @return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1 , Stub<R, I> *stub2 , Stub<R, I> *stub3 , Stub<R, I> *stub4 , Stub<R, I> *stub5 , Stub<R, I> *stub6 , Stub<R, I> *stub7 , Stub<R, I> *stub8 , Stub<R, I> *stub9 , Stub<R, I> *stub10 ) { MOCKPP_STL::vector<Stub<R, I>*> vec; vec.push_back( stub1); vec.push_back( stub2); vec.push_back( stub3); vec.push_back( stub4); vec.push_back( stub5); vec.push_back( stub6); vec.push_back( stub7); vec.push_back( stub8); vec.push_back( stub9); vec.push_back( stub10); return new StubSequence<R, I>( vec.begin(), vec.end() ); } MOCKPP_NS_END #endif // MOCKPP_ONCONSECUTIVECALLS_H Index: ChainingMockObjectSupport.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainingMockObjectSupport.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ChainingMockObjectSupport.h 15 Mar 2006 21:34:02 -0000 1.25 +++ ChainingMockObjectSupport.h 7 Apr 2006 19:54:10 -0000 1.26 @@ -394,190 +394,6 @@ } -/** Creates a sequence of typeless stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::TypelessStubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @return the new stub - */ -template <typename R> -typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1, - TypelessStub<R> *stub2 ) -{ - MOCKPP_STL::vector<TypelessStub<R>*> vec; - vec.push_back( stub1); - vec.push_back( stub2); - return new TypelessStubSequence<R>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::StubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @return the new stub - */ -template <typename R, // ReturnType - typename I> // Invocation -typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1, - Stub<R, I> *stub2 ) -{ - MOCKPP_STL::vector<Stub<R, I>*> vec; - vec.push_back( stub1); - vec.push_back( stub2); - return new StubSequence<R, I>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of typeless stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::TypelessStubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @return the new stub - */ -template <typename R> -typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1, - TypelessStub<R> *stub2, - TypelessStub<R> *stub3 ) -{ - MOCKPP_STL::vector<TypelessStub<R>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - return new TypelessStubSequence<R>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::StubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @return the new stub - */ -template <typename R, // ReturnType - typename I> // Invocation -typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1, - Stub<R, I> *stub2, - Stub<R, I> *stub3 ) -{ - MOCKPP_STL::vector<Stub<R, I>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - return new StubSequence<R, I>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of typeless stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::TypelessStubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @param stub4 the next stub - * @return the new stub - */ -template <typename R> -typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1, - TypelessStub<R> *stub2, - TypelessStub<R> *stub3, - TypelessStub<R> *stub4 ) -{ - MOCKPP_STL::vector<TypelessStub<R>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - vec.push_back( stub4 ); - return new TypelessStubSequence<R>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::StubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @param stub4 the next stub - * @return the new stub - */ -template <typename R, // ReturnType - typename I> // Invocation -typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1, - Stub<R, I> *stub2, - Stub<R, I> *stub3, - Stub<R, I> *stub4 ) -{ - MOCKPP_STL::vector<Stub<R, I>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - vec.push_back( stub4 ); - return new StubSequence<R, I>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of typeless stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::TypelessStubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @param stub4 the next stub - * @param stub5 the next stub - * @return the new stub - */ -template <typename R> -typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1, - TypelessStub<R> *stub2, - TypelessStub<R> *stub3, - TypelessStub<R> *stub4, - TypelessStub<R> *stub5 ) -{ - MOCKPP_STL::vector<TypelessStub<R>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - vec.push_back( stub4 ); - vec.push_back( stub5 ); - return new TypelessStubSequence<R>( vec.begin(), vec.end() ); -} - - -/** Creates a sequence of stubs. - * @ingroup grp_stub_abbrev - * @see MOCKPP_NS::StubSequence - * @param stub1 first stub - * @param stub2 the next stub - * @param stub3 the next stub - * @param stub4 the next stub - * @param stub5 the next stub - * @return the new stub - */ -template <typename R, // ReturnType - typename I> // Invocation -typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1, - Stub<R, I> *stub2, - Stub<R, I> *stub3, - Stub<R, I> *stub4, - Stub<R, I> *stub5 ) -{ - MOCKPP_STL::vector<Stub<R, I>*> vec; - vec.push_back( stub1 ); - vec.push_back( stub2 ); - vec.push_back( stub3 ); - vec.push_back( stub4 ); - vec.push_back( stub5 ); - return new StubSequence<R, I>( vec.begin(), vec.end() ); -} - - /** Creates a matcher to verify a single invocation * @ingroup grp_matcher_abbrev * @see MOCKPP_NS::InvokeOnceMatcher @@ -646,6 +462,9 @@ MOCKPP_NS_END +#include "OnConsecutiveCalls.h" + + /** Imports the abbreviations into the global namespace to enhance redability * by omitting namespace prefix. */ Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Makefile.am 10 Dec 2005 20:07:21 -0000 1.17 +++ Makefile.am 7 Apr 2006 19:54:13 -0000 1.18 @@ -17,11 +17,12 @@ ChainableMockMethod5.h \ ChainableMockMethod6.h \ ChainableMockObject.h CountedChainableMethod.h \ - InvocationN.h + InvocationN.h OnConsecutiveCalls.h EXTRA_DIST = \ gen_chainablemethod_N.pl \ gen_countchainable_N.pl \ + gen_consecutive_N.pl \ gen_invocation_N.pl libchainingincludedir = $(includedir)/mockpp/chaining --- NEW FILE: gen_consecutive_N.pl --- #!/usr/bin/perl -w # # $Id: gen_consecutive_N.pl,v 1.1 2006/04/07 19:54:14 ewald-arnold Exp $ use English; if ($#ARGV < 0) { print "Usage: perl gen_consecutive_N <number of arguments>\n"; exit; } $totalNumArgs = $ARGV[0]; if ($totalNumArgs < 10) { $totalNumArgs = 10; } open OUT, ">OnConsecutiveCalls.h"; print OUT "/** \@file \@internal NOT INTENDED FOR PUBLIC INCLUSION \@brief Generated with gen_consecutive_N.pl. \$I" . "d: CountedChainableMethod.h,v 1.7 2005/10/19 20:53:09 ewald-arnold Exp \$ ***************************************************************************/ /************************************************************************** begin : Fri Apr 7 2006 copyright : (C) 2002-2006 by Ewald Arnold email : mockpp at ewald-arnold dot de This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #ifndef MOCKPP_ONCONSECUTIVECALLS_H #define MOCKPP_ONCONSECUTIVECALLS_H #include <mockpp/mockpp.h> // always first MOCKPP_NS_START "; for ($numArgs = 1; $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; } print "Creating onConsectiveCalls " . $numArgs ."\n"; print OUT " /** Creates a sequence of " . $numArgs . " typeless stubs. * \@ingroup grp_stub_abbrev * \@see mockpp::TypelessStubSequence * \@param stub1 first stub"; for($p = 2; $p <= $numArgs; ++$p) { print OUT " * \@param stub" . $p . " the next stub"; } print OUT " * \@return the new stub */ template <typename R> typename TypelessStub<R>::AP onConsecutiveCalls( TypelessStub<R> *stub1"; for($p = 2; $p <= $numArgs; ++$p) { print OUT " , TypelessStub<R> *stub" . $p; } print OUT " ) { MOCKPP_STL::vector<TypelessStub<R>*> vec;"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " vec.push_back( stub" . $p . ");" }; print OUT " return new TypelessStubSequence<R>( vec.begin(), vec.end() ); } /** Creates a sequence of " . $numArgs . " stubs. * \@ingroup grp_stub_abbrev * \@see mockpp::StubSequence * \@param stub1 first stub"; for($p = 2; $p <= $numArgs; ++$p) { print OUT " * \@param stub" . $p . " the next stub"; } print OUT " * \@return the new stub */ template <typename R, // ReturnType typename I> // Invocation typename Stub<R, I>::AP onConsecutiveCalls( Stub<R, I> *stub1"; for($p = 2; $p <= $numArgs; ++$p) { print OUT " , Stub<R, I> *stub" . $p; } print OUT " ) { MOCKPP_STL::vector<Stub<R, I>*> vec;"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " vec.push_back( stub" . $p . ");" }; print OUT " return new StubSequence<R, I>( vec.begin(), vec.end() ); } " } print OUT " MOCKPP_NS_END #endif // MOCKPP_ONCONSECUTIVECALLS_H "; close OUT; |