1 // This file was GENERATED by command:
2 // pump.py gmock-generated-actions.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
35 // Google Mock - a framework for writing C++ mock classes.
36 //
37 // This file implements some commonly used variadic actions.
38
39 // GOOGLETEST_CM0002 DO NOT DELETE
40
41 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
42 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
43
44 #include <memory>
45 #include <utility>
46
47 #include "gmock/gmock-actions.h"
48 #include "gmock/internal/gmock-port.h"
49
50 // The ACTION* family of macros can be used in a namespace scope to
51 // define custom actions easily. The syntax:
52 //
53 // ACTION(name) { statements; }
54 //
55 // will define an action with the given name that executes the
56 // statements. The value returned by the statements will be used as
57 // the return value of the action. Inside the statements, you can
58 // refer to the K-th (0-based) argument of the mock function by
59 // 'argK', and refer to its type by 'argK_type'. For example:
60 //
61 // ACTION(IncrementArg1) {
62 // arg1_type temp = arg1;
63 // return ++(*temp);
64 // }
65 //
66 // allows you to write
67 //
68 // ...WillOnce(IncrementArg1());
69 //
70 // You can also refer to the entire argument tuple and its type by
71 // 'args' and 'args_type', and refer to the mock function type and its
72 // return type by 'function_type' and 'return_type'.
73 //
74 // Note that you don't need to specify the types of the mock function
75 // arguments. However rest assured that your code is still type-safe:
76 // you'll get a compiler error if *arg1 doesn't support the ++
77 // operator, or if the type of ++(*arg1) isn't compatible with the
78 // mock function's return type, for example.
79 //
80 // Sometimes you'll want to parameterize the action. For that you can use
81 // another macro:
82 //
83 // ACTION_P(name, param_name) { statements; }
84 //
85 // For example:
86 //
87 // ACTION_P(Add, n) { return arg0 + n; }
88 //
89 // will allow you to write:
90 //
91 // ...WillOnce(Add(5));
92 //
93 // Note that you don't need to provide the type of the parameter
94 // either. If you need to reference the type of a parameter named
95 // 'foo', you can write 'foo_type'. For example, in the body of
96 // ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
97 // of 'n'.
98 //
99 // We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
100 // multi-parameter actions.
101 //
102 // For the purpose of typing, you can view
103 //
104 // ACTION_Pk(Foo, p1, ..., pk) { ... }
105 //
106 // as shorthand for
107 //
108 // template <typename p1_type, ..., typename pk_type>
109 // FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
110 //
111 // In particular, you can provide the template type arguments
112 // explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
113 // although usually you can rely on the compiler to infer the types
114 // for you automatically. You can assign the result of expression
115 // Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
116 // pk_type>. This can be useful when composing actions.
117 //
118 // You can also overload actions with different numbers of parameters:
119 //
120 // ACTION_P(Plus, a) { ... }
121 // ACTION_P2(Plus, a, b) { ... }
122 //
123 // While it's tempting to always use the ACTION* macros when defining
124 // a new action, you should also consider implementing ActionInterface
125 // or using MakePolymorphicAction() instead, especially if you need to
126 // use the action a lot. While these approaches require more work,
127 // they give you more control on the types of the mock function
128 // arguments and the action parameters, which in general leads to
129 // better compiler error messages that pay off in the long run. They
130 // also allow overloading actions based on parameter types (as opposed
131 // to just based on the number of parameters).
132 //
133 // CAVEAT:
134 //
135 // ACTION*() can only be used in a namespace scope as templates cannot be
136 // declared inside of a local class.
137 // Users can, however, define any local functors (e.g. a lambda) that
138 // can be used as actions.
139 //
140 // MORE INFORMATION:
141 //
142 // To learn more about using these macros, please search for 'ACTION' on
143 // https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md
144
145 // An internal macro needed for implementing ACTION*().
146 #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
147 const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
148 const arg0_type& arg0 GTEST_ATTRIBUTE_UNUSED_, \
149 const arg1_type& arg1 GTEST_ATTRIBUTE_UNUSED_, \
150 const arg2_type& arg2 GTEST_ATTRIBUTE_UNUSED_, \
151 const arg3_type& arg3 GTEST_ATTRIBUTE_UNUSED_, \
152 const arg4_type& arg4 GTEST_ATTRIBUTE_UNUSED_, \
153 const arg5_type& arg5 GTEST_ATTRIBUTE_UNUSED_, \
154 const arg6_type& arg6 GTEST_ATTRIBUTE_UNUSED_, \
155 const arg7_type& arg7 GTEST_ATTRIBUTE_UNUSED_, \
156 const arg8_type& arg8 GTEST_ATTRIBUTE_UNUSED_, \
157 const arg9_type& arg9 GTEST_ATTRIBUTE_UNUSED_
158
159 // Sometimes you want to give an action explicit template parameters
160 // that cannot be inferred from its value parameters. ACTION() and
161 // ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
162 // and can be viewed as an extension to ACTION() and ACTION_P*().
163 //
164 // The syntax:
165 //
166 // ACTION_TEMPLATE(ActionName,
167 // HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
168 // AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
169 //
170 // defines an action template that takes m explicit template
171 // parameters and n value parameters. name_i is the name of the i-th
172 // template parameter, and kind_i specifies whether it's a typename,
173 // an integral constant, or a template. p_i is the name of the i-th
174 // value parameter.
175 //
176 // Example:
177 //
178 // // DuplicateArg<k, T>(output) converts the k-th argument of the mock
179 // // function to type T and copies it to *output.
180 // ACTION_TEMPLATE(DuplicateArg,
181 // HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
182 // AND_1_VALUE_PARAMS(output)) {
183 // *output = T(::std::get<k>(args));
184 // }
185 // ...
186 // int n;
187 // EXPECT_CALL(mock, Foo(_, _))
188 // .WillOnce(DuplicateArg<1, unsigned char>(&n));
189 //
190 // To create an instance of an action template, write:
191 //
192 // ActionName<t1, ..., t_m>(v1, ..., v_n)
193 //
194 // where the ts are the template arguments and the vs are the value
195 // arguments. The value argument types are inferred by the compiler.
196 // If you want to explicitly specify the value argument types, you can
197 // provide additional template arguments:
198 //
199 // ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
200 //
201 // where u_i is the desired type of v_i.
202 //
203 // ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
204 // number of value parameters, but not on the number of template
205 // parameters. Without the restriction, the meaning of the following
206 // is unclear:
207 //
208 // OverloadedAction<int, bool>(x);
209 //
210 // Are we using a single-template-parameter action where 'bool' refers
211 // to the type of x, or are we using a two-template-parameter action
212 // where the compiler is asked to infer the type of x?
213 //
214 // Implementation notes:
215 //
216 // GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
217 // GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
218 // implementing ACTION_TEMPLATE. The main trick we use is to create
219 // new macro invocations when expanding a macro. For example, we have
220 //
221 // #define ACTION_TEMPLATE(name, template_params, value_params)
222 // ... GMOCK_INTERNAL_DECL_##template_params ...
223 //
224 // which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
225 // to expand to
226 //
227 // ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
228 //
229 // Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
230 // preprocessor will continue to expand it to
231 //
232 // ... typename T ...
233 //
234 // This technique conforms to the C++ standard and is portable. It
235 // allows us to implement action templates using O(N) code, where N is
236 // the maximum number of template/value parameters supported. Without
237 // using it, we'd have to devote O(N^2) amount of code to implement all
238 // combinations of m and n.
239
240 // Declares the template parameters.
241 #define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
242 #define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
243 name1) kind0 name0, kind1 name1
244 #define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
245 kind2, name2) kind0 name0, kind1 name1, kind2 name2
246 #define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
247 kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
248 kind3 name3
249 #define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
250 kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
251 kind2 name2, kind3 name3, kind4 name4
252 #define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
253 kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
254 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
255 #define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
256 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
257 name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
258 kind5 name5, kind6 name6
259 #define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
260 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
261 kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
262 kind4 name4, kind5 name5, kind6 name6, kind7 name7
263 #define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
264 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
265 kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
266 kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
267 kind8 name8
268 #define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
269 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
270 name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
271 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
272 kind6 name6, kind7 name7, kind8 name8, kind9 name9
273
274 // Lists the template parameters.
275 #define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
276 #define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
277 name1) name0, name1
278 #define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
279 kind2, name2) name0, name1, name2
280 #define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
281 kind2, name2, kind3, name3) name0, name1, name2, name3
282 #define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
283 kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
284 name4
285 #define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
286 kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
287 name2, name3, name4, name5
288 #define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
289 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
290 name6) name0, name1, name2, name3, name4, name5, name6
291 #define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
292 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
293 kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
294 #define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
295 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
296 kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
297 name6, name7, name8
298 #define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
299 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
300 name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
301 name3, name4, name5, name6, name7, name8, name9
302
303 // Declares the types of value parameters.
304 #define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
305 #define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
306 #define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
307 typename p0##_type, typename p1##_type
308 #define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
309 typename p0##_type, typename p1##_type, typename p2##_type
310 #define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
311 typename p0##_type, typename p1##_type, typename p2##_type, \
312 typename p3##_type
313 #define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
314 typename p0##_type, typename p1##_type, typename p2##_type, \
315 typename p3##_type, typename p4##_type
316 #define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
317 typename p0##_type, typename p1##_type, typename p2##_type, \
318 typename p3##_type, typename p4##_type, typename p5##_type
319 #define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
320 p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
321 typename p3##_type, typename p4##_type, typename p5##_type, \
322 typename p6##_type
323 #define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
324 p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
325 typename p3##_type, typename p4##_type, typename p5##_type, \
326 typename p6##_type, typename p7##_type
327 #define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
328 p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
329 typename p3##_type, typename p4##_type, typename p5##_type, \
330 typename p6##_type, typename p7##_type, typename p8##_type
331 #define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
332 p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
333 typename p2##_type, typename p3##_type, typename p4##_type, \
334 typename p5##_type, typename p6##_type, typename p7##_type, \
335 typename p8##_type, typename p9##_type
336
337 // Initializes the value parameters.
338 #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
339 ()
340 #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
341 (p0##_type gmock_p0) : p0(::std::move(gmock_p0))
342 #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
343 (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
344 p1(::std::move(gmock_p1))
345 #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
346 (p0##_type gmock_p0, p1##_type gmock_p1, \
347 p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
348 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2))
349 #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
350 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
351 p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
352 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
353 p3(::std::move(gmock_p3))
354 #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
355 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
356 p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
357 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
358 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4))
359 #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
360 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
361 p3##_type gmock_p3, p4##_type gmock_p4, \
362 p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
363 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
364 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
365 p5(::std::move(gmock_p5))
366 #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
367 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
368 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
369 p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
370 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
371 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
372 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6))
373 #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
374 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
375 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
376 p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
377 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
378 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
379 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
380 p7(::std::move(gmock_p7))
381 #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
382 p7, p8)\
383 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
384 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
385 p6##_type gmock_p6, p7##_type gmock_p7, \
386 p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
387 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
388 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
389 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
390 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8))
391 #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
392 p7, p8, p9)\
393 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
394 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
395 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
396 p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
397 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
398 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
399 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
400 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
401 p9(::std::move(gmock_p9))
402
403 // Declares the fields for storing the value parameters.
404 #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
405 #define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
406 #define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
407 p1##_type p1;
408 #define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
409 p1##_type p1; p2##_type p2;
410 #define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
411 p1##_type p1; p2##_type p2; p3##_type p3;
412 #define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
413 p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
414 #define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
415 p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
416 p5##_type p5;
417 #define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
418 p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
419 p5##_type p5; p6##_type p6;
420 #define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
421 p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
422 p5##_type p5; p6##_type p6; p7##_type p7;
423 #define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
424 p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
425 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
426 #define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
427 p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
428 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
429 p9##_type p9;
430
431 // Lists the value parameters.
432 #define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
433 #define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
434 #define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
435 #define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
436 #define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
437 #define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
438 p2, p3, p4
439 #define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
440 p1, p2, p3, p4, p5
441 #define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
442 p6) p0, p1, p2, p3, p4, p5, p6
443 #define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
444 p7) p0, p1, p2, p3, p4, p5, p6, p7
445 #define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
446 p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
447 #define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
448 p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
449
450 // Lists the value parameter types.
451 #define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
452 #define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
453 #define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
454 p1##_type
455 #define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
456 p1##_type, p2##_type
457 #define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
458 p0##_type, p1##_type, p2##_type, p3##_type
459 #define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
460 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
461 #define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
462 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
463 #define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
464 p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
465 p6##_type
466 #define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
467 p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
468 p5##_type, p6##_type, p7##_type
469 #define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
470 p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
471 p5##_type, p6##_type, p7##_type, p8##_type
472 #define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
473 p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
474 p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
475
476 // Declares the value parameters.
477 #define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
478 #define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
479 #define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
480 p1##_type p1
481 #define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
482 p1##_type p1, p2##_type p2
483 #define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
484 p1##_type p1, p2##_type p2, p3##_type p3
485 #define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
486 p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
487 #define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
488 p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
489 p5##_type p5
490 #define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
491 p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
492 p5##_type p5, p6##_type p6
493 #define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
494 p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
495 p5##_type p5, p6##_type p6, p7##_type p7
496 #define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
497 p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
498 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
499 #define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
500 p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
501 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
502 p9##_type p9
503
504 // The suffix of the class template implementing the action template.
505 #define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
506 #define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
507 #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
508 #define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
509 #define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
510 #define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
511 #define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
512 #define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
513 #define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
514 p7) P8
515 #define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
516 p7, p8) P9
517 #define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
518 p7, p8, p9) P10
519
520 // The name of the class template implementing the action template.
521 #define GMOCK_ACTION_CLASS_(name, value_params)\
522 GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
523
524 #define ACTION_TEMPLATE(name, template_params, value_params)\
525 template <GMOCK_INTERNAL_DECL_##template_params\
526 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
527 class GMOCK_ACTION_CLASS_(name, value_params) {\
528 public:\
529 explicit GMOCK_ACTION_CLASS_(name, value_params)\
530 GMOCK_INTERNAL_INIT_##value_params {}\
531 template <typename F>\
532 class gmock_Impl : public ::testing::ActionInterface<F> {\
533 public:\
534 typedef F function_type;\
535 typedef typename ::testing::internal::Function<F>::Result return_type;\
536 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
537 args_type;\
538 explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
539 return_type Perform(const args_type& args) override {\
540 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
541 Perform(this, args);\
542 }\
543 template <typename arg0_type, typename arg1_type, typename arg2_type, \
544 typename arg3_type, typename arg4_type, typename arg5_type, \
545 typename arg6_type, typename arg7_type, typename arg8_type, \
546 typename arg9_type>\
547 return_type gmock_PerformImpl(const args_type& args, \
548 const arg0_type& arg0, const arg1_type& arg1, \
549 const arg2_type& arg2, const arg3_type& arg3, \
550 const arg4_type& arg4, const arg5_type& arg5, \
551 const arg6_type& arg6, const arg7_type& arg7, \
552 const arg8_type& arg8, const arg9_type& arg9) const;\
553 GMOCK_INTERNAL_DEFN_##value_params\
554 private:\
555 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
556 };\
557 template <typename F> operator ::testing::Action<F>() const {\
558 return ::testing::Action<F>(\
559 new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
560 }\
561 GMOCK_INTERNAL_DEFN_##value_params\
562 private:\
563 GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
564 };\
565 template <GMOCK_INTERNAL_DECL_##template_params\
566 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
567 inline GMOCK_ACTION_CLASS_(name, value_params)<\
568 GMOCK_INTERNAL_LIST_##template_params\
569 GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
570 GMOCK_INTERNAL_DECL_##value_params) {\
571 return GMOCK_ACTION_CLASS_(name, value_params)<\
572 GMOCK_INTERNAL_LIST_##template_params\
573 GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
574 GMOCK_INTERNAL_LIST_##value_params);\
575 }\
576 template <GMOCK_INTERNAL_DECL_##template_params\
577 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
578 template <typename F>\
579 template <typename arg0_type, typename arg1_type, typename arg2_type, \
580 typename arg3_type, typename arg4_type, typename arg5_type, \
581 typename arg6_type, typename arg7_type, typename arg8_type, \
582 typename arg9_type>\
583 typename ::testing::internal::Function<F>::Result\
584 GMOCK_ACTION_CLASS_(name, value_params)<\
585 GMOCK_INTERNAL_LIST_##template_params\
586 GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
587 gmock_PerformImpl(\
588 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
589
590 #define ACTION(name)\
591 class name##Action {\
592 public:\
593 name##Action() {}\
594 template <typename F>\
595 class gmock_Impl : public ::testing::ActionInterface<F> {\
596 public:\
597 typedef F function_type;\
598 typedef typename ::testing::internal::Function<F>::Result return_type;\
599 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
600 args_type;\
601 gmock_Impl() {}\
602 return_type Perform(const args_type& args) override {\
603 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
604 Perform(this, args);\
605 }\
606 template <typename arg0_type, typename arg1_type, typename arg2_type, \
607 typename arg3_type, typename arg4_type, typename arg5_type, \
608 typename arg6_type, typename arg7_type, typename arg8_type, \
609 typename arg9_type>\
610 return_type gmock_PerformImpl(const args_type& args, \
611 const arg0_type& arg0, const arg1_type& arg1, \
612 const arg2_type& arg2, const arg3_type& arg3, \
613 const arg4_type& arg4, const arg5_type& arg5, \
614 const arg6_type& arg6, const arg7_type& arg7, \
615 const arg8_type& arg8, const arg9_type& arg9) const;\
616 private:\
617 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
618 };\
619 template <typename F> operator ::testing::Action<F>() const {\
620 return ::testing::Action<F>(new gmock_Impl<F>());\
621 }\
622 private:\
623 GTEST_DISALLOW_ASSIGN_(name##Action);\
624 };\
625 inline name##Action name() {\
626 return name##Action();\
627 }\
628 template <typename F>\
629 template <typename arg0_type, typename arg1_type, typename arg2_type, \
630 typename arg3_type, typename arg4_type, typename arg5_type, \
631 typename arg6_type, typename arg7_type, typename arg8_type, \
632 typename arg9_type>\
633 typename ::testing::internal::Function<F>::Result\
634 name##Action::gmock_Impl<F>::gmock_PerformImpl(\
635 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
636
637 #define ACTION_P(name, p0)\
638 template <typename p0##_type>\
639 class name##ActionP {\
640 public:\
641 explicit name##ActionP(p0##_type gmock_p0) : \
642 p0(::std::forward<p0##_type>(gmock_p0)) {}\
643 template <typename F>\
644 class gmock_Impl : public ::testing::ActionInterface<F> {\
645 public:\
646 typedef F function_type;\
647 typedef typename ::testing::internal::Function<F>::Result return_type;\
648 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
649 args_type;\
650 explicit gmock_Impl(p0##_type gmock_p0) : \
651 p0(::std::forward<p0##_type>(gmock_p0)) {}\
652 return_type Perform(const args_type& args) override {\
653 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
654 Perform(this, args);\
655 }\
656 template <typename arg0_type, typename arg1_type, typename arg2_type, \
657 typename arg3_type, typename arg4_type, typename arg5_type, \
658 typename arg6_type, typename arg7_type, typename arg8_type, \
659 typename arg9_type>\
660 return_type gmock_PerformImpl(const args_type& args, \
661 const arg0_type& arg0, const arg1_type& arg1, \
662 const arg2_type& arg2, const arg3_type& arg3, \
663 const arg4_type& arg4, const arg5_type& arg5, \
664 const arg6_type& arg6, const arg7_type& arg7, \
665 const arg8_type& arg8, const arg9_type& arg9) const;\
666 p0##_type p0;\
667 private:\
668 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
669 };\
670 template <typename F> operator ::testing::Action<F>() const {\
671 return ::testing::Action<F>(new gmock_Impl<F>(p0));\
672 }\
673 p0##_type p0;\
674 private:\
675 GTEST_DISALLOW_ASSIGN_(name##ActionP);\
676 };\
677 template <typename p0##_type>\
678 inline name##ActionP<p0##_type> name(p0##_type p0) {\
679 return name##ActionP<p0##_type>(p0);\
680 }\
681 template <typename p0##_type>\
682 template <typename F>\
683 template <typename arg0_type, typename arg1_type, typename arg2_type, \
684 typename arg3_type, typename arg4_type, typename arg5_type, \
685 typename arg6_type, typename arg7_type, typename arg8_type, \
686 typename arg9_type>\
687 typename ::testing::internal::Function<F>::Result\
688 name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
689 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
690
691 #define ACTION_P2(name, p0, p1)\
692 template <typename p0##_type, typename p1##_type>\
693 class name##ActionP2 {\
694 public:\
695 name##ActionP2(p0##_type gmock_p0, \
696 p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
697 p1(::std::forward<p1##_type>(gmock_p1)) {}\
698 template <typename F>\
699 class gmock_Impl : public ::testing::ActionInterface<F> {\
700 public:\
701 typedef F function_type;\
702 typedef typename ::testing::internal::Function<F>::Result return_type;\
703 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
704 args_type;\
705 gmock_Impl(p0##_type gmock_p0, \
706 p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
707 p1(::std::forward<p1##_type>(gmock_p1)) {}\
708 return_type Perform(const args_type& args) override {\
709 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
710 Perform(this, args);\
711 }\
712 template <typename arg0_type, typename arg1_type, typename arg2_type, \
713 typename arg3_type, typename arg4_type, typename arg5_type, \
714 typename arg6_type, typename arg7_type, typename arg8_type, \
715 typename arg9_type>\
716 return_type gmock_PerformImpl(const args_type& args, \
717 const arg0_type& arg0, const arg1_type& arg1, \
718 const arg2_type& arg2, const arg3_type& arg3, \
719 const arg4_type& arg4, const arg5_type& arg5, \
720 const arg6_type& arg6, const arg7_type& arg7, \
721 const arg8_type& arg8, const arg9_type& arg9) const;\
722 p0##_type p0;\
723 p1##_type p1;\
724 private:\
725 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
726 };\
727 template <typename F> operator ::testing::Action<F>() const {\
728 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
729 }\
730 p0##_type p0;\
731 p1##_type p1;\
732 private:\
733 GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
734 };\
735 template <typename p0##_type, typename p1##_type>\
736 inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
737 p1##_type p1) {\
738 return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
739 }\
740 template <typename p0##_type, typename p1##_type>\
741 template <typename F>\
742 template <typename arg0_type, typename arg1_type, typename arg2_type, \
743 typename arg3_type, typename arg4_type, typename arg5_type, \
744 typename arg6_type, typename arg7_type, typename arg8_type, \
745 typename arg9_type>\
746 typename ::testing::internal::Function<F>::Result\
747 name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
748 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
749
750 #define ACTION_P3(name, p0, p1, p2)\
751 template <typename p0##_type, typename p1##_type, typename p2##_type>\
752 class name##ActionP3 {\
753 public:\
754 name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
755 p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
756 p1(::std::forward<p1##_type>(gmock_p1)), \
757 p2(::std::forward<p2##_type>(gmock_p2)) {}\
758 template <typename F>\
759 class gmock_Impl : public ::testing::ActionInterface<F> {\
760 public:\
761 typedef F function_type;\
762 typedef typename ::testing::internal::Function<F>::Result return_type;\
763 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
764 args_type;\
765 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
766 p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
767 p1(::std::forward<p1##_type>(gmock_p1)), \
768 p2(::std::forward<p2##_type>(gmock_p2)) {}\
769 return_type Perform(const args_type& args) override {\
770 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
771 Perform(this, args);\
772 }\
773 template <typename arg0_type, typename arg1_type, typename arg2_type, \
774 typename arg3_type, typename arg4_type, typename arg5_type, \
775 typename arg6_type, typename arg7_type, typename arg8_type, \
776 typename arg9_type>\
777 return_type gmock_PerformImpl(const args_type& args, \
778 const arg0_type& arg0, const arg1_type& arg1, \
779 const arg2_type& arg2, const arg3_type& arg3, \
780 const arg4_type& arg4, const arg5_type& arg5, \
781 const arg6_type& arg6, const arg7_type& arg7, \
782 const arg8_type& arg8, const arg9_type& arg9) const;\
783 p0##_type p0;\
784 p1##_type p1;\
785 p2##_type p2;\
786 private:\
787 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
788 };\
789 template <typename F> operator ::testing::Action<F>() const {\
790 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
791 }\
792 p0##_type p0;\
793 p1##_type p1;\
794 p2##_type p2;\
795 private:\
796 GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
797 };\
798 template <typename p0##_type, typename p1##_type, typename p2##_type>\
799 inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
800 p1##_type p1, p2##_type p2) {\
801 return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
802 }\
803 template <typename p0##_type, typename p1##_type, typename p2##_type>\
804 template <typename F>\
805 template <typename arg0_type, typename arg1_type, typename arg2_type, \
806 typename arg3_type, typename arg4_type, typename arg5_type, \
807 typename arg6_type, typename arg7_type, typename arg8_type, \
808 typename arg9_type>\
809 typename ::testing::internal::Function<F>::Result\
810 name##ActionP3<p0##_type, p1##_type, \
811 p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
812 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
813
814 #define ACTION_P4(name, p0, p1, p2, p3)\
815 template <typename p0##_type, typename p1##_type, typename p2##_type, \
816 typename p3##_type>\
817 class name##ActionP4 {\
818 public:\
819 name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
820 p2##_type gmock_p2, \
821 p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
822 p1(::std::forward<p1##_type>(gmock_p1)), \
823 p2(::std::forward<p2##_type>(gmock_p2)), \
824 p3(::std::forward<p3##_type>(gmock_p3)) {}\
825 template <typename F>\
826 class gmock_Impl : public ::testing::ActionInterface<F> {\
827 public:\
828 typedef F function_type;\
829 typedef typename ::testing::internal::Function<F>::Result return_type;\
830 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
831 args_type;\
832 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
833 p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
834 p1(::std::forward<p1##_type>(gmock_p1)), \
835 p2(::std::forward<p2##_type>(gmock_p2)), \
836 p3(::std::forward<p3##_type>(gmock_p3)) {}\
837 return_type Perform(const args_type& args) override {\
838 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
839 Perform(this, args);\
840 }\
841 template <typename arg0_type, typename arg1_type, typename arg2_type, \
842 typename arg3_type, typename arg4_type, typename arg5_type, \
843 typename arg6_type, typename arg7_type, typename arg8_type, \
844 typename arg9_type>\
845 return_type gmock_PerformImpl(const args_type& args, \
846 const arg0_type& arg0, const arg1_type& arg1, \
847 const arg2_type& arg2, const arg3_type& arg3, \
848 const arg4_type& arg4, const arg5_type& arg5, \
849 const arg6_type& arg6, const arg7_type& arg7, \
850 const arg8_type& arg8, const arg9_type& arg9) const;\
851 p0##_type p0;\
852 p1##_type p1;\
853 p2##_type p2;\
854 p3##_type p3;\
855 private:\
856 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
857 };\
858 template <typename F> operator ::testing::Action<F>() const {\
859 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
860 }\
861 p0##_type p0;\
862 p1##_type p1;\
863 p2##_type p2;\
864 p3##_type p3;\
865 private:\
866 GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
867 };\
868 template <typename p0##_type, typename p1##_type, typename p2##_type, \
869 typename p3##_type>\
870 inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
871 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
872 p3##_type p3) {\
873 return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
874 p2, p3);\
875 }\
876 template <typename p0##_type, typename p1##_type, typename p2##_type, \
877 typename p3##_type>\
878 template <typename F>\
879 template <typename arg0_type, typename arg1_type, typename arg2_type, \
880 typename arg3_type, typename arg4_type, typename arg5_type, \
881 typename arg6_type, typename arg7_type, typename arg8_type, \
882 typename arg9_type>\
883 typename ::testing::internal::Function<F>::Result\
884 name##ActionP4<p0##_type, p1##_type, p2##_type, \
885 p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
886 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
887
888 #define ACTION_P5(name, p0, p1, p2, p3, p4)\
889 template <typename p0##_type, typename p1##_type, typename p2##_type, \
890 typename p3##_type, typename p4##_type>\
891 class name##ActionP5 {\
892 public:\
893 name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
894 p2##_type gmock_p2, p3##_type gmock_p3, \
895 p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
896 p1(::std::forward<p1##_type>(gmock_p1)), \
897 p2(::std::forward<p2##_type>(gmock_p2)), \
898 p3(::std::forward<p3##_type>(gmock_p3)), \
899 p4(::std::forward<p4##_type>(gmock_p4)) {}\
900 template <typename F>\
901 class gmock_Impl : public ::testing::ActionInterface<F> {\
902 public:\
903 typedef F function_type;\
904 typedef typename ::testing::internal::Function<F>::Result return_type;\
905 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
906 args_type;\
907 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
908 p3##_type gmock_p3, \
909 p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
910 p1(::std::forward<p1##_type>(gmock_p1)), \
911 p2(::std::forward<p2##_type>(gmock_p2)), \
912 p3(::std::forward<p3##_type>(gmock_p3)), \
913 p4(::std::forward<p4##_type>(gmock_p4)) {}\
914 return_type Perform(const args_type& args) override {\
915 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
916 Perform(this, args);\
917 }\
918 template <typename arg0_type, typename arg1_type, typename arg2_type, \
919 typename arg3_type, typename arg4_type, typename arg5_type, \
920 typename arg6_type, typename arg7_type, typename arg8_type, \
921 typename arg9_type>\
922 return_type gmock_PerformImpl(const args_type& args, \
923 const arg0_type& arg0, const arg1_type& arg1, \
924 const arg2_type& arg2, const arg3_type& arg3, \
925 const arg4_type& arg4, const arg5_type& arg5, \
926 const arg6_type& arg6, const arg7_type& arg7, \
927 const arg8_type& arg8, const arg9_type& arg9) const;\
928 p0##_type p0;\
929 p1##_type p1;\
930 p2##_type p2;\
931 p3##_type p3;\
932 p4##_type p4;\
933 private:\
934 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
935 };\
936 template <typename F> operator ::testing::Action<F>() const {\
937 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
938 }\
939 p0##_type p0;\
940 p1##_type p1;\
941 p2##_type p2;\
942 p3##_type p3;\
943 p4##_type p4;\
944 private:\
945 GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
946 };\
947 template <typename p0##_type, typename p1##_type, typename p2##_type, \
948 typename p3##_type, typename p4##_type>\
949 inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
950 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
951 p4##_type p4) {\
952 return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
953 p4##_type>(p0, p1, p2, p3, p4);\
954 }\
955 template <typename p0##_type, typename p1##_type, typename p2##_type, \
956 typename p3##_type, typename p4##_type>\
957 template <typename F>\
958 template <typename arg0_type, typename arg1_type, typename arg2_type, \
959 typename arg3_type, typename arg4_type, typename arg5_type, \
960 typename arg6_type, typename arg7_type, typename arg8_type, \
961 typename arg9_type>\
962 typename ::testing::internal::Function<F>::Result\
963 name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
964 p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
965 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
966
967 #define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
968 template <typename p0##_type, typename p1##_type, typename p2##_type, \
969 typename p3##_type, typename p4##_type, typename p5##_type>\
970 class name##ActionP6 {\
971 public:\
972 name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
973 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
974 p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
975 p1(::std::forward<p1##_type>(gmock_p1)), \
976 p2(::std::forward<p2##_type>(gmock_p2)), \
977 p3(::std::forward<p3##_type>(gmock_p3)), \
978 p4(::std::forward<p4##_type>(gmock_p4)), \
979 p5(::std::forward<p5##_type>(gmock_p5)) {}\
980 template <typename F>\
981 class gmock_Impl : public ::testing::ActionInterface<F> {\
982 public:\
983 typedef F function_type;\
984 typedef typename ::testing::internal::Function<F>::Result return_type;\
985 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
986 args_type;\
987 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
988 p3##_type gmock_p3, p4##_type gmock_p4, \
989 p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
990 p1(::std::forward<p1##_type>(gmock_p1)), \
991 p2(::std::forward<p2##_type>(gmock_p2)), \
992 p3(::std::forward<p3##_type>(gmock_p3)), \
993 p4(::std::forward<p4##_type>(gmock_p4)), \
994 p5(::std::forward<p5##_type>(gmock_p5)) {}\
995 return_type Perform(const args_type& args) override {\
996 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
997 Perform(this, args);\
998 }\
999 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1000 typename arg3_type, typename arg4_type, typename arg5_type, \
1001 typename arg6_type, typename arg7_type, typename arg8_type, \
1002 typename arg9_type>\
1003 return_type gmock_PerformImpl(const args_type& args, \
1004 const arg0_type& arg0, const arg1_type& arg1, \
1005 const arg2_type& arg2, const arg3_type& arg3, \
1006 const arg4_type& arg4, const arg5_type& arg5, \
1007 const arg6_type& arg6, const arg7_type& arg7, \
1008 const arg8_type& arg8, const arg9_type& arg9) const;\
1009 p0##_type p0;\
1010 p1##_type p1;\
1011 p2##_type p2;\
1012 p3##_type p3;\
1013 p4##_type p4;\
1014 p5##_type p5;\
1015 private:\
1016 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1017 };\
1018 template <typename F> operator ::testing::Action<F>() const {\
1019 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
1020 }\
1021 p0##_type p0;\
1022 p1##_type p1;\
1023 p2##_type p2;\
1024 p3##_type p3;\
1025 p4##_type p4;\
1026 p5##_type p5;\
1027 private:\
1028 GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
1029 };\
1030 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1031 typename p3##_type, typename p4##_type, typename p5##_type>\
1032 inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1033 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1034 p3##_type p3, p4##_type p4, p5##_type p5) {\
1035 return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1036 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1037 }\
1038 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1039 typename p3##_type, typename p4##_type, typename p5##_type>\
1040 template <typename F>\
1041 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1042 typename arg3_type, typename arg4_type, typename arg5_type, \
1043 typename arg6_type, typename arg7_type, typename arg8_type, \
1044 typename arg9_type>\
1045 typename ::testing::internal::Function<F>::Result\
1046 name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1047 p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1048 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1049
1050 #define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
1051 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1052 typename p3##_type, typename p4##_type, typename p5##_type, \
1053 typename p6##_type>\
1054 class name##ActionP7 {\
1055 public:\
1056 name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1057 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1058 p5##_type gmock_p5, \
1059 p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
1060 p1(::std::forward<p1##_type>(gmock_p1)), \
1061 p2(::std::forward<p2##_type>(gmock_p2)), \
1062 p3(::std::forward<p3##_type>(gmock_p3)), \
1063 p4(::std::forward<p4##_type>(gmock_p4)), \
1064 p5(::std::forward<p5##_type>(gmock_p5)), \
1065 p6(::std::forward<p6##_type>(gmock_p6)) {}\
1066 template <typename F>\
1067 class gmock_Impl : public ::testing::ActionInterface<F> {\
1068 public:\
1069 typedef F function_type;\
1070 typedef typename ::testing::internal::Function<F>::Result return_type;\
1071 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1072 args_type;\
1073 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1074 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1075 p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
1076 p1(::std::forward<p1##_type>(gmock_p1)), \
1077 p2(::std::forward<p2##_type>(gmock_p2)), \
1078 p3(::std::forward<p3##_type>(gmock_p3)), \
1079 p4(::std::forward<p4##_type>(gmock_p4)), \
1080 p5(::std::forward<p5##_type>(gmock_p5)), \
1081 p6(::std::forward<p6##_type>(gmock_p6)) {}\
1082 return_type Perform(const args_type& args) override {\
1083 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1084 Perform(this, args);\
1085 }\
1086 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1087 typename arg3_type, typename arg4_type, typename arg5_type, \
1088 typename arg6_type, typename arg7_type, typename arg8_type, \
1089 typename arg9_type>\
1090 return_type gmock_PerformImpl(const args_type& args, \
1091 const arg0_type& arg0, const arg1_type& arg1, \
1092 const arg2_type& arg2, const arg3_type& arg3, \
1093 const arg4_type& arg4, const arg5_type& arg5, \
1094 const arg6_type& arg6, const arg7_type& arg7, \
1095 const arg8_type& arg8, const arg9_type& arg9) const;\
1096 p0##_type p0;\
1097 p1##_type p1;\
1098 p2##_type p2;\
1099 p3##_type p3;\
1100 p4##_type p4;\
1101 p5##_type p5;\
1102 p6##_type p6;\
1103 private:\
1104 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1105 };\
1106 template <typename F> operator ::testing::Action<F>() const {\
1107 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1108 p6));\
1109 }\
1110 p0##_type p0;\
1111 p1##_type p1;\
1112 p2##_type p2;\
1113 p3##_type p3;\
1114 p4##_type p4;\
1115 p5##_type p5;\
1116 p6##_type p6;\
1117 private:\
1118 GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
1119 };\
1120 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1121 typename p3##_type, typename p4##_type, typename p5##_type, \
1122 typename p6##_type>\
1123 inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1124 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1125 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1126 p6##_type p6) {\
1127 return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1128 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1129 }\
1130 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1131 typename p3##_type, typename p4##_type, typename p5##_type, \
1132 typename p6##_type>\
1133 template <typename F>\
1134 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1135 typename arg3_type, typename arg4_type, typename arg5_type, \
1136 typename arg6_type, typename arg7_type, typename arg8_type, \
1137 typename arg9_type>\
1138 typename ::testing::internal::Function<F>::Result\
1139 name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1140 p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1141 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1142
1143 #define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
1144 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1145 typename p3##_type, typename p4##_type, typename p5##_type, \
1146 typename p6##_type, typename p7##_type>\
1147 class name##ActionP8 {\
1148 public:\
1149 name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1150 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1151 p5##_type gmock_p5, p6##_type gmock_p6, \
1152 p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
1153 p1(::std::forward<p1##_type>(gmock_p1)), \
1154 p2(::std::forward<p2##_type>(gmock_p2)), \
1155 p3(::std::forward<p3##_type>(gmock_p3)), \
1156 p4(::std::forward<p4##_type>(gmock_p4)), \
1157 p5(::std::forward<p5##_type>(gmock_p5)), \
1158 p6(::std::forward<p6##_type>(gmock_p6)), \
1159 p7(::std::forward<p7##_type>(gmock_p7)) {}\
1160 template <typename F>\
1161 class gmock_Impl : public ::testing::ActionInterface<F> {\
1162 public:\
1163 typedef F function_type;\
1164 typedef typename ::testing::internal::Function<F>::Result return_type;\
1165 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1166 args_type;\
1167 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1168 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1169 p6##_type gmock_p6, \
1170 p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
1171 p1(::std::forward<p1##_type>(gmock_p1)), \
1172 p2(::std::forward<p2##_type>(gmock_p2)), \
1173 p3(::std::forward<p3##_type>(gmock_p3)), \
1174 p4(::std::forward<p4##_type>(gmock_p4)), \
1175 p5(::std::forward<p5##_type>(gmock_p5)), \
1176 p6(::std::forward<p6##_type>(gmock_p6)), \
1177 p7(::std::forward<p7##_type>(gmock_p7)) {}\
1178 return_type Perform(const args_type& args) override {\
1179 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1180 Perform(this, args);\
1181 }\
1182 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1183 typename arg3_type, typename arg4_type, typename arg5_type, \
1184 typename arg6_type, typename arg7_type, typename arg8_type, \
1185 typename arg9_type>\
1186 return_type gmock_PerformImpl(const args_type& args, \
1187 const arg0_type& arg0, const arg1_type& arg1, \
1188 const arg2_type& arg2, const arg3_type& arg3, \
1189 const arg4_type& arg4, const arg5_type& arg5, \
1190 const arg6_type& arg6, const arg7_type& arg7, \
1191 const arg8_type& arg8, const arg9_type& arg9) const;\
1192 p0##_type p0;\
1193 p1##_type p1;\
1194 p2##_type p2;\
1195 p3##_type p3;\
1196 p4##_type p4;\
1197 p5##_type p5;\
1198 p6##_type p6;\
1199 p7##_type p7;\
1200 private:\
1201 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1202 };\
1203 template <typename F> operator ::testing::Action<F>() const {\
1204 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1205 p6, p7));\
1206 }\
1207 p0##_type p0;\
1208 p1##_type p1;\
1209 p2##_type p2;\
1210 p3##_type p3;\
1211 p4##_type p4;\
1212 p5##_type p5;\
1213 p6##_type p6;\
1214 p7##_type p7;\
1215 private:\
1216 GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
1217 };\
1218 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1219 typename p3##_type, typename p4##_type, typename p5##_type, \
1220 typename p6##_type, typename p7##_type>\
1221 inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1222 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
1223 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1224 p6##_type p6, p7##_type p7) {\
1225 return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1226 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
1227 p6, p7);\
1228 }\
1229 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1230 typename p3##_type, typename p4##_type, typename p5##_type, \
1231 typename p6##_type, typename p7##_type>\
1232 template <typename F>\
1233 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1234 typename arg3_type, typename arg4_type, typename arg5_type, \
1235 typename arg6_type, typename arg7_type, typename arg8_type, \
1236 typename arg9_type>\
1237 typename ::testing::internal::Function<F>::Result\
1238 name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1239 p5##_type, p6##_type, \
1240 p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1241 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1242
1243 #define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
1244 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1245 typename p3##_type, typename p4##_type, typename p5##_type, \
1246 typename p6##_type, typename p7##_type, typename p8##_type>\
1247 class name##ActionP9 {\
1248 public:\
1249 name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
1250 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1251 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
1252 p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
1253 p1(::std::forward<p1##_type>(gmock_p1)), \
1254 p2(::std::forward<p2##_type>(gmock_p2)), \
1255 p3(::std::forward<p3##_type>(gmock_p3)), \
1256 p4(::std::forward<p4##_type>(gmock_p4)), \
1257 p5(::std::forward<p5##_type>(gmock_p5)), \
1258 p6(::std::forward<p6##_type>(gmock_p6)), \
1259 p7(::std::forward<p7##_type>(gmock_p7)), \
1260 p8(::std::forward<p8##_type>(gmock_p8)) {}\
1261 template <typename F>\
1262 class gmock_Impl : public ::testing::ActionInterface<F> {\
1263 public:\
1264 typedef F function_type;\
1265 typedef typename ::testing::internal::Function<F>::Result return_type;\
1266 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1267 args_type;\
1268 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1269 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1270 p6##_type gmock_p6, p7##_type gmock_p7, \
1271 p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
1272 p1(::std::forward<p1##_type>(gmock_p1)), \
1273 p2(::std::forward<p2##_type>(gmock_p2)), \
1274 p3(::std::forward<p3##_type>(gmock_p3)), \
1275 p4(::std::forward<p4##_type>(gmock_p4)), \
1276 p5(::std::forward<p5##_type>(gmock_p5)), \
1277 p6(::std::forward<p6##_type>(gmock_p6)), \
1278 p7(::std::forward<p7##_type>(gmock_p7)), \
1279 p8(::std::forward<p8##_type>(gmock_p8)) {}\
1280 return_type Perform(const args_type& args) override {\
1281 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1282 Perform(this, args);\
1283 }\
1284 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1285 typename arg3_type, typename arg4_type, typename arg5_type, \
1286 typename arg6_type, typename arg7_type, typename arg8_type, \
1287 typename arg9_type>\
1288 return_type gmock_PerformImpl(const args_type& args, \
1289 const arg0_type& arg0, const arg1_type& arg1, \
1290 const arg2_type& arg2, const arg3_type& arg3, \
1291 const arg4_type& arg4, const arg5_type& arg5, \
1292 const arg6_type& arg6, const arg7_type& arg7, \
1293 const arg8_type& arg8, const arg9_type& arg9) const;\
1294 p0##_type p0;\
1295 p1##_type p1;\
1296 p2##_type p2;\
1297 p3##_type p3;\
1298 p4##_type p4;\
1299 p5##_type p5;\
1300 p6##_type p6;\
1301 p7##_type p7;\
1302 p8##_type p8;\
1303 private:\
1304 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1305 };\
1306 template <typename F> operator ::testing::Action<F>() const {\
1307 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1308 p6, p7, p8));\
1309 }\
1310 p0##_type p0;\
1311 p1##_type p1;\
1312 p2##_type p2;\
1313 p3##_type p3;\
1314 p4##_type p4;\
1315 p5##_type p5;\
1316 p6##_type p6;\
1317 p7##_type p7;\
1318 p8##_type p8;\
1319 private:\
1320 GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
1321 };\
1322 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1323 typename p3##_type, typename p4##_type, typename p5##_type, \
1324 typename p6##_type, typename p7##_type, typename p8##_type>\
1325 inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
1326 p4##_type, p5##_type, p6##_type, p7##_type, \
1327 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1328 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
1329 p8##_type p8) {\
1330 return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
1331 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
1332 p3, p4, p5, p6, p7, p8);\
1333 }\
1334 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1335 typename p3##_type, typename p4##_type, typename p5##_type, \
1336 typename p6##_type, typename p7##_type, typename p8##_type>\
1337 template <typename F>\
1338 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1339 typename arg3_type, typename arg4_type, typename arg5_type, \
1340 typename arg6_type, typename arg7_type, typename arg8_type, \
1341 typename arg9_type>\
1342 typename ::testing::internal::Function<F>::Result\
1343 name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1344 p5##_type, p6##_type, p7##_type, \
1345 p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1346 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1347
1348 #define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
1349 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1350 typename p3##_type, typename p4##_type, typename p5##_type, \
1351 typename p6##_type, typename p7##_type, typename p8##_type, \
1352 typename p9##_type>\
1353 class name##ActionP10 {\
1354 public:\
1355 name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
1356 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1357 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
1358 p8##_type gmock_p8, \
1359 p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
1360 p1(::std::forward<p1##_type>(gmock_p1)), \
1361 p2(::std::forward<p2##_type>(gmock_p2)), \
1362 p3(::std::forward<p3##_type>(gmock_p3)), \
1363 p4(::std::forward<p4##_type>(gmock_p4)), \
1364 p5(::std::forward<p5##_type>(gmock_p5)), \
1365 p6(::std::forward<p6##_type>(gmock_p6)), \
1366 p7(::std::forward<p7##_type>(gmock_p7)), \
1367 p8(::std::forward<p8##_type>(gmock_p8)), \
1368 p9(::std::forward<p9##_type>(gmock_p9)) {}\
1369 template <typename F>\
1370 class gmock_Impl : public ::testing::ActionInterface<F> {\
1371 public:\
1372 typedef F function_type;\
1373 typedef typename ::testing::internal::Function<F>::Result return_type;\
1374 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1375 args_type;\
1376 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1377 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1378 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
1379 p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
1380 p1(::std::forward<p1##_type>(gmock_p1)), \
1381 p2(::std::forward<p2##_type>(gmock_p2)), \
1382 p3(::std::forward<p3##_type>(gmock_p3)), \
1383 p4(::std::forward<p4##_type>(gmock_p4)), \
1384 p5(::std::forward<p5##_type>(gmock_p5)), \
1385 p6(::std::forward<p6##_type>(gmock_p6)), \
1386 p7(::std::forward<p7##_type>(gmock_p7)), \
1387 p8(::std::forward<p8##_type>(gmock_p8)), \
1388 p9(::std::forward<p9##_type>(gmock_p9)) {}\
1389 return_type Perform(const args_type& args) override {\
1390 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1391 Perform(this, args);\
1392 }\
1393 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1394 typename arg3_type, typename arg4_type, typename arg5_type, \
1395 typename arg6_type, typename arg7_type, typename arg8_type, \
1396 typename arg9_type>\
1397 return_type gmock_PerformImpl(const args_type& args, \
1398 const arg0_type& arg0, const arg1_type& arg1, \
1399 const arg2_type& arg2, const arg3_type& arg3, \
1400 const arg4_type& arg4, const arg5_type& arg5, \
1401 const arg6_type& arg6, const arg7_type& arg7, \
1402 const arg8_type& arg8, const arg9_type& arg9) const;\
1403 p0##_type p0;\
1404 p1##_type p1;\
1405 p2##_type p2;\
1406 p3##_type p3;\
1407 p4##_type p4;\
1408 p5##_type p5;\
1409 p6##_type p6;\
1410 p7##_type p7;\
1411 p8##_type p8;\
1412 p9##_type p9;\
1413 private:\
1414 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1415 };\
1416 template <typename F> operator ::testing::Action<F>() const {\
1417 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1418 p6, p7, p8, p9));\
1419 }\
1420 p0##_type p0;\
1421 p1##_type p1;\
1422 p2##_type p2;\
1423 p3##_type p3;\
1424 p4##_type p4;\
1425 p5##_type p5;\
1426 p6##_type p6;\
1427 p7##_type p7;\
1428 p8##_type p8;\
1429 p9##_type p9;\
1430 private:\
1431 GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
1432 };\
1433 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1434 typename p3##_type, typename p4##_type, typename p5##_type, \
1435 typename p6##_type, typename p7##_type, typename p8##_type, \
1436 typename p9##_type>\
1437 inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1438 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
1439 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1440 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
1441 p9##_type p9) {\
1442 return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1443 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
1444 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
1445 }\
1446 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1447 typename p3##_type, typename p4##_type, typename p5##_type, \
1448 typename p6##_type, typename p7##_type, typename p8##_type, \
1449 typename p9##_type>\
1450 template <typename F>\
1451 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1452 typename arg3_type, typename arg4_type, typename arg5_type, \
1453 typename arg6_type, typename arg7_type, typename arg8_type, \
1454 typename arg9_type>\
1455 typename ::testing::internal::Function<F>::Result\
1456 name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1457 p5##_type, p6##_type, p7##_type, p8##_type, \
1458 p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1459 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1460
1461 namespace testing {
1462
1463
1464 // The ACTION*() macros trigger warning C4100 (unreferenced formal
1465 // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
1466 // the macro definition, as the warnings are generated when the macro
1467 // is expanded and macro expansion cannot contain #pragma. Therefore
1468 // we suppress them here.
1469 #ifdef _MSC_VER
1470 # pragma warning(push)
1471 # pragma warning(disable:4100)
1472 #endif
1473
1474 // Various overloads for InvokeArgument<N>().
1475 //
1476 // The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
1477 // (0-based) argument, which must be a k-ary callable, of the mock
1478 // function, with arguments a1, a2, ..., a_k.
1479 //
1480 // Notes:
1481 //
1482 // 1. The arguments are passed by value by default. If you need to
1483 // pass an argument by reference, wrap it inside ByRef(). For
1484 // example,
1485 //
1486 // InvokeArgument<1>(5, string("Hello"), ByRef(foo))
1487 //
1488 // passes 5 and string("Hello") by value, and passes foo by
1489 // reference.
1490 //
1491 // 2. If the callable takes an argument by reference but ByRef() is
1492 // not used, it will receive the reference to a copy of the value,
1493 // instead of the original value. For example, when the 0-th
1494 // argument of the mock function takes a const string&, the action
1495 //
1496 // InvokeArgument<0>(string("Hello"))
1497 //
1498 // makes a copy of the temporary string("Hello") object and passes a
1499 // reference of the copy, instead of the original temporary object,
1500 // to the callable. This makes it easy for a user to define an
1501 // InvokeArgument action from temporary values and have it performed
1502 // later.
1503
1504 namespace internal {
1505 namespace invoke_argument {
1506
1507 // Appears in InvokeArgumentAdl's argument list to help avoid
1508 // accidental calls to user functions of the same name.
1509 struct AdlTag {};
1510
1511 // InvokeArgumentAdl - a helper for InvokeArgument.
1512 // The basic overloads are provided here for generic functors.
1513 // Overloads for other custom-callables are provided in the
1514 // internal/custom/gmock-generated-actions.h header.
1515
1516 template <typename R, typename F>
InvokeArgumentAdl(AdlTag,F f)1517 R InvokeArgumentAdl(AdlTag, F f) {
1518 return f();
1519 }
1520 template <typename R, typename F, typename A1>
InvokeArgumentAdl(AdlTag,F f,A1 a1)1521 R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
1522 return f(a1);
1523 }
1524 template <typename R, typename F, typename A1, typename A2>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2)1525 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
1526 return f(a1, a2);
1527 }
1528 template <typename R, typename F, typename A1, typename A2, typename A3>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3)1529 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
1530 return f(a1, a2, a3);
1531 }
1532 template <typename R, typename F, typename A1, typename A2, typename A3,
1533 typename A4>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4)1534 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
1535 return f(a1, a2, a3, a4);
1536 }
1537 template <typename R, typename F, typename A1, typename A2, typename A3,
1538 typename A4, typename A5>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5)1539 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
1540 return f(a1, a2, a3, a4, a5);
1541 }
1542 template <typename R, typename F, typename A1, typename A2, typename A3,
1543 typename A4, typename A5, typename A6>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6)1544 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
1545 return f(a1, a2, a3, a4, a5, a6);
1546 }
1547 template <typename R, typename F, typename A1, typename A2, typename A3,
1548 typename A4, typename A5, typename A6, typename A7>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7)1549 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1550 A7 a7) {
1551 return f(a1, a2, a3, a4, a5, a6, a7);
1552 }
1553 template <typename R, typename F, typename A1, typename A2, typename A3,
1554 typename A4, typename A5, typename A6, typename A7, typename A8>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8)1555 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1556 A7 a7, A8 a8) {
1557 return f(a1, a2, a3, a4, a5, a6, a7, a8);
1558 }
1559 template <typename R, typename F, typename A1, typename A2, typename A3,
1560 typename A4, typename A5, typename A6, typename A7, typename A8,
1561 typename A9>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9)1562 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1563 A7 a7, A8 a8, A9 a9) {
1564 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
1565 }
1566 template <typename R, typename F, typename A1, typename A2, typename A3,
1567 typename A4, typename A5, typename A6, typename A7, typename A8,
1568 typename A9, typename A10>
InvokeArgumentAdl(AdlTag,F f,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10)1569 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1570 A7 a7, A8 a8, A9 a9, A10 a10) {
1571 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
1572 }
1573 } // namespace invoke_argument
1574 } // namespace internal
1575
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_0_VALUE_PARAMS ())1576 ACTION_TEMPLATE(InvokeArgument,
1577 HAS_1_TEMPLATE_PARAMS(int, k),
1578 AND_0_VALUE_PARAMS()) {
1579 using internal::invoke_argument::InvokeArgumentAdl;
1580 return InvokeArgumentAdl<return_type>(
1581 internal::invoke_argument::AdlTag(),
1582 ::std::get<k>(args));
1583 }
1584
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_1_VALUE_PARAMS (p0))1585 ACTION_TEMPLATE(InvokeArgument,
1586 HAS_1_TEMPLATE_PARAMS(int, k),
1587 AND_1_VALUE_PARAMS(p0)) {
1588 using internal::invoke_argument::InvokeArgumentAdl;
1589 return InvokeArgumentAdl<return_type>(
1590 internal::invoke_argument::AdlTag(),
1591 ::std::get<k>(args), p0);
1592 }
1593
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_2_VALUE_PARAMS (p0,p1))1594 ACTION_TEMPLATE(InvokeArgument,
1595 HAS_1_TEMPLATE_PARAMS(int, k),
1596 AND_2_VALUE_PARAMS(p0, p1)) {
1597 using internal::invoke_argument::InvokeArgumentAdl;
1598 return InvokeArgumentAdl<return_type>(
1599 internal::invoke_argument::AdlTag(),
1600 ::std::get<k>(args), p0, p1);
1601 }
1602
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_3_VALUE_PARAMS (p0,p1,p2))1603 ACTION_TEMPLATE(InvokeArgument,
1604 HAS_1_TEMPLATE_PARAMS(int, k),
1605 AND_3_VALUE_PARAMS(p0, p1, p2)) {
1606 using internal::invoke_argument::InvokeArgumentAdl;
1607 return InvokeArgumentAdl<return_type>(
1608 internal::invoke_argument::AdlTag(),
1609 ::std::get<k>(args), p0, p1, p2);
1610 }
1611
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_4_VALUE_PARAMS (p0,p1,p2,p3))1612 ACTION_TEMPLATE(InvokeArgument,
1613 HAS_1_TEMPLATE_PARAMS(int, k),
1614 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
1615 using internal::invoke_argument::InvokeArgumentAdl;
1616 return InvokeArgumentAdl<return_type>(
1617 internal::invoke_argument::AdlTag(),
1618 ::std::get<k>(args), p0, p1, p2, p3);
1619 }
1620
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_5_VALUE_PARAMS (p0,p1,p2,p3,p4))1621 ACTION_TEMPLATE(InvokeArgument,
1622 HAS_1_TEMPLATE_PARAMS(int, k),
1623 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
1624 using internal::invoke_argument::InvokeArgumentAdl;
1625 return InvokeArgumentAdl<return_type>(
1626 internal::invoke_argument::AdlTag(),
1627 ::std::get<k>(args), p0, p1, p2, p3, p4);
1628 }
1629
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_6_VALUE_PARAMS (p0,p1,p2,p3,p4,p5))1630 ACTION_TEMPLATE(InvokeArgument,
1631 HAS_1_TEMPLATE_PARAMS(int, k),
1632 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
1633 using internal::invoke_argument::InvokeArgumentAdl;
1634 return InvokeArgumentAdl<return_type>(
1635 internal::invoke_argument::AdlTag(),
1636 ::std::get<k>(args), p0, p1, p2, p3, p4, p5);
1637 }
1638
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_7_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6))1639 ACTION_TEMPLATE(InvokeArgument,
1640 HAS_1_TEMPLATE_PARAMS(int, k),
1641 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
1642 using internal::invoke_argument::InvokeArgumentAdl;
1643 return InvokeArgumentAdl<return_type>(
1644 internal::invoke_argument::AdlTag(),
1645 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
1646 }
1647
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_8_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7))1648 ACTION_TEMPLATE(InvokeArgument,
1649 HAS_1_TEMPLATE_PARAMS(int, k),
1650 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
1651 using internal::invoke_argument::InvokeArgumentAdl;
1652 return InvokeArgumentAdl<return_type>(
1653 internal::invoke_argument::AdlTag(),
1654 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
1655 }
1656
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_9_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7,p8))1657 ACTION_TEMPLATE(InvokeArgument,
1658 HAS_1_TEMPLATE_PARAMS(int, k),
1659 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1660 using internal::invoke_argument::InvokeArgumentAdl;
1661 return InvokeArgumentAdl<return_type>(
1662 internal::invoke_argument::AdlTag(),
1663 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
1664 }
1665
ACTION_TEMPLATE(InvokeArgument,HAS_1_TEMPLATE_PARAMS (int,k),AND_10_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7,p8,p9))1666 ACTION_TEMPLATE(InvokeArgument,
1667 HAS_1_TEMPLATE_PARAMS(int, k),
1668 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1669 using internal::invoke_argument::InvokeArgumentAdl;
1670 return InvokeArgumentAdl<return_type>(
1671 internal::invoke_argument::AdlTag(),
1672 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1673 }
1674
1675 // Various overloads for ReturnNew<T>().
1676 //
1677 // The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
1678 // instance of type T, constructed on the heap with constructor arguments
1679 // a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_0_VALUE_PARAMS ())1680 ACTION_TEMPLATE(ReturnNew,
1681 HAS_1_TEMPLATE_PARAMS(typename, T),
1682 AND_0_VALUE_PARAMS()) {
1683 return new T();
1684 }
1685
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_1_VALUE_PARAMS (p0))1686 ACTION_TEMPLATE(ReturnNew,
1687 HAS_1_TEMPLATE_PARAMS(typename, T),
1688 AND_1_VALUE_PARAMS(p0)) {
1689 return new T(p0);
1690 }
1691
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_2_VALUE_PARAMS (p0,p1))1692 ACTION_TEMPLATE(ReturnNew,
1693 HAS_1_TEMPLATE_PARAMS(typename, T),
1694 AND_2_VALUE_PARAMS(p0, p1)) {
1695 return new T(p0, p1);
1696 }
1697
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_3_VALUE_PARAMS (p0,p1,p2))1698 ACTION_TEMPLATE(ReturnNew,
1699 HAS_1_TEMPLATE_PARAMS(typename, T),
1700 AND_3_VALUE_PARAMS(p0, p1, p2)) {
1701 return new T(p0, p1, p2);
1702 }
1703
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_4_VALUE_PARAMS (p0,p1,p2,p3))1704 ACTION_TEMPLATE(ReturnNew,
1705 HAS_1_TEMPLATE_PARAMS(typename, T),
1706 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
1707 return new T(p0, p1, p2, p3);
1708 }
1709
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_5_VALUE_PARAMS (p0,p1,p2,p3,p4))1710 ACTION_TEMPLATE(ReturnNew,
1711 HAS_1_TEMPLATE_PARAMS(typename, T),
1712 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
1713 return new T(p0, p1, p2, p3, p4);
1714 }
1715
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_6_VALUE_PARAMS (p0,p1,p2,p3,p4,p5))1716 ACTION_TEMPLATE(ReturnNew,
1717 HAS_1_TEMPLATE_PARAMS(typename, T),
1718 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
1719 return new T(p0, p1, p2, p3, p4, p5);
1720 }
1721
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_7_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6))1722 ACTION_TEMPLATE(ReturnNew,
1723 HAS_1_TEMPLATE_PARAMS(typename, T),
1724 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
1725 return new T(p0, p1, p2, p3, p4, p5, p6);
1726 }
1727
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_8_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7))1728 ACTION_TEMPLATE(ReturnNew,
1729 HAS_1_TEMPLATE_PARAMS(typename, T),
1730 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
1731 return new T(p0, p1, p2, p3, p4, p5, p6, p7);
1732 }
1733
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_9_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7,p8))1734 ACTION_TEMPLATE(ReturnNew,
1735 HAS_1_TEMPLATE_PARAMS(typename, T),
1736 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1737 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
1738 }
1739
ACTION_TEMPLATE(ReturnNew,HAS_1_TEMPLATE_PARAMS (typename,T),AND_10_VALUE_PARAMS (p0,p1,p2,p3,p4,p5,p6,p7,p8,p9))1740 ACTION_TEMPLATE(ReturnNew,
1741 HAS_1_TEMPLATE_PARAMS(typename, T),
1742 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1743 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1744 }
1745
1746 #ifdef _MSC_VER
1747 # pragma warning(pop)
1748 #endif
1749
1750 } // namespace testing
1751
1752 // Include any custom callback actions added by the local installation.
1753 // We must include this header at the end to make sure it can use the
1754 // declarations from this file.
1755 #include "gmock/internal/custom/gmock-generated-actions.h"
1756
1757 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
1758