gmock-generated-actions.h 83 KB

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