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