File indexing completed on 2025-08-09 08:19:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
0042 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
0043
0044 #include "gmock/internal/gmock-port.h"
0045
0046 namespace testing {
0047
0048 template <typename T>
0049 class Matcher;
0050
0051 namespace internal {
0052
0053
0054
0055 class IgnoredValue {
0056 public:
0057
0058
0059
0060
0061
0062 template <typename T>
0063 IgnoredValue(const T& ) {}
0064 };
0065
0066
0067
0068 template <typename Tuple>
0069 struct MatcherTuple;
0070
0071 template <>
0072 struct MatcherTuple< ::testing::tuple<> > {
0073 typedef ::testing::tuple< > type;
0074 };
0075
0076 template <typename A1>
0077 struct MatcherTuple< ::testing::tuple<A1> > {
0078 typedef ::testing::tuple<Matcher<A1> > type;
0079 };
0080
0081 template <typename A1, typename A2>
0082 struct MatcherTuple< ::testing::tuple<A1, A2> > {
0083 typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
0084 };
0085
0086 template <typename A1, typename A2, typename A3>
0087 struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
0088 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
0089 };
0090
0091 template <typename A1, typename A2, typename A3, typename A4>
0092 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
0093 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
0094 Matcher<A4> > type;
0095 };
0096
0097 template <typename A1, typename A2, typename A3, typename A4, typename A5>
0098 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
0099 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0100 Matcher<A5> > type;
0101 };
0102
0103 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0104 typename A6>
0105 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
0106 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0107 Matcher<A5>, Matcher<A6> > type;
0108 };
0109
0110 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0111 typename A6, typename A7>
0112 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
0113 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0114 Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
0115 };
0116
0117 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0118 typename A6, typename A7, typename A8>
0119 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
0120 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0121 Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
0122 };
0123
0124 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0125 typename A6, typename A7, typename A8, typename A9>
0126 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
0127 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0128 Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
0129 };
0130
0131 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0132 typename A6, typename A7, typename A8, typename A9, typename A10>
0133 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
0134 A10> > {
0135 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0136 Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
0137 Matcher<A10> > type;
0138 };
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 template <typename F>
0154 struct Function;
0155
0156 template <typename R>
0157 struct Function<R()> {
0158 typedef R Result;
0159 typedef ::testing::tuple<> ArgumentTuple;
0160 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0161 typedef void MakeResultVoid();
0162 typedef IgnoredValue MakeResultIgnoredValue();
0163 };
0164
0165 template <typename R, typename A1>
0166 struct Function<R(A1)>
0167 : Function<R()> {
0168 typedef A1 Argument1;
0169 typedef ::testing::tuple<A1> ArgumentTuple;
0170 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0171 typedef void MakeResultVoid(A1);
0172 typedef IgnoredValue MakeResultIgnoredValue(A1);
0173 };
0174
0175 template <typename R, typename A1, typename A2>
0176 struct Function<R(A1, A2)>
0177 : Function<R(A1)> {
0178 typedef A2 Argument2;
0179 typedef ::testing::tuple<A1, A2> ArgumentTuple;
0180 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0181 typedef void MakeResultVoid(A1, A2);
0182 typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
0183 };
0184
0185 template <typename R, typename A1, typename A2, typename A3>
0186 struct Function<R(A1, A2, A3)>
0187 : Function<R(A1, A2)> {
0188 typedef A3 Argument3;
0189 typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
0190 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0191 typedef void MakeResultVoid(A1, A2, A3);
0192 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
0193 };
0194
0195 template <typename R, typename A1, typename A2, typename A3, typename A4>
0196 struct Function<R(A1, A2, A3, A4)>
0197 : Function<R(A1, A2, A3)> {
0198 typedef A4 Argument4;
0199 typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
0200 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0201 typedef void MakeResultVoid(A1, A2, A3, A4);
0202 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
0203 };
0204
0205 template <typename R, typename A1, typename A2, typename A3, typename A4,
0206 typename A5>
0207 struct Function<R(A1, A2, A3, A4, A5)>
0208 : Function<R(A1, A2, A3, A4)> {
0209 typedef A5 Argument5;
0210 typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
0211 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0212 typedef void MakeResultVoid(A1, A2, A3, A4, A5);
0213 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
0214 };
0215
0216 template <typename R, typename A1, typename A2, typename A3, typename A4,
0217 typename A5, typename A6>
0218 struct Function<R(A1, A2, A3, A4, A5, A6)>
0219 : Function<R(A1, A2, A3, A4, A5)> {
0220 typedef A6 Argument6;
0221 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
0222 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0223 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
0224 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
0225 };
0226
0227 template <typename R, typename A1, typename A2, typename A3, typename A4,
0228 typename A5, typename A6, typename A7>
0229 struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
0230 : Function<R(A1, A2, A3, A4, A5, A6)> {
0231 typedef A7 Argument7;
0232 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
0233 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0234 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
0235 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
0236 };
0237
0238 template <typename R, typename A1, typename A2, typename A3, typename A4,
0239 typename A5, typename A6, typename A7, typename A8>
0240 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
0241 : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
0242 typedef A8 Argument8;
0243 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
0244 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0245 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
0246 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
0247 };
0248
0249 template <typename R, typename A1, typename A2, typename A3, typename A4,
0250 typename A5, typename A6, typename A7, typename A8, typename A9>
0251 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
0252 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
0253 typedef A9 Argument9;
0254 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
0255 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0256 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
0257 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
0258 A9);
0259 };
0260
0261 template <typename R, typename A1, typename A2, typename A3, typename A4,
0262 typename A5, typename A6, typename A7, typename A8, typename A9,
0263 typename A10>
0264 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
0265 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
0266 typedef A10 Argument10;
0267 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
0268 A10> ArgumentTuple;
0269 typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0270 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
0271 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
0272 A9, A10);
0273 };
0274
0275 }
0276
0277 }
0278
0279 #endif