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