00001 00009 /************************************************************************** 00010 00011 begin : Sun Oct 30 2005 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 00031 #ifndef MOCKPP_COUNTPARAMETERS_N_H 00032 #define MOCKPP_COUNTPARAMETERS_N_H 00033 00034 00035 MOCKPP_NS_START 00036 00037 00041 class NoParameter 00042 { 00043 NoParameter() {} 00044 }; 00045 00046 00050 template<typename T> 00051 class CountIfUsed 00052 { 00053 public: 00054 00055 enum { value = 1 }; 00056 }; 00057 00058 00062 template<> 00063 class CountIfUsed<NoParameter> 00064 { 00065 public: 00066 00067 enum { value = 0 }; 00068 }; 00069 00070 00074 template< typename T 00075 , typename P1 = NoParameter 00076 , typename P2 = NoParameter 00077 , typename P3 = NoParameter 00078 , typename P4 = NoParameter 00079 , typename P5 = NoParameter 00080 , typename P6 = NoParameter> 00081 class CountParameters 00082 { 00083 public: 00084 00085 enum 00086 { value = CountIfUsed<P1>::value 00087 + CountIfUsed<P2>::value 00088 + CountIfUsed<P3>::value 00089 + CountIfUsed<P4>::value 00090 + CountIfUsed<P5>::value 00091 + CountIfUsed<P6>::value 00092 }; 00093 }; 00094 00095 00096 MOCKPP_NS_END 00097 00098 00099 #endif // MOCKPP_COUNTPARAMETERS_N_H 00100