00001 00009 /************************************************************************** 00010 00011 begin : Sun Aug 22 2004 00012 copyright : (C) 2002-2010 by Ewald Arnold 00013 email : mockpp at ewald-arnold dot de 00014 00015 This program is free software; you can redistribute it and/or modify 00016 it under the terms of the GNU Lesser General Public License as 00017 published by the Free Software Foundation; either version 2 of the License, 00018 or (at your option) any later version. 00019 00020 This program is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU Lesser General Public License 00026 along with this program; if not, write to the Free Software 00027 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00028 00029 * 00030 * Original Java Sources: Copyright (c) 2000-2004, jMock.org 00031 * 00032 00033 **/ 00034 00035 #ifndef MOCKPP_ARGUMENTSMATCHBUILDER_H 00036 #define MOCKPP_ARGUMENTSMATCHBUILDER_H 00037 00038 00039 #include <mockpp/mockpp.h> // always first 00040 00041 #include <mockpp/builder/MatchBuilder.h> 00042 00043 #include <mockpp/constraint/ConstraintSet.h> 00044 #include <mockpp/constraint/ConstraintHolder.h> 00045 00046 #include <mockpp/matcher/NoArgumentsMatcher.h> 00047 #include <mockpp/matcher/AnyArgumentsMatcher.h> 00048 #include <mockpp/matcher/MatcherHolder.h> 00049 00050 00051 MOCKPP_NS_START 00052 00053 00058 template <typename R, // Returntype 00059 typename I> // Invocation 00060 class ArgumentsMatchBuilder0 : public MatchBuilder<R,I> 00061 { 00062 public: 00063 00064 typedef R ReturnType; 00065 typedef I InvocationType; 00066 typedef ConstraintSet0 ConstraintSetType; 00067 00072 MatchBuilder<R, I>& with() 00073 { 00074 return withNoArguments(); 00075 } 00076 00081 virtual MatchBuilder<R, I>& addMatcher( const MatcherHolder<I> &matcher ) = 0; 00082 00086 MatchBuilder<R, I>& withNoArguments() 00087 { 00088 return addMatcher( new NoArgumentsMatcher<I>() ); 00089 } 00090 }; 00091 00092 00093 MOCKPP_NS_END 00094 00095 00096 #endif // MOCKPP_ARGUMENTSMATCHBUILDER_H 00097 00098 00099 #include "ArgumentsMatchBuilderN.h" 00100 00101