Monero
Loading...
Searching...
No Matches
gmock-generated-internal-utils.h
Go to the documentation of this file.
1// This file was GENERATED by command:
2// pump.py gmock-generated-internal-utils.h.pump
3// DO NOT EDIT BY HAND!!!
4
5// Copyright 2007, Google Inc.
6// All rights reserved.
7//
8// Redistribution and use in source and binary forms, with or without
9// modification, are permitted provided that the following conditions are
10// met:
11//
12// * Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14// * Redistributions in binary form must reproduce the above
15// copyright notice, this list of conditions and the following disclaimer
16// in the documentation and/or other materials provided with the
17// distribution.
18// * Neither the name of Google Inc. nor the names of its
19// contributors may be used to endorse or promote products derived from
20// this software without specific prior written permission.
21//
22// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33//
34// Author: wan@google.com (Zhanyong Wan)
35
36// Google Mock - a framework for writing C++ mock classes.
37//
38// This file contains template meta-programming utility classes needed
39// for implementing Google Mock.
40
41#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
42#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
43
45
46namespace testing {
47
48template <typename T>
49class Matcher;
50
51namespace internal {
52
53// An IgnoredValue object can be implicitly constructed from ANY value.
54// This is used in implementing the IgnoreResult(a) action.
56 public:
57 // This constructor template allows any value to be implicitly
58 // converted to IgnoredValue. The object has no data member and
59 // doesn't try to remember anything about the argument. We
60 // deliberately omit the 'explicit' keyword in order to allow the
61 // conversion to be implicit.
62 template <typename T>
63 IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
64};
65
66// MatcherTuple<T>::type is a tuple type where each field is a Matcher
67// for the corresponding field in tuple type T.
68template <typename Tuple>
70
71template <>
72struct MatcherTuple< ::testing::tuple<> > {
73 typedef ::testing::tuple< > type;
74};
75
76template <typename A1>
77struct MatcherTuple< ::testing::tuple<A1> > {
78 typedef ::testing::tuple<Matcher<A1> > type;
79};
80
81template <typename A1, typename A2>
82struct MatcherTuple< ::testing::tuple<A1, A2> > {
83 typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
84};
85
86template <typename A1, typename A2, typename A3>
87struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
88 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
89};
90
91template <typename A1, typename A2, typename A3, typename A4>
92struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
93 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
95};
96
97template <typename A1, typename A2, typename A3, typename A4, typename A5>
98struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
99 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
101};
102
103template <typename A1, typename A2, typename A3, typename A4, typename A5,
104 typename A6>
105struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
106 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
108};
109
110template <typename A1, typename A2, typename A3, typename A4, typename A5,
111 typename A6, typename A7>
112struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
113 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
115};
116
117template <typename A1, typename A2, typename A3, typename A4, typename A5,
118 typename A6, typename A7, typename A8>
119struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
120 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
122};
123
124template <typename A1, typename A2, typename A3, typename A4, typename A5,
125 typename A6, typename A7, typename A8, typename A9>
126struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
127 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
129};
130
131template <typename A1, typename A2, typename A3, typename A4, typename A5,
132 typename A6, typename A7, typename A8, typename A9, typename A10>
133struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
134 A10> > {
135 typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
138};
139
140// Template struct Function<F>, where F must be a function type, contains
141// the following typedefs:
142//
143// Result: the function's return type.
144// ArgumentN: the type of the N-th argument, where N starts with 1.
145// ArgumentTuple: the tuple type consisting of all parameters of F.
146// ArgumentMatcherTuple: the tuple type consisting of Matchers for all
147// parameters of F.
148// MakeResultVoid: the function type obtained by substituting void
149// for the return type of F.
150// MakeResultIgnoredValue:
151// the function type obtained by substituting Something
152// for the return type of F.
153template <typename F>
154struct Function;
155
156template <typename R>
157struct Function<R()> {
158 typedef R Result;
159 typedef ::testing::tuple<> ArgumentTuple;
161 typedef void MakeResultVoid();
163};
164
165template <typename R, typename A1>
166struct Function<R(A1)>
167 : Function<R()> {
168 typedef A1 Argument1;
169 typedef ::testing::tuple<A1> ArgumentTuple;
171 typedef void MakeResultVoid(A1);
173};
174
175template <typename R, typename A1, typename A2>
176struct Function<R(A1, A2)>
177 : Function<R(A1)> {
178 typedef A2 Argument2;
179 typedef ::testing::tuple<A1, A2> ArgumentTuple;
181 typedef void MakeResultVoid(A1, A2);
183};
184
185template <typename R, typename A1, typename A2, typename A3>
186struct Function<R(A1, A2, A3)>
187 : Function<R(A1, A2)> {
188 typedef A3 Argument3;
189 typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
191 typedef void MakeResultVoid(A1, A2, A3);
193};
194
195template <typename R, typename A1, typename A2, typename A3, typename A4>
196struct Function<R(A1, A2, A3, A4)>
197 : Function<R(A1, A2, A3)> {
198 typedef A4 Argument4;
199 typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
201 typedef void MakeResultVoid(A1, A2, A3, A4);
202 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
203};
204
205template <typename R, typename A1, typename A2, typename A3, typename A4,
206 typename A5>
207struct Function<R(A1, A2, A3, A4, A5)>
208 : Function<R(A1, A2, A3, A4)> {
209 typedef A5 Argument5;
210 typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
212 typedef void MakeResultVoid(A1, A2, A3, A4, A5);
213 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
214};
215
216template <typename R, typename A1, typename A2, typename A3, typename A4,
217 typename A5, typename A6>
218struct Function<R(A1, A2, A3, A4, A5, A6)>
219 : Function<R(A1, A2, A3, A4, A5)> {
220 typedef A6 Argument6;
221 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
223 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
224 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
225};
226
227template <typename R, typename A1, typename A2, typename A3, typename A4,
228 typename A5, typename A6, typename A7>
229struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
230 : Function<R(A1, A2, A3, A4, A5, A6)> {
231 typedef A7 Argument7;
232 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
234 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
235 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
236};
237
238template <typename R, typename A1, typename A2, typename A3, typename A4,
239 typename A5, typename A6, typename A7, typename A8>
240struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
241 : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
242 typedef A8 Argument8;
243 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
245 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
246 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
247};
248
249template <typename R, typename A1, typename A2, typename A3, typename A4,
250 typename A5, typename A6, typename A7, typename A8, typename A9>
251struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
252 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
253 typedef A9 Argument9;
254 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
256 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
257 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
258 A9);
259};
260
261template <typename R, typename A1, typename A2, typename A3, typename A4,
262 typename A5, typename A6, typename A7, typename A8, typename A9,
263 typename A10>
264struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
265 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
266 typedef A10 Argument10;
267 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
270 typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
271 typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
272 A9, A10);
273};
274
275} // namespace internal
276
277} // namespace testing
278
279#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
Definition gmock-matchers.h:319
Definition gmock-generated-internal-utils.h:55
IgnoredValue(const T &)
Definition gmock-generated-internal-utils.h:63
Definition gmock-actions.h:64
Definition gmock-actions.h:53
::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 > ArgumentTuple
Definition gmock-generated-internal-utils.h:268
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)
Definition gmock-generated-internal-utils.h:271
A10 Argument10
Definition gmock-generated-internal-utils.h:266
void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)
Definition gmock-generated-internal-utils.h:270
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:269
::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8, A9 > ArgumentTuple
Definition gmock-generated-internal-utils.h:254
void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9)
Definition gmock-generated-internal-utils.h:256
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, A9)
Definition gmock-generated-internal-utils.h:257
A9 Argument9
Definition gmock-generated-internal-utils.h:253
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:255
A8 Argument8
Definition gmock-generated-internal-utils.h:242
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:244
void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8)
Definition gmock-generated-internal-utils.h:245
::testing::tuple< A1, A2, A3, A4, A5, A6, A7, A8 > ArgumentTuple
Definition gmock-generated-internal-utils.h:243
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8)
Definition gmock-generated-internal-utils.h:246
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7)
Definition gmock-generated-internal-utils.h:235
A7 Argument7
Definition gmock-generated-internal-utils.h:231
::testing::tuple< A1, A2, A3, A4, A5, A6, A7 > ArgumentTuple
Definition gmock-generated-internal-utils.h:232
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:233
void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7)
Definition gmock-generated-internal-utils.h:234
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6)
Definition gmock-generated-internal-utils.h:224
::testing::tuple< A1, A2, A3, A4, A5, A6 > ArgumentTuple
Definition gmock-generated-internal-utils.h:221
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:222
void MakeResultVoid(A1, A2, A3, A4, A5, A6)
Definition gmock-generated-internal-utils.h:223
A6 Argument6
Definition gmock-generated-internal-utils.h:220
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:211
void MakeResultVoid(A1, A2, A3, A4, A5)
Definition gmock-generated-internal-utils.h:212
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5)
Definition gmock-generated-internal-utils.h:213
A5 Argument5
Definition gmock-generated-internal-utils.h:209
::testing::tuple< A1, A2, A3, A4, A5 > ArgumentTuple
Definition gmock-generated-internal-utils.h:210
IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4)
Definition gmock-generated-internal-utils.h:202
::testing::tuple< A1, A2, A3, A4 > ArgumentTuple
Definition gmock-generated-internal-utils.h:199
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:200
A4 Argument4
Definition gmock-generated-internal-utils.h:198
void MakeResultVoid(A1, A2, A3, A4)
Definition gmock-generated-internal-utils.h:201
A3 Argument3
Definition gmock-generated-internal-utils.h:188
void MakeResultVoid(A1, A2, A3)
Definition gmock-generated-internal-utils.h:191
::testing::tuple< A1, A2, A3 > ArgumentTuple
Definition gmock-generated-internal-utils.h:189
IgnoredValue MakeResultIgnoredValue(A1, A2, A3)
Definition gmock-generated-internal-utils.h:192
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:190
A2 Argument2
Definition gmock-generated-internal-utils.h:178
::testing::tuple< A1, A2 > ArgumentTuple
Definition gmock-generated-internal-utils.h:179
IgnoredValue MakeResultIgnoredValue(A1, A2)
Definition gmock-generated-internal-utils.h:182
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:180
void MakeResultVoid(A1, A2)
Definition gmock-generated-internal-utils.h:181
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:170
IgnoredValue MakeResultIgnoredValue(A1)
Definition gmock-generated-internal-utils.h:172
void MakeResultVoid(A1)
Definition gmock-generated-internal-utils.h:171
A1 Argument1
Definition gmock-generated-internal-utils.h:168
::testing::tuple< A1 > ArgumentTuple
Definition gmock-generated-internal-utils.h:169
R Result
Definition gmock-generated-internal-utils.h:158
void MakeResultVoid()
Definition gmock-generated-internal-utils.h:161
MatcherTuple< ArgumentTuple >::type ArgumentMatcherTuple
Definition gmock-generated-internal-utils.h:160
IgnoredValue MakeResultIgnoredValue()
Definition gmock-generated-internal-utils.h:162
::testing::tuple ArgumentTuple
Definition gmock-generated-internal-utils.h:159
Definition gmock-generated-internal-utils.h:154
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 >, Matcher< A6 > > type
Definition gmock-generated-internal-utils.h:107
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 > > type
Definition gmock-generated-internal-utils.h:100
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 > > type
Definition gmock-generated-internal-utils.h:94
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 >, Matcher< A6 >, Matcher< A7 > > type
Definition gmock-generated-internal-utils.h:114
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 >, Matcher< A6 >, Matcher< A7 >, Matcher< A8 >, Matcher< A9 >, Matcher< A10 > > type
Definition gmock-generated-internal-utils.h:137
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 >, Matcher< A6 >, Matcher< A7 >, Matcher< A8 >, Matcher< A9 > > type
Definition gmock-generated-internal-utils.h:128
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 >, Matcher< A4 >, Matcher< A5 >, Matcher< A6 >, Matcher< A7 >, Matcher< A8 > > type
Definition gmock-generated-internal-utils.h:121
::testing::tuple< Matcher< A1 >, Matcher< A2 >, Matcher< A3 > > type
Definition gmock-generated-internal-utils.h:88
::testing::tuple< Matcher< A1 >, Matcher< A2 > > type
Definition gmock-generated-internal-utils.h:83
::testing::tuple< Matcher< A1 > > type
Definition gmock-generated-internal-utils.h:78
::testing::tuple< > type
Definition gmock-generated-internal-utils.h:73
Definition gmock-generated-internal-utils.h:69
#define T(x)