stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 5 | // This file automatically generated by testing/generate_gmock_mutant.py. |
| 6 | // DO NOT EDIT. |
| 7 | |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 8 | #ifndef TESTING_GMOCK_MUTANT_H_ |
| 9 | #define TESTING_GMOCK_MUTANT_H_ |
| 10 | |
| 11 | // The intention of this file is to make possible using GMock actions in |
| 12 | // all of its syntactic beauty. Classes and helper functions can be used as |
| 13 | // more generic variants of Task and Callback classes (see base/task.h) |
| 14 | // Mutant supports both pre-bound arguments (like Task) and call-time |
| 15 | // arguments (like Callback) - hence the name. :-) |
| 16 | // |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 17 | // DispatchToMethod/Function supports two sets of arguments: pre-bound (P) and |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 18 | // call-time (C). The arguments as well as the return type are templatized. |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 19 | // DispatchToMethod/Function will also try to call the selected method or |
| 20 | // function even if provided pre-bound arguments does not match exactly with |
| 21 | // the function signature hence the X1, X2 ... XN parameters in CreateFunctor. |
| 22 | // DispatchToMethod will try to invoke method that may not belong to the |
| 23 | // object's class itself but to the object's class base class. |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 24 | // |
| 25 | // Additionally you can bind the object at calltime by binding a pointer to |
| 26 | // pointer to the object at creation time - before including this file you |
| 27 | // have to #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING. |
| 28 | // |
| 29 | // TODO(stoyan): It's yet not clear to me should we use T& and T&* instead |
| 30 | // of T* and T** when we invoke CreateFunctor to match the EXPECT_CALL style. |
| 31 | // |
| 32 | // |
| 33 | // Sample usage with gMock: |
| 34 | // |
| 35 | // struct Mock : public ObjectDelegate { |
| 36 | // MOCK_METHOD2(string, OnRequest(int n, const string& request)); |
| 37 | // MOCK_METHOD1(void, OnQuit(int exit_code)); |
| 38 | // MOCK_METHOD2(void, LogMessage(int level, const string& message)); |
| 39 | // |
| 40 | // string HandleFlowers(const string& reply, int n, const string& request) { |
| 41 | // string result = SStringPrintf("In request of %d %s ", n, request); |
| 42 | // for (int i = 0; i < n; ++i) result.append(reply) |
| 43 | // return result; |
| 44 | // } |
| 45 | // |
| 46 | // void DoLogMessage(int level, const string& message) { |
| 47 | // } |
| 48 | // |
| 49 | // void QuitMessageLoop(int seconds) { |
| 50 | // MessageLoop* loop = MessageLoop::current(); |
| 51 | // loop->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, |
| 52 | // 1000 * seconds); |
| 53 | // } |
| 54 | // }; |
| 55 | // |
| 56 | // Mock mock; |
| 57 | // // Will invoke mock.HandleFlowers("orchids", n, request) |
| 58 | // // "orchids" is a pre-bound argument, and <n> and <request> are call-time |
| 59 | // // arguments - they are not known until the OnRequest mock is invoked. |
| 60 | // EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower")) |
| 61 | // .Times(1) |
| 62 | // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers, |
| 63 | // string("orchids")))); |
| 64 | // |
| 65 | // |
| 66 | // // No pre-bound arguments, two call-time arguments passed |
| 67 | // // directly to DoLogMessage |
| 68 | // EXPECT_CALL(mock, OnLogMessage(_, _)) |
| 69 | // .Times(AnyNumber()) |
| 70 | // .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage)); |
| 71 | // |
| 72 | // |
| 73 | // // In this case we have a single pre-bound argument - 3. We ignore |
| 74 | // // all of the arguments of OnQuit. |
| 75 | // EXCEPT_CALL(mock, OnQuit(_)) |
| 76 | // .Times(1) |
| 77 | // .WillOnce(InvokeWithoutArgs(CreateFunctor( |
| 78 | // &mock, &Mock::QuitMessageLoop, 3))); |
| 79 | // |
| 80 | // MessageLoop loop; |
| 81 | // loop.Run(); |
| 82 | // |
| 83 | // |
| 84 | // // Here is another example of how we can set an action that invokes |
| 85 | // // method of an object that is not yet created. |
| 86 | // struct Mock : public ObjectDelegate { |
| 87 | // MOCK_METHOD1(void, DemiurgeCreated(Demiurge*)); |
| 88 | // MOCK_METHOD2(void, OnRequest(int count, const string&)); |
| 89 | // |
| 90 | // void StoreDemiurge(Demiurge* w) { |
| 91 | // demiurge_ = w; |
| 92 | // } |
| 93 | // |
| 94 | // Demiurge* demiurge; |
| 95 | // } |
| 96 | // |
| 97 | // EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1) |
| 98 | // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge))); |
| 99 | // |
| 100 | // EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick"))) |
| 101 | // .Times(AnyNumber()) |
| 102 | // .WillAlways(WithArgs<0>(Invoke( |
| 103 | // CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters)))); |
| 104 | // |
| 105 | |
| 106 | #include "base/linked_ptr.h" |
| 107 | #include "base/tuple.h" // for Tuple |
| 108 | |
| 109 | namespace testing { |
| 110 | |
| 111 | // 0 - 0 |
| 112 | template <typename R, typename T, typename Method> |
| 113 | inline R DispatchToMethod(T* obj, Method method, |
| 114 | const Tuple0& p, |
| 115 | const Tuple0& c) { |
| 116 | return (obj->*method)(); |
| 117 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 118 | template <typename R, typename Function> |
| 119 | inline R DispatchToFunction(Function function, |
| 120 | const Tuple0& p, |
| 121 | const Tuple0& c) { |
| 122 | return (*function)(); |
| 123 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 124 | |
| 125 | // 0 - 1 |
| 126 | template <typename R, typename T, typename Method, typename C1> |
| 127 | inline R DispatchToMethod(T* obj, Method method, |
| 128 | const Tuple0& p, |
| 129 | const Tuple1<C1>& c) { |
| 130 | return (obj->*method)(c.a); |
| 131 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 132 | template <typename R, typename Function, typename C1> |
| 133 | inline R DispatchToFunction(Function function, |
| 134 | const Tuple0& p, |
| 135 | const Tuple1<C1>& c) { |
| 136 | return (*function)(c.a); |
| 137 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 138 | |
| 139 | // 0 - 2 |
| 140 | template <typename R, typename T, typename Method, typename C1, typename C2> |
| 141 | inline R DispatchToMethod(T* obj, Method method, |
| 142 | const Tuple0& p, |
| 143 | const Tuple2<C1, C2>& c) { |
| 144 | return (obj->*method)(c.a, c.b); |
| 145 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 146 | template <typename R, typename Function, typename C1, typename C2> |
| 147 | inline R DispatchToFunction(Function function, |
| 148 | const Tuple0& p, |
| 149 | const Tuple2<C1, C2>& c) { |
| 150 | return (*function)(c.a, c.b); |
| 151 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 152 | |
| 153 | // 0 - 3 |
| 154 | template <typename R, typename T, typename Method, typename C1, typename C2, |
| 155 | typename C3> |
| 156 | inline R DispatchToMethod(T* obj, Method method, |
| 157 | const Tuple0& p, |
| 158 | const Tuple3<C1, C2, C3>& c) { |
| 159 | return (obj->*method)(c.a, c.b, c.c); |
| 160 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 161 | template <typename R, typename Function, typename C1, typename C2, typename C3> |
| 162 | inline R DispatchToFunction(Function function, |
| 163 | const Tuple0& p, |
| 164 | const Tuple3<C1, C2, C3>& c) { |
| 165 | return (*function)(c.a, c.b, c.c); |
| 166 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 167 | |
| 168 | // 0 - 4 |
| 169 | template <typename R, typename T, typename Method, typename C1, typename C2, |
| 170 | typename C3, typename C4> |
| 171 | inline R DispatchToMethod(T* obj, Method method, |
| 172 | const Tuple0& p, |
| 173 | const Tuple4<C1, C2, C3, C4>& c) { |
| 174 | return (obj->*method)(c.a, c.b, c.c, c.d); |
| 175 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 176 | template <typename R, typename Function, typename C1, typename C2, typename C3, |
| 177 | typename C4> |
| 178 | inline R DispatchToFunction(Function function, |
| 179 | const Tuple0& p, |
| 180 | const Tuple4<C1, C2, C3, C4>& c) { |
| 181 | return (*function)(c.a, c.b, c.c, c.d); |
| 182 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 183 | |
| 184 | // 1 - 0 |
| 185 | template <typename R, typename T, typename Method, typename P1> |
| 186 | inline R DispatchToMethod(T* obj, Method method, |
| 187 | const Tuple1<P1>& p, |
| 188 | const Tuple0& c) { |
| 189 | return (obj->*method)(p.a); |
| 190 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 191 | template <typename R, typename Function, typename P1> |
| 192 | inline R DispatchToFunction(Function function, |
| 193 | const Tuple1<P1>& p, |
| 194 | const Tuple0& c) { |
| 195 | return (*function)(p.a); |
| 196 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 197 | |
| 198 | // 1 - 1 |
| 199 | template <typename R, typename T, typename Method, typename P1, typename C1> |
| 200 | inline R DispatchToMethod(T* obj, Method method, |
| 201 | const Tuple1<P1>& p, |
| 202 | const Tuple1<C1>& c) { |
| 203 | return (obj->*method)(p.a, c.a); |
| 204 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 205 | template <typename R, typename Function, typename P1, typename C1> |
| 206 | inline R DispatchToFunction(Function function, |
| 207 | const Tuple1<P1>& p, |
| 208 | const Tuple1<C1>& c) { |
| 209 | return (*function)(p.a, c.a); |
| 210 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 211 | |
| 212 | // 1 - 2 |
| 213 | template <typename R, typename T, typename Method, typename P1, typename C1, |
| 214 | typename C2> |
| 215 | inline R DispatchToMethod(T* obj, Method method, |
| 216 | const Tuple1<P1>& p, |
| 217 | const Tuple2<C1, C2>& c) { |
| 218 | return (obj->*method)(p.a, c.a, c.b); |
| 219 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 220 | template <typename R, typename Function, typename P1, typename C1, typename C2> |
| 221 | inline R DispatchToFunction(Function function, |
| 222 | const Tuple1<P1>& p, |
| 223 | const Tuple2<C1, C2>& c) { |
| 224 | return (*function)(p.a, c.a, c.b); |
| 225 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 226 | |
| 227 | // 1 - 3 |
| 228 | template <typename R, typename T, typename Method, typename P1, typename C1, |
| 229 | typename C2, typename C3> |
| 230 | inline R DispatchToMethod(T* obj, Method method, |
| 231 | const Tuple1<P1>& p, |
| 232 | const Tuple3<C1, C2, C3>& c) { |
| 233 | return (obj->*method)(p.a, c.a, c.b, c.c); |
| 234 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 235 | template <typename R, typename Function, typename P1, typename C1, typename C2, |
| 236 | typename C3> |
| 237 | inline R DispatchToFunction(Function function, |
| 238 | const Tuple1<P1>& p, |
| 239 | const Tuple3<C1, C2, C3>& c) { |
| 240 | return (*function)(p.a, c.a, c.b, c.c); |
| 241 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 242 | |
| 243 | // 1 - 4 |
| 244 | template <typename R, typename T, typename Method, typename P1, typename C1, |
| 245 | typename C2, typename C3, typename C4> |
| 246 | inline R DispatchToMethod(T* obj, Method method, |
| 247 | const Tuple1<P1>& p, |
| 248 | const Tuple4<C1, C2, C3, C4>& c) { |
| 249 | return (obj->*method)(p.a, c.a, c.b, c.c, c.d); |
| 250 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 251 | template <typename R, typename Function, typename P1, typename C1, typename C2, |
| 252 | typename C3, typename C4> |
| 253 | inline R DispatchToFunction(Function function, |
| 254 | const Tuple1<P1>& p, |
| 255 | const Tuple4<C1, C2, C3, C4>& c) { |
| 256 | return (*function)(p.a, c.a, c.b, c.c, c.d); |
| 257 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 258 | |
| 259 | // 2 - 0 |
| 260 | template <typename R, typename T, typename Method, typename P1, typename P2> |
| 261 | inline R DispatchToMethod(T* obj, Method method, |
| 262 | const Tuple2<P1, P2>& p, |
| 263 | const Tuple0& c) { |
| 264 | return (obj->*method)(p.a, p.b); |
| 265 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 266 | template <typename R, typename Function, typename P1, typename P2> |
| 267 | inline R DispatchToFunction(Function function, |
| 268 | const Tuple2<P1, P2>& p, |
| 269 | const Tuple0& c) { |
| 270 | return (*function)(p.a, p.b); |
| 271 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 272 | |
| 273 | // 2 - 1 |
| 274 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 275 | typename C1> |
| 276 | inline R DispatchToMethod(T* obj, Method method, |
| 277 | const Tuple2<P1, P2>& p, |
| 278 | const Tuple1<C1>& c) { |
| 279 | return (obj->*method)(p.a, p.b, c.a); |
| 280 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 281 | template <typename R, typename Function, typename P1, typename P2, typename C1> |
| 282 | inline R DispatchToFunction(Function function, |
| 283 | const Tuple2<P1, P2>& p, |
| 284 | const Tuple1<C1>& c) { |
| 285 | return (*function)(p.a, p.b, c.a); |
| 286 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 287 | |
| 288 | // 2 - 2 |
| 289 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 290 | typename C1, typename C2> |
| 291 | inline R DispatchToMethod(T* obj, Method method, |
| 292 | const Tuple2<P1, P2>& p, |
| 293 | const Tuple2<C1, C2>& c) { |
| 294 | return (obj->*method)(p.a, p.b, c.a, c.b); |
| 295 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 296 | template <typename R, typename Function, typename P1, typename P2, typename C1, |
| 297 | typename C2> |
| 298 | inline R DispatchToFunction(Function function, |
| 299 | const Tuple2<P1, P2>& p, |
| 300 | const Tuple2<C1, C2>& c) { |
| 301 | return (*function)(p.a, p.b, c.a, c.b); |
| 302 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 303 | |
| 304 | // 2 - 3 |
| 305 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 306 | typename C1, typename C2, typename C3> |
| 307 | inline R DispatchToMethod(T* obj, Method method, |
| 308 | const Tuple2<P1, P2>& p, |
| 309 | const Tuple3<C1, C2, C3>& c) { |
| 310 | return (obj->*method)(p.a, p.b, c.a, c.b, c.c); |
| 311 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 312 | template <typename R, typename Function, typename P1, typename P2, typename C1, |
| 313 | typename C2, typename C3> |
| 314 | inline R DispatchToFunction(Function function, |
| 315 | const Tuple2<P1, P2>& p, |
| 316 | const Tuple3<C1, C2, C3>& c) { |
| 317 | return (*function)(p.a, p.b, c.a, c.b, c.c); |
| 318 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 319 | |
| 320 | // 2 - 4 |
| 321 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 322 | typename C1, typename C2, typename C3, typename C4> |
| 323 | inline R DispatchToMethod(T* obj, Method method, |
| 324 | const Tuple2<P1, P2>& p, |
| 325 | const Tuple4<C1, C2, C3, C4>& c) { |
| 326 | return (obj->*method)(p.a, p.b, c.a, c.b, c.c, c.d); |
| 327 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 328 | template <typename R, typename Function, typename P1, typename P2, typename C1, |
| 329 | typename C2, typename C3, typename C4> |
| 330 | inline R DispatchToFunction(Function function, |
| 331 | const Tuple2<P1, P2>& p, |
| 332 | const Tuple4<C1, C2, C3, C4>& c) { |
| 333 | return (*function)(p.a, p.b, c.a, c.b, c.c, c.d); |
| 334 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 335 | |
| 336 | // 3 - 0 |
| 337 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 338 | typename P3> |
| 339 | inline R DispatchToMethod(T* obj, Method method, |
| 340 | const Tuple3<P1, P2, P3>& p, |
| 341 | const Tuple0& c) { |
| 342 | return (obj->*method)(p.a, p.b, p.c); |
| 343 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 344 | template <typename R, typename Function, typename P1, typename P2, typename P3> |
| 345 | inline R DispatchToFunction(Function function, |
| 346 | const Tuple3<P1, P2, P3>& p, |
| 347 | const Tuple0& c) { |
| 348 | return (*function)(p.a, p.b, p.c); |
| 349 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 350 | |
| 351 | // 3 - 1 |
| 352 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 353 | typename P3, typename C1> |
| 354 | inline R DispatchToMethod(T* obj, Method method, |
| 355 | const Tuple3<P1, P2, P3>& p, |
| 356 | const Tuple1<C1>& c) { |
| 357 | return (obj->*method)(p.a, p.b, p.c, c.a); |
| 358 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 359 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 360 | typename C1> |
| 361 | inline R DispatchToFunction(Function function, |
| 362 | const Tuple3<P1, P2, P3>& p, |
| 363 | const Tuple1<C1>& c) { |
| 364 | return (*function)(p.a, p.b, p.c, c.a); |
| 365 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 366 | |
| 367 | // 3 - 2 |
| 368 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 369 | typename P3, typename C1, typename C2> |
| 370 | inline R DispatchToMethod(T* obj, Method method, |
| 371 | const Tuple3<P1, P2, P3>& p, |
| 372 | const Tuple2<C1, C2>& c) { |
| 373 | return (obj->*method)(p.a, p.b, p.c, c.a, c.b); |
| 374 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 375 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 376 | typename C1, typename C2> |
| 377 | inline R DispatchToFunction(Function function, |
| 378 | const Tuple3<P1, P2, P3>& p, |
| 379 | const Tuple2<C1, C2>& c) { |
| 380 | return (*function)(p.a, p.b, p.c, c.a, c.b); |
| 381 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 382 | |
| 383 | // 3 - 3 |
| 384 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 385 | typename P3, typename C1, typename C2, typename C3> |
| 386 | inline R DispatchToMethod(T* obj, Method method, |
| 387 | const Tuple3<P1, P2, P3>& p, |
| 388 | const Tuple3<C1, C2, C3>& c) { |
| 389 | return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c); |
| 390 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 391 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 392 | typename C1, typename C2, typename C3> |
| 393 | inline R DispatchToFunction(Function function, |
| 394 | const Tuple3<P1, P2, P3>& p, |
| 395 | const Tuple3<C1, C2, C3>& c) { |
| 396 | return (*function)(p.a, p.b, p.c, c.a, c.b, c.c); |
| 397 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 398 | |
| 399 | // 3 - 4 |
| 400 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 401 | typename P3, typename C1, typename C2, typename C3, typename C4> |
| 402 | inline R DispatchToMethod(T* obj, Method method, |
| 403 | const Tuple3<P1, P2, P3>& p, |
| 404 | const Tuple4<C1, C2, C3, C4>& c) { |
| 405 | return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c, c.d); |
| 406 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 407 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 408 | typename C1, typename C2, typename C3, typename C4> |
| 409 | inline R DispatchToFunction(Function function, |
| 410 | const Tuple3<P1, P2, P3>& p, |
| 411 | const Tuple4<C1, C2, C3, C4>& c) { |
| 412 | return (*function)(p.a, p.b, p.c, c.a, c.b, c.c, c.d); |
| 413 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 414 | |
| 415 | // 4 - 0 |
| 416 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 417 | typename P3, typename P4> |
| 418 | inline R DispatchToMethod(T* obj, Method method, |
| 419 | const Tuple4<P1, P2, P3, P4>& p, |
| 420 | const Tuple0& c) { |
| 421 | return (obj->*method)(p.a, p.b, p.c, p.d); |
| 422 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 423 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 424 | typename P4> |
| 425 | inline R DispatchToFunction(Function function, |
| 426 | const Tuple4<P1, P2, P3, P4>& p, |
| 427 | const Tuple0& c) { |
| 428 | return (*function)(p.a, p.b, p.c, p.d); |
| 429 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 430 | |
| 431 | // 4 - 1 |
| 432 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 433 | typename P3, typename P4, typename C1> |
| 434 | inline R DispatchToMethod(T* obj, Method method, |
| 435 | const Tuple4<P1, P2, P3, P4>& p, |
| 436 | const Tuple1<C1>& c) { |
| 437 | return (obj->*method)(p.a, p.b, p.c, p.d, c.a); |
| 438 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 439 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 440 | typename P4, typename C1> |
| 441 | inline R DispatchToFunction(Function function, |
| 442 | const Tuple4<P1, P2, P3, P4>& p, |
| 443 | const Tuple1<C1>& c) { |
| 444 | return (*function)(p.a, p.b, p.c, p.d, c.a); |
| 445 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 446 | |
| 447 | // 4 - 2 |
| 448 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 449 | typename P3, typename P4, typename C1, typename C2> |
| 450 | inline R DispatchToMethod(T* obj, Method method, |
| 451 | const Tuple4<P1, P2, P3, P4>& p, |
| 452 | const Tuple2<C1, C2>& c) { |
| 453 | return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b); |
| 454 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 455 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 456 | typename P4, typename C1, typename C2> |
| 457 | inline R DispatchToFunction(Function function, |
| 458 | const Tuple4<P1, P2, P3, P4>& p, |
| 459 | const Tuple2<C1, C2>& c) { |
| 460 | return (*function)(p.a, p.b, p.c, p.d, c.a, c.b); |
| 461 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 462 | |
| 463 | // 4 - 3 |
| 464 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 465 | typename P3, typename P4, typename C1, typename C2, typename C3> |
| 466 | inline R DispatchToMethod(T* obj, Method method, |
| 467 | const Tuple4<P1, P2, P3, P4>& p, |
| 468 | const Tuple3<C1, C2, C3>& c) { |
| 469 | return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c); |
| 470 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 471 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 472 | typename P4, typename C1, typename C2, typename C3> |
| 473 | inline R DispatchToFunction(Function function, |
| 474 | const Tuple4<P1, P2, P3, P4>& p, |
| 475 | const Tuple3<C1, C2, C3>& c) { |
| 476 | return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c); |
| 477 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 478 | |
| 479 | // 4 - 4 |
| 480 | template <typename R, typename T, typename Method, typename P1, typename P2, |
| 481 | typename P3, typename P4, typename C1, typename C2, typename C3, |
| 482 | typename C4> |
| 483 | inline R DispatchToMethod(T* obj, Method method, |
| 484 | const Tuple4<P1, P2, P3, P4>& p, |
| 485 | const Tuple4<C1, C2, C3, C4>& c) { |
| 486 | return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d); |
| 487 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 488 | template <typename R, typename Function, typename P1, typename P2, typename P3, |
| 489 | typename P4, typename C1, typename C2, typename C3, typename C4> |
| 490 | inline R DispatchToFunction(Function function, |
| 491 | const Tuple4<P1, P2, P3, P4>& p, |
| 492 | const Tuple4<C1, C2, C3, C4>& c) { |
| 493 | return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d); |
| 494 | } |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 495 | |
| 496 | // Interface that is exposed to the consumer, that does the actual calling |
| 497 | // of the method. |
| 498 | template <typename R, typename Params> |
| 499 | class MutantRunner { |
| 500 | public: |
| 501 | virtual R RunWithParams(const Params& params) = 0; |
| 502 | virtual ~MutantRunner() {} |
| 503 | }; |
| 504 | |
| 505 | // Mutant holds pre-bound arguments (like Task). Like Callback |
| 506 | // allows call-time arguments. You bind a pointer to the object |
| 507 | // at creation time. |
| 508 | template <typename R, typename T, typename Method, |
| 509 | typename PreBound, typename Params> |
| 510 | class Mutant : public MutantRunner<R, Params> { |
| 511 | public: |
| 512 | Mutant(T* obj, Method method, const PreBound& pb) |
| 513 | : obj_(obj), method_(method), pb_(pb) { |
| 514 | } |
| 515 | |
| 516 | // MutantRunner implementation |
| 517 | virtual R RunWithParams(const Params& params) { |
| 518 | return DispatchToMethod<R>(this->obj_, this->method_, pb_, params); |
| 519 | } |
| 520 | |
| 521 | T* obj_; |
| 522 | Method method_; |
| 523 | PreBound pb_; |
| 524 | }; |
| 525 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 526 | template <typename R, typename Function, typename PreBound, typename Params> |
| 527 | class MutantFunction : public MutantRunner<R, Params> { |
| 528 | public: |
| 529 | MutantFunction(Function function, const PreBound& pb) |
| 530 | : function_(function), pb_(pb) { |
| 531 | } |
| 532 | |
| 533 | // MutantRunner implementation |
| 534 | virtual R RunWithParams(const Params& params) { |
| 535 | return DispatchToFunction<R>(function_, pb_, params); |
| 536 | } |
| 537 | |
| 538 | Function function_; |
| 539 | PreBound pb_; |
| 540 | }; |
| 541 | |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 542 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 543 | // MutantLateBind is like Mutant, but you bind a pointer to a pointer |
| 544 | // to the object. This way you can create actions for an object |
| 545 | // that is not yet created (has only storage for a pointer to it). |
| 546 | template <typename R, typename T, typename Method, |
| 547 | typename PreBound, typename Params> |
| 548 | class MutantLateObjectBind : public MutantRunner<R, Params> { |
| 549 | public: |
| 550 | MutantLateObjectBind(T** obj, Method method, const PreBound& pb) |
| 551 | : obj_(obj), method_(method), pb_(pb) { |
| 552 | } |
| 553 | |
| 554 | // MutantRunner implementation. |
| 555 | virtual R RunWithParams(const Params& params) { |
| 556 | EXPECT_THAT(*this->obj_, testing::NotNull()); |
| 557 | if (NULL == *this->obj_) |
| 558 | return R(); |
| 559 | return DispatchToMethod<R>( *this->obj_, this->method_, pb_, params); |
| 560 | } |
| 561 | |
| 562 | T** obj_; |
| 563 | Method method_; |
| 564 | PreBound pb_; |
| 565 | }; |
| 566 | #endif |
| 567 | |
| 568 | // Simple MutantRunner<> wrapper acting as a functor. |
| 569 | // Redirects operator() to MutantRunner<Params>::Run() |
| 570 | template <typename R, typename Params> |
| 571 | struct MutantFunctor { |
| 572 | explicit MutantFunctor(MutantRunner<R, Params>* cb) : impl_(cb) { |
| 573 | } |
| 574 | |
| 575 | ~MutantFunctor() { |
| 576 | } |
| 577 | |
| 578 | inline R operator()() { |
| 579 | return impl_->RunWithParams(Tuple0()); |
| 580 | } |
| 581 | |
| 582 | template <typename Arg1> |
| 583 | inline R operator()(const Arg1& a) { |
| 584 | return impl_->RunWithParams(Params(a)); |
| 585 | } |
| 586 | |
| 587 | template <typename Arg1, typename Arg2> |
| 588 | inline R operator()(const Arg1& a, const Arg2& b) { |
| 589 | return impl_->RunWithParams(Params(a, b)); |
| 590 | } |
| 591 | |
| 592 | template <typename Arg1, typename Arg2, typename Arg3> |
| 593 | inline R operator()(const Arg1& a, const Arg2& b, const Arg3& c) { |
| 594 | return impl_->RunWithParams(Params(a, b, c)); |
| 595 | } |
| 596 | |
| 597 | template <typename Arg1, typename Arg2, typename Arg3, typename Arg4> |
| 598 | inline R operator()(const Arg1& a, const Arg2& b, const Arg3& c, |
| 599 | const Arg4& d) { |
| 600 | return impl_->RunWithParams(Params(a, b, c, d)); |
| 601 | } |
| 602 | |
| 603 | private: |
| 604 | // We need copy constructor since MutantFunctor is copied few times |
| 605 | // inside GMock machinery, hence no DISALLOW_EVIL_CONTRUCTORS |
| 606 | MutantFunctor(); |
| 607 | linked_ptr<MutantRunner<R, Params> > impl_; |
| 608 | }; |
| 609 | |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 610 | // 0 - 0 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 611 | template <typename R, typename T, typename U> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 612 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 613 | CreateFunctor(T* obj, R (U::*method)()) { |
| 614 | MutantRunner<R, Tuple0>* t = |
| 615 | new Mutant<R, T, R (U::*)(), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 616 | Tuple0, Tuple0> |
| 617 | (obj, method, MakeTuple()); |
| 618 | return MutantFunctor<R, Tuple0>(t); |
| 619 | } |
| 620 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 621 | template <typename R> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 622 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 623 | CreateFunctor(R (*function)()) { |
| 624 | MutantRunner<R, Tuple0>* t = |
| 625 | new MutantFunction<R, R (*)(), |
| 626 | Tuple0, Tuple0> |
| 627 | (function, MakeTuple()); |
| 628 | return MutantFunctor<R, Tuple0>(t); |
| 629 | } |
| 630 | |
| 631 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 632 | template <typename R, typename T, typename U> |
| 633 | inline MutantFunctor<R, Tuple0> |
| 634 | CreateFunctor(T** obj, R (U::*method)()) { |
| 635 | MutantRunner<R, Tuple0>* t = |
| 636 | new MutantLateObjectBind<R, T, R (U::*)(), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 637 | Tuple0, Tuple0> |
| 638 | (obj, method, MakeTuple()); |
| 639 | return MutantFunctor<R, Tuple0>(t); |
| 640 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 641 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 642 | |
| 643 | #if defined (OS_WIN) |
| 644 | template <typename R, typename T, typename U> |
| 645 | inline MutantFunctor<R, Tuple0> |
| 646 | CreateFunctor(T* obj, R (__stdcall U::*method)()) { |
| 647 | MutantRunner<R, Tuple0>* t = |
| 648 | new Mutant<R, T, R (__stdcall U::*)(), |
| 649 | Tuple0, Tuple0> |
| 650 | (obj, method, MakeTuple()); |
| 651 | return MutantFunctor<R, Tuple0>(t); |
| 652 | } |
| 653 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 654 | |
| 655 | // 0 - 1 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 656 | template <typename R, typename T, typename U, typename A1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 657 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 658 | CreateFunctor(T* obj, R (U::*method)(A1)) { |
| 659 | MutantRunner<R, Tuple1<A1> >* t = |
| 660 | new Mutant<R, T, R (U::*)(A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 661 | Tuple0, Tuple1<A1> > |
| 662 | (obj, method, MakeTuple()); |
| 663 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 664 | } |
| 665 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 666 | template <typename R, typename A1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 667 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 668 | CreateFunctor(R (*function)(A1)) { |
| 669 | MutantRunner<R, Tuple1<A1> >* t = |
| 670 | new MutantFunction<R, R (*)(A1), |
| 671 | Tuple0, Tuple1<A1> > |
| 672 | (function, MakeTuple()); |
| 673 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 674 | } |
| 675 | |
| 676 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 677 | template <typename R, typename T, typename U, typename A1> |
| 678 | inline MutantFunctor<R, Tuple1<A1> > |
| 679 | CreateFunctor(T** obj, R (U::*method)(A1)) { |
| 680 | MutantRunner<R, Tuple1<A1> >* t = |
| 681 | new MutantLateObjectBind<R, T, R (U::*)(A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 682 | Tuple0, Tuple1<A1> > |
| 683 | (obj, method, MakeTuple()); |
| 684 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 685 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 686 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 687 | |
| 688 | #if defined (OS_WIN) |
| 689 | template <typename R, typename T, typename U, typename A1> |
| 690 | inline MutantFunctor<R, Tuple1<A1> > |
| 691 | CreateFunctor(T* obj, R (__stdcall U::*method)(A1)) { |
| 692 | MutantRunner<R, Tuple1<A1> >* t = |
| 693 | new Mutant<R, T, R (__stdcall U::*)(A1), |
| 694 | Tuple0, Tuple1<A1> > |
| 695 | (obj, method, MakeTuple()); |
| 696 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 697 | } |
| 698 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 699 | |
| 700 | // 0 - 2 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 701 | template <typename R, typename T, typename U, typename A1, typename A2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 702 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 703 | CreateFunctor(T* obj, R (U::*method)(A1, A2)) { |
| 704 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 705 | new Mutant<R, T, R (U::*)(A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 706 | Tuple0, Tuple2<A1, A2> > |
| 707 | (obj, method, MakeTuple()); |
| 708 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 709 | } |
| 710 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 711 | template <typename R, typename A1, typename A2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 712 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 713 | CreateFunctor(R (*function)(A1, A2)) { |
| 714 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 715 | new MutantFunction<R, R (*)(A1, A2), |
| 716 | Tuple0, Tuple2<A1, A2> > |
| 717 | (function, MakeTuple()); |
| 718 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 719 | } |
| 720 | |
| 721 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 722 | template <typename R, typename T, typename U, typename A1, typename A2> |
| 723 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 724 | CreateFunctor(T** obj, R (U::*method)(A1, A2)) { |
| 725 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 726 | new MutantLateObjectBind<R, T, R (U::*)(A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 727 | Tuple0, Tuple2<A1, A2> > |
| 728 | (obj, method, MakeTuple()); |
| 729 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 730 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 731 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 732 | |
| 733 | #if defined (OS_WIN) |
| 734 | template <typename R, typename T, typename U, typename A1, typename A2> |
| 735 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 736 | CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2)) { |
| 737 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 738 | new Mutant<R, T, R (__stdcall U::*)(A1, A2), |
| 739 | Tuple0, Tuple2<A1, A2> > |
| 740 | (obj, method, MakeTuple()); |
| 741 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 742 | } |
| 743 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 744 | |
| 745 | // 0 - 3 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 746 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 747 | typename A3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 748 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 749 | CreateFunctor(T* obj, R (U::*method)(A1, A2, A3)) { |
| 750 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 751 | new Mutant<R, T, R (U::*)(A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 752 | Tuple0, Tuple3<A1, A2, A3> > |
| 753 | (obj, method, MakeTuple()); |
| 754 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 755 | } |
| 756 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 757 | template <typename R, typename A1, typename A2, typename A3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 758 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 759 | CreateFunctor(R (*function)(A1, A2, A3)) { |
| 760 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 761 | new MutantFunction<R, R (*)(A1, A2, A3), |
| 762 | Tuple0, Tuple3<A1, A2, A3> > |
| 763 | (function, MakeTuple()); |
| 764 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 765 | } |
| 766 | |
| 767 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 768 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 769 | typename A3> |
| 770 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 771 | CreateFunctor(T** obj, R (U::*method)(A1, A2, A3)) { |
| 772 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 773 | new MutantLateObjectBind<R, T, R (U::*)(A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 774 | Tuple0, Tuple3<A1, A2, A3> > |
| 775 | (obj, method, MakeTuple()); |
| 776 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 777 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 778 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 779 | |
| 780 | #if defined (OS_WIN) |
| 781 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 782 | typename A3> |
| 783 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 784 | CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2, A3)) { |
| 785 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 786 | new Mutant<R, T, R (__stdcall U::*)(A1, A2, A3), |
| 787 | Tuple0, Tuple3<A1, A2, A3> > |
| 788 | (obj, method, MakeTuple()); |
| 789 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 790 | } |
| 791 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 792 | |
| 793 | // 0 - 4 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 794 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 795 | typename A3, typename A4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 796 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 797 | CreateFunctor(T* obj, R (U::*method)(A1, A2, A3, A4)) { |
| 798 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 799 | new Mutant<R, T, R (U::*)(A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 800 | Tuple0, Tuple4<A1, A2, A3, A4> > |
| 801 | (obj, method, MakeTuple()); |
| 802 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 803 | } |
| 804 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 805 | template <typename R, typename A1, typename A2, typename A3, typename A4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 806 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 807 | CreateFunctor(R (*function)(A1, A2, A3, A4)) { |
| 808 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 809 | new MutantFunction<R, R (*)(A1, A2, A3, A4), |
| 810 | Tuple0, Tuple4<A1, A2, A3, A4> > |
| 811 | (function, MakeTuple()); |
| 812 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 813 | } |
| 814 | |
| 815 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 816 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 817 | typename A3, typename A4> |
| 818 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 819 | CreateFunctor(T** obj, R (U::*method)(A1, A2, A3, A4)) { |
| 820 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 821 | new MutantLateObjectBind<R, T, R (U::*)(A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 822 | Tuple0, Tuple4<A1, A2, A3, A4> > |
| 823 | (obj, method, MakeTuple()); |
| 824 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 825 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 826 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 827 | |
| 828 | #if defined (OS_WIN) |
| 829 | template <typename R, typename T, typename U, typename A1, typename A2, |
| 830 | typename A3, typename A4> |
| 831 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 832 | CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2, A3, A4)) { |
| 833 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 834 | new Mutant<R, T, R (__stdcall U::*)(A1, A2, A3, A4), |
| 835 | Tuple0, Tuple4<A1, A2, A3, A4> > |
| 836 | (obj, method, MakeTuple()); |
| 837 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 838 | } |
| 839 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 840 | |
| 841 | // 1 - 0 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 842 | template <typename R, typename T, typename U, typename P1, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 843 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 844 | CreateFunctor(T* obj, R (U::*method)(X1), const P1& p1) { |
| 845 | MutantRunner<R, Tuple0>* t = |
| 846 | new Mutant<R, T, R (U::*)(X1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 847 | Tuple1<P1>, Tuple0> |
| 848 | (obj, method, MakeTuple(p1)); |
| 849 | return MutantFunctor<R, Tuple0>(t); |
| 850 | } |
| 851 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 852 | template <typename R, typename P1, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 853 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 854 | CreateFunctor(R (*function)(X1), const P1& p1) { |
| 855 | MutantRunner<R, Tuple0>* t = |
| 856 | new MutantFunction<R, R (*)(X1), |
| 857 | Tuple1<P1>, Tuple0> |
| 858 | (function, MakeTuple(p1)); |
| 859 | return MutantFunctor<R, Tuple0>(t); |
| 860 | } |
| 861 | |
| 862 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 863 | template <typename R, typename T, typename U, typename P1, typename X1> |
| 864 | inline MutantFunctor<R, Tuple0> |
| 865 | CreateFunctor(T** obj, R (U::*method)(X1), const P1& p1) { |
| 866 | MutantRunner<R, Tuple0>* t = |
| 867 | new MutantLateObjectBind<R, T, R (U::*)(X1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 868 | Tuple1<P1>, Tuple0> |
| 869 | (obj, method, MakeTuple(p1)); |
| 870 | return MutantFunctor<R, Tuple0>(t); |
| 871 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 872 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 873 | |
| 874 | #if defined (OS_WIN) |
| 875 | template <typename R, typename T, typename U, typename P1, typename X1> |
| 876 | inline MutantFunctor<R, Tuple0> |
| 877 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1), const P1& p1) { |
| 878 | MutantRunner<R, Tuple0>* t = |
| 879 | new Mutant<R, T, R (__stdcall U::*)(X1), |
| 880 | Tuple1<P1>, Tuple0> |
| 881 | (obj, method, MakeTuple(p1)); |
| 882 | return MutantFunctor<R, Tuple0>(t); |
| 883 | } |
| 884 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 885 | |
| 886 | // 1 - 1 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 887 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 888 | typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 889 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 890 | CreateFunctor(T* obj, R (U::*method)(X1, A1), const P1& p1) { |
| 891 | MutantRunner<R, Tuple1<A1> >* t = |
| 892 | new Mutant<R, T, R (U::*)(X1, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 893 | Tuple1<P1>, Tuple1<A1> > |
| 894 | (obj, method, MakeTuple(p1)); |
| 895 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 896 | } |
| 897 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 898 | template <typename R, typename P1, typename A1, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 899 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 900 | CreateFunctor(R (*function)(X1, A1), const P1& p1) { |
| 901 | MutantRunner<R, Tuple1<A1> >* t = |
| 902 | new MutantFunction<R, R (*)(X1, A1), |
| 903 | Tuple1<P1>, Tuple1<A1> > |
| 904 | (function, MakeTuple(p1)); |
| 905 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 906 | } |
| 907 | |
| 908 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 909 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 910 | typename X1> |
| 911 | inline MutantFunctor<R, Tuple1<A1> > |
| 912 | CreateFunctor(T** obj, R (U::*method)(X1, A1), const P1& p1) { |
| 913 | MutantRunner<R, Tuple1<A1> >* t = |
| 914 | new MutantLateObjectBind<R, T, R (U::*)(X1, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 915 | Tuple1<P1>, Tuple1<A1> > |
| 916 | (obj, method, MakeTuple(p1)); |
| 917 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 918 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 919 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 920 | |
| 921 | #if defined (OS_WIN) |
| 922 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 923 | typename X1> |
| 924 | inline MutantFunctor<R, Tuple1<A1> > |
| 925 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1), const P1& p1) { |
| 926 | MutantRunner<R, Tuple1<A1> >* t = |
| 927 | new Mutant<R, T, R (__stdcall U::*)(X1, A1), |
| 928 | Tuple1<P1>, Tuple1<A1> > |
| 929 | (obj, method, MakeTuple(p1)); |
| 930 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 931 | } |
| 932 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 933 | |
| 934 | // 1 - 2 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 935 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 936 | typename A2, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 937 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 938 | CreateFunctor(T* obj, R (U::*method)(X1, A1, A2), const P1& p1) { |
| 939 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 940 | new Mutant<R, T, R (U::*)(X1, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 941 | Tuple1<P1>, Tuple2<A1, A2> > |
| 942 | (obj, method, MakeTuple(p1)); |
| 943 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 944 | } |
| 945 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 946 | template <typename R, typename P1, typename A1, typename A2, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 947 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 948 | CreateFunctor(R (*function)(X1, A1, A2), const P1& p1) { |
| 949 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 950 | new MutantFunction<R, R (*)(X1, A1, A2), |
| 951 | Tuple1<P1>, Tuple2<A1, A2> > |
| 952 | (function, MakeTuple(p1)); |
| 953 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 954 | } |
| 955 | |
| 956 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 957 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 958 | typename A2, typename X1> |
| 959 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 960 | CreateFunctor(T** obj, R (U::*method)(X1, A1, A2), const P1& p1) { |
| 961 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 962 | new MutantLateObjectBind<R, T, R (U::*)(X1, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 963 | Tuple1<P1>, Tuple2<A1, A2> > |
| 964 | (obj, method, MakeTuple(p1)); |
| 965 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 966 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 967 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 968 | |
| 969 | #if defined (OS_WIN) |
| 970 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 971 | typename A2, typename X1> |
| 972 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 973 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2), const P1& p1) { |
| 974 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 975 | new Mutant<R, T, R (__stdcall U::*)(X1, A1, A2), |
| 976 | Tuple1<P1>, Tuple2<A1, A2> > |
| 977 | (obj, method, MakeTuple(p1)); |
| 978 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 979 | } |
| 980 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 981 | |
| 982 | // 1 - 3 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 983 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 984 | typename A2, typename A3, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 985 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 986 | CreateFunctor(T* obj, R (U::*method)(X1, A1, A2, A3), const P1& p1) { |
| 987 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 988 | new Mutant<R, T, R (U::*)(X1, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 989 | Tuple1<P1>, Tuple3<A1, A2, A3> > |
| 990 | (obj, method, MakeTuple(p1)); |
| 991 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 992 | } |
| 993 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 994 | template <typename R, typename P1, typename A1, typename A2, typename A3, |
| 995 | typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 996 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 997 | CreateFunctor(R (*function)(X1, A1, A2, A3), const P1& p1) { |
| 998 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 999 | new MutantFunction<R, R (*)(X1, A1, A2, A3), |
| 1000 | Tuple1<P1>, Tuple3<A1, A2, A3> > |
| 1001 | (function, MakeTuple(p1)); |
| 1002 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1003 | } |
| 1004 | |
| 1005 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1006 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 1007 | typename A2, typename A3, typename X1> |
| 1008 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1009 | CreateFunctor(T** obj, R (U::*method)(X1, A1, A2, A3), const P1& p1) { |
| 1010 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1011 | new MutantLateObjectBind<R, T, R (U::*)(X1, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1012 | Tuple1<P1>, Tuple3<A1, A2, A3> > |
| 1013 | (obj, method, MakeTuple(p1)); |
| 1014 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1015 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1016 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1017 | |
| 1018 | #if defined (OS_WIN) |
| 1019 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 1020 | typename A2, typename A3, typename X1> |
| 1021 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1022 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2, A3), const P1& p1) { |
| 1023 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1024 | new Mutant<R, T, R (__stdcall U::*)(X1, A1, A2, A3), |
| 1025 | Tuple1<P1>, Tuple3<A1, A2, A3> > |
| 1026 | (obj, method, MakeTuple(p1)); |
| 1027 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1028 | } |
| 1029 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1030 | |
| 1031 | // 1 - 4 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1032 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 1033 | typename A2, typename A3, typename A4, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1034 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1035 | CreateFunctor(T* obj, R (U::*method)(X1, A1, A2, A3, A4), const P1& p1) { |
| 1036 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1037 | new Mutant<R, T, R (U::*)(X1, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1038 | Tuple1<P1>, Tuple4<A1, A2, A3, A4> > |
| 1039 | (obj, method, MakeTuple(p1)); |
| 1040 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1041 | } |
| 1042 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1043 | template <typename R, typename P1, typename A1, typename A2, typename A3, |
| 1044 | typename A4, typename X1> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1045 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1046 | CreateFunctor(R (*function)(X1, A1, A2, A3, A4), const P1& p1) { |
| 1047 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1048 | new MutantFunction<R, R (*)(X1, A1, A2, A3, A4), |
| 1049 | Tuple1<P1>, Tuple4<A1, A2, A3, A4> > |
| 1050 | (function, MakeTuple(p1)); |
| 1051 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1052 | } |
| 1053 | |
| 1054 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1055 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 1056 | typename A2, typename A3, typename A4, typename X1> |
| 1057 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1058 | CreateFunctor(T** obj, R (U::*method)(X1, A1, A2, A3, A4), const P1& p1) { |
| 1059 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1060 | new MutantLateObjectBind<R, T, R (U::*)(X1, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1061 | Tuple1<P1>, Tuple4<A1, A2, A3, A4> > |
| 1062 | (obj, method, MakeTuple(p1)); |
| 1063 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1064 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1065 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1066 | |
| 1067 | #if defined (OS_WIN) |
| 1068 | template <typename R, typename T, typename U, typename P1, typename A1, |
| 1069 | typename A2, typename A3, typename A4, typename X1> |
| 1070 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1071 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2, A3, A4), |
| 1072 | const P1& p1) { |
| 1073 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1074 | new Mutant<R, T, R (__stdcall U::*)(X1, A1, A2, A3, A4), |
| 1075 | Tuple1<P1>, Tuple4<A1, A2, A3, A4> > |
| 1076 | (obj, method, MakeTuple(p1)); |
| 1077 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1078 | } |
| 1079 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1080 | |
| 1081 | // 2 - 0 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1082 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1083 | typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1084 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1085 | CreateFunctor(T* obj, R (U::*method)(X1, X2), const P1& p1, const P2& p2) { |
| 1086 | MutantRunner<R, Tuple0>* t = |
| 1087 | new Mutant<R, T, R (U::*)(X1, X2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1088 | Tuple2<P1, P2>, Tuple0> |
| 1089 | (obj, method, MakeTuple(p1, p2)); |
| 1090 | return MutantFunctor<R, Tuple0>(t); |
| 1091 | } |
| 1092 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1093 | template <typename R, typename P1, typename P2, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1094 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1095 | CreateFunctor(R (*function)(X1, X2), const P1& p1, const P2& p2) { |
| 1096 | MutantRunner<R, Tuple0>* t = |
| 1097 | new MutantFunction<R, R (*)(X1, X2), |
| 1098 | Tuple2<P1, P2>, Tuple0> |
| 1099 | (function, MakeTuple(p1, p2)); |
| 1100 | return MutantFunctor<R, Tuple0>(t); |
| 1101 | } |
| 1102 | |
| 1103 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1104 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1105 | typename X1, typename X2> |
| 1106 | inline MutantFunctor<R, Tuple0> |
| 1107 | CreateFunctor(T** obj, R (U::*method)(X1, X2), const P1& p1, const P2& p2) { |
| 1108 | MutantRunner<R, Tuple0>* t = |
| 1109 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1110 | Tuple2<P1, P2>, Tuple0> |
| 1111 | (obj, method, MakeTuple(p1, p2)); |
| 1112 | return MutantFunctor<R, Tuple0>(t); |
| 1113 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1114 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1115 | |
| 1116 | #if defined (OS_WIN) |
| 1117 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1118 | typename X1, typename X2> |
| 1119 | inline MutantFunctor<R, Tuple0> |
| 1120 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2), const P1& p1, |
| 1121 | const P2& p2) { |
| 1122 | MutantRunner<R, Tuple0>* t = |
| 1123 | new Mutant<R, T, R (__stdcall U::*)(X1, X2), |
| 1124 | Tuple2<P1, P2>, Tuple0> |
| 1125 | (obj, method, MakeTuple(p1, p2)); |
| 1126 | return MutantFunctor<R, Tuple0>(t); |
| 1127 | } |
| 1128 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1129 | |
| 1130 | // 2 - 1 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1131 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1132 | typename A1, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1133 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1134 | CreateFunctor(T* obj, R (U::*method)(X1, X2, A1), const P1& p1, const P2& p2) { |
| 1135 | MutantRunner<R, Tuple1<A1> >* t = |
| 1136 | new Mutant<R, T, R (U::*)(X1, X2, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1137 | Tuple2<P1, P2>, Tuple1<A1> > |
| 1138 | (obj, method, MakeTuple(p1, p2)); |
| 1139 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1140 | } |
| 1141 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1142 | template <typename R, typename P1, typename P2, typename A1, typename X1, |
| 1143 | typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1144 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1145 | CreateFunctor(R (*function)(X1, X2, A1), const P1& p1, const P2& p2) { |
| 1146 | MutantRunner<R, Tuple1<A1> >* t = |
| 1147 | new MutantFunction<R, R (*)(X1, X2, A1), |
| 1148 | Tuple2<P1, P2>, Tuple1<A1> > |
| 1149 | (function, MakeTuple(p1, p2)); |
| 1150 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1151 | } |
| 1152 | |
| 1153 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1154 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1155 | typename A1, typename X1, typename X2> |
| 1156 | inline MutantFunctor<R, Tuple1<A1> > |
| 1157 | CreateFunctor(T** obj, R (U::*method)(X1, X2, A1), const P1& p1, const P2& p2) { |
| 1158 | MutantRunner<R, Tuple1<A1> >* t = |
| 1159 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1160 | Tuple2<P1, P2>, Tuple1<A1> > |
| 1161 | (obj, method, MakeTuple(p1, p2)); |
| 1162 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1163 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1164 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1165 | |
| 1166 | #if defined (OS_WIN) |
| 1167 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1168 | typename A1, typename X1, typename X2> |
| 1169 | inline MutantFunctor<R, Tuple1<A1> > |
| 1170 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1), const P1& p1, |
| 1171 | const P2& p2) { |
| 1172 | MutantRunner<R, Tuple1<A1> >* t = |
| 1173 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, A1), |
| 1174 | Tuple2<P1, P2>, Tuple1<A1> > |
| 1175 | (obj, method, MakeTuple(p1, p2)); |
| 1176 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1177 | } |
| 1178 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1179 | |
| 1180 | // 2 - 2 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1181 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1182 | typename A1, typename A2, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1183 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1184 | CreateFunctor(T* obj, R (U::*method)(X1, X2, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1185 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1186 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1187 | new Mutant<R, T, R (U::*)(X1, X2, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1188 | Tuple2<P1, P2>, Tuple2<A1, A2> > |
| 1189 | (obj, method, MakeTuple(p1, p2)); |
| 1190 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1191 | } |
| 1192 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1193 | template <typename R, typename P1, typename P2, typename A1, typename A2, |
| 1194 | typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1195 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1196 | CreateFunctor(R (*function)(X1, X2, A1, A2), const P1& p1, const P2& p2) { |
| 1197 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1198 | new MutantFunction<R, R (*)(X1, X2, A1, A2), |
| 1199 | Tuple2<P1, P2>, Tuple2<A1, A2> > |
| 1200 | (function, MakeTuple(p1, p2)); |
| 1201 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1202 | } |
| 1203 | |
| 1204 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1205 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1206 | typename A1, typename A2, typename X1, typename X2> |
| 1207 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1208 | CreateFunctor(T** obj, R (U::*method)(X1, X2, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1209 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1210 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1211 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1212 | Tuple2<P1, P2>, Tuple2<A1, A2> > |
| 1213 | (obj, method, MakeTuple(p1, p2)); |
| 1214 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1215 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1216 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1217 | |
| 1218 | #if defined (OS_WIN) |
| 1219 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1220 | typename A1, typename A2, typename X1, typename X2> |
| 1221 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1222 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2), const P1& p1, |
| 1223 | const P2& p2) { |
| 1224 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1225 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, A1, A2), |
| 1226 | Tuple2<P1, P2>, Tuple2<A1, A2> > |
| 1227 | (obj, method, MakeTuple(p1, p2)); |
| 1228 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1229 | } |
| 1230 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1231 | |
| 1232 | // 2 - 3 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1233 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1234 | typename A1, typename A2, typename A3, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1235 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1236 | CreateFunctor(T* obj, R (U::*method)(X1, X2, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1237 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1238 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1239 | new Mutant<R, T, R (U::*)(X1, X2, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1240 | Tuple2<P1, P2>, Tuple3<A1, A2, A3> > |
| 1241 | (obj, method, MakeTuple(p1, p2)); |
| 1242 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1243 | } |
| 1244 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1245 | template <typename R, typename P1, typename P2, typename A1, typename A2, |
| 1246 | typename A3, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1247 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1248 | CreateFunctor(R (*function)(X1, X2, A1, A2, A3), const P1& p1, const P2& p2) { |
| 1249 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1250 | new MutantFunction<R, R (*)(X1, X2, A1, A2, A3), |
| 1251 | Tuple2<P1, P2>, Tuple3<A1, A2, A3> > |
| 1252 | (function, MakeTuple(p1, p2)); |
| 1253 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1254 | } |
| 1255 | |
| 1256 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1257 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1258 | typename A1, typename A2, typename A3, typename X1, typename X2> |
| 1259 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1260 | CreateFunctor(T** obj, R (U::*method)(X1, X2, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1261 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1262 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1263 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1264 | Tuple2<P1, P2>, Tuple3<A1, A2, A3> > |
| 1265 | (obj, method, MakeTuple(p1, p2)); |
| 1266 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1267 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1268 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1269 | |
| 1270 | #if defined (OS_WIN) |
| 1271 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1272 | typename A1, typename A2, typename A3, typename X1, typename X2> |
| 1273 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1274 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3), |
| 1275 | const P1& p1, const P2& p2) { |
| 1276 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1277 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, A1, A2, A3), |
| 1278 | Tuple2<P1, P2>, Tuple3<A1, A2, A3> > |
| 1279 | (obj, method, MakeTuple(p1, p2)); |
| 1280 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1281 | } |
| 1282 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1283 | |
| 1284 | // 2 - 4 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1285 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1286 | typename A1, typename A2, typename A3, typename A4, typename X1, |
| 1287 | typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1288 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1289 | CreateFunctor(T* obj, R (U::*method)(X1, X2, A1, A2, A3, A4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1290 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1291 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1292 | new Mutant<R, T, R (U::*)(X1, X2, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1293 | Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> > |
| 1294 | (obj, method, MakeTuple(p1, p2)); |
| 1295 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1296 | } |
| 1297 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1298 | template <typename R, typename P1, typename P2, typename A1, typename A2, |
| 1299 | typename A3, typename A4, typename X1, typename X2> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1300 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1301 | CreateFunctor(R (*function)(X1, X2, A1, A2, A3, A4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1302 | const P2& p2) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1303 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1304 | new MutantFunction<R, R (*)(X1, X2, A1, A2, A3, A4), |
| 1305 | Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> > |
| 1306 | (function, MakeTuple(p1, p2)); |
| 1307 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1308 | } |
| 1309 | |
| 1310 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1311 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1312 | typename A1, typename A2, typename A3, typename A4, typename X1, |
| 1313 | typename X2> |
| 1314 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1315 | CreateFunctor(T** obj, R (U::*method)(X1, X2, A1, A2, A3, A4), const P1& p1, |
| 1316 | const P2& p2) { |
| 1317 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1318 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1319 | Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> > |
| 1320 | (obj, method, MakeTuple(p1, p2)); |
| 1321 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1322 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1323 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1324 | |
| 1325 | #if defined (OS_WIN) |
| 1326 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1327 | typename A1, typename A2, typename A3, typename A4, typename X1, |
| 1328 | typename X2> |
| 1329 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1330 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3, A4), |
| 1331 | const P1& p1, const P2& p2) { |
| 1332 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1333 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, A1, A2, A3, A4), |
| 1334 | Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> > |
| 1335 | (obj, method, MakeTuple(p1, p2)); |
| 1336 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1337 | } |
| 1338 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1339 | |
| 1340 | // 3 - 0 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1341 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1342 | typename P3, typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1343 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1344 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3), const P1& p1, const P2& p2, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1345 | const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1346 | MutantRunner<R, Tuple0>* t = |
| 1347 | new Mutant<R, T, R (U::*)(X1, X2, X3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1348 | Tuple3<P1, P2, P3>, Tuple0> |
| 1349 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1350 | return MutantFunctor<R, Tuple0>(t); |
| 1351 | } |
| 1352 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1353 | template <typename R, typename P1, typename P2, typename P3, typename X1, |
| 1354 | typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1355 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1356 | CreateFunctor(R (*function)(X1, X2, X3), const P1& p1, const P2& p2, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1357 | const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1358 | MutantRunner<R, Tuple0>* t = |
| 1359 | new MutantFunction<R, R (*)(X1, X2, X3), |
| 1360 | Tuple3<P1, P2, P3>, Tuple0> |
| 1361 | (function, MakeTuple(p1, p2, p3)); |
| 1362 | return MutantFunctor<R, Tuple0>(t); |
| 1363 | } |
| 1364 | |
| 1365 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1366 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1367 | typename P3, typename X1, typename X2, typename X3> |
| 1368 | inline MutantFunctor<R, Tuple0> |
| 1369 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3), const P1& p1, const P2& p2, |
| 1370 | const P3& p3) { |
| 1371 | MutantRunner<R, Tuple0>* t = |
| 1372 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1373 | Tuple3<P1, P2, P3>, Tuple0> |
| 1374 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1375 | return MutantFunctor<R, Tuple0>(t); |
| 1376 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1377 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1378 | |
| 1379 | #if defined (OS_WIN) |
| 1380 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1381 | typename P3, typename X1, typename X2, typename X3> |
| 1382 | inline MutantFunctor<R, Tuple0> |
| 1383 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3), const P1& p1, |
| 1384 | const P2& p2, const P3& p3) { |
| 1385 | MutantRunner<R, Tuple0>* t = |
| 1386 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3), |
| 1387 | Tuple3<P1, P2, P3>, Tuple0> |
| 1388 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1389 | return MutantFunctor<R, Tuple0>(t); |
| 1390 | } |
| 1391 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1392 | |
| 1393 | // 3 - 1 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1394 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1395 | typename P3, typename A1, typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1396 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1397 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, A1), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1398 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1399 | MutantRunner<R, Tuple1<A1> >* t = |
| 1400 | new Mutant<R, T, R (U::*)(X1, X2, X3, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1401 | Tuple3<P1, P2, P3>, Tuple1<A1> > |
| 1402 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1403 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1404 | } |
| 1405 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1406 | template <typename R, typename P1, typename P2, typename P3, typename A1, |
| 1407 | typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1408 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1409 | CreateFunctor(R (*function)(X1, X2, X3, A1), const P1& p1, const P2& p2, |
| 1410 | const P3& p3) { |
| 1411 | MutantRunner<R, Tuple1<A1> >* t = |
| 1412 | new MutantFunction<R, R (*)(X1, X2, X3, A1), |
| 1413 | Tuple3<P1, P2, P3>, Tuple1<A1> > |
| 1414 | (function, MakeTuple(p1, p2, p3)); |
| 1415 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1416 | } |
| 1417 | |
| 1418 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1419 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1420 | typename P3, typename A1, typename X1, typename X2, typename X3> |
| 1421 | inline MutantFunctor<R, Tuple1<A1> > |
| 1422 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, A1), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1423 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1424 | MutantRunner<R, Tuple1<A1> >* t = |
| 1425 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1426 | Tuple3<P1, P2, P3>, Tuple1<A1> > |
| 1427 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1428 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1429 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1430 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1431 | |
| 1432 | #if defined (OS_WIN) |
| 1433 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1434 | typename P3, typename A1, typename X1, typename X2, typename X3> |
| 1435 | inline MutantFunctor<R, Tuple1<A1> > |
| 1436 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1), const P1& p1, |
| 1437 | const P2& p2, const P3& p3) { |
| 1438 | MutantRunner<R, Tuple1<A1> >* t = |
| 1439 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, A1), |
| 1440 | Tuple3<P1, P2, P3>, Tuple1<A1> > |
| 1441 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1442 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1443 | } |
| 1444 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1445 | |
| 1446 | // 3 - 2 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1447 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1448 | typename P3, typename A1, typename A2, typename X1, typename X2, |
| 1449 | typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1450 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1451 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1452 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1453 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1454 | new Mutant<R, T, R (U::*)(X1, X2, X3, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1455 | Tuple3<P1, P2, P3>, Tuple2<A1, A2> > |
| 1456 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1457 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1458 | } |
| 1459 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1460 | template <typename R, typename P1, typename P2, typename P3, typename A1, |
| 1461 | typename A2, typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1462 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1463 | CreateFunctor(R (*function)(X1, X2, X3, A1, A2), const P1& p1, const P2& p2, |
| 1464 | const P3& p3) { |
| 1465 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1466 | new MutantFunction<R, R (*)(X1, X2, X3, A1, A2), |
| 1467 | Tuple3<P1, P2, P3>, Tuple2<A1, A2> > |
| 1468 | (function, MakeTuple(p1, p2, p3)); |
| 1469 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1470 | } |
| 1471 | |
| 1472 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1473 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1474 | typename P3, typename A1, typename A2, typename X1, typename X2, |
| 1475 | typename X3> |
| 1476 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1477 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1478 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1479 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1480 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1481 | Tuple3<P1, P2, P3>, Tuple2<A1, A2> > |
| 1482 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1483 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1484 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1485 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1486 | |
| 1487 | #if defined (OS_WIN) |
| 1488 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1489 | typename P3, typename A1, typename A2, typename X1, typename X2, |
| 1490 | typename X3> |
| 1491 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1492 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2), |
| 1493 | const P1& p1, const P2& p2, const P3& p3) { |
| 1494 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1495 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, A1, A2), |
| 1496 | Tuple3<P1, P2, P3>, Tuple2<A1, A2> > |
| 1497 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1498 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1499 | } |
| 1500 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1501 | |
| 1502 | // 3 - 3 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1503 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1504 | typename P3, typename A1, typename A2, typename A3, typename X1, |
| 1505 | typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1506 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1507 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1508 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1509 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1510 | new Mutant<R, T, R (U::*)(X1, X2, X3, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1511 | Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> > |
| 1512 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1513 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1514 | } |
| 1515 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1516 | template <typename R, typename P1, typename P2, typename P3, typename A1, |
| 1517 | typename A2, typename A3, typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1518 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1519 | CreateFunctor(R (*function)(X1, X2, X3, A1, A2, A3), const P1& p1, const P2& p2, |
| 1520 | const P3& p3) { |
| 1521 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1522 | new MutantFunction<R, R (*)(X1, X2, X3, A1, A2, A3), |
| 1523 | Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> > |
| 1524 | (function, MakeTuple(p1, p2, p3)); |
| 1525 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1526 | } |
| 1527 | |
| 1528 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1529 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1530 | typename P3, typename A1, typename A2, typename A3, typename X1, |
| 1531 | typename X2, typename X3> |
| 1532 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1533 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1534 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1535 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1536 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1537 | Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> > |
| 1538 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1539 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1540 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1541 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1542 | |
| 1543 | #if defined (OS_WIN) |
| 1544 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1545 | typename P3, typename A1, typename A2, typename A3, typename X1, |
| 1546 | typename X2, typename X3> |
| 1547 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1548 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3), |
| 1549 | const P1& p1, const P2& p2, const P3& p3) { |
| 1550 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1551 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, A1, A2, A3), |
| 1552 | Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> > |
| 1553 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1554 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1555 | } |
| 1556 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1557 | |
| 1558 | // 3 - 4 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1559 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1560 | typename P3, typename A1, typename A2, typename A3, typename A4, |
| 1561 | typename X1, typename X2, typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1562 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1563 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, A1, A2, A3, A4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1564 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1565 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1566 | new Mutant<R, T, R (U::*)(X1, X2, X3, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1567 | Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> > |
| 1568 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1569 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1570 | } |
| 1571 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1572 | template <typename R, typename P1, typename P2, typename P3, typename A1, |
| 1573 | typename A2, typename A3, typename A4, typename X1, typename X2, |
| 1574 | typename X3> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1575 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1576 | CreateFunctor(R (*function)(X1, X2, X3, A1, A2, A3, A4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1577 | const P2& p2, const P3& p3) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1578 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1579 | new MutantFunction<R, R (*)(X1, X2, X3, A1, A2, A3, A4), |
| 1580 | Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> > |
| 1581 | (function, MakeTuple(p1, p2, p3)); |
| 1582 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1583 | } |
| 1584 | |
| 1585 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1586 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1587 | typename P3, typename A1, typename A2, typename A3, typename A4, |
| 1588 | typename X1, typename X2, typename X3> |
| 1589 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1590 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, A1, A2, A3, A4), const P1& p1, |
| 1591 | const P2& p2, const P3& p3) { |
| 1592 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1593 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1594 | Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> > |
| 1595 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1596 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1597 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1598 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1599 | |
| 1600 | #if defined (OS_WIN) |
| 1601 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1602 | typename P3, typename A1, typename A2, typename A3, typename A4, |
| 1603 | typename X1, typename X2, typename X3> |
| 1604 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1605 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3, A4), |
| 1606 | const P1& p1, const P2& p2, const P3& p3) { |
| 1607 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1608 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, A1, A2, A3, A4), |
| 1609 | Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> > |
| 1610 | (obj, method, MakeTuple(p1, p2, p3)); |
| 1611 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1612 | } |
| 1613 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1614 | |
| 1615 | // 4 - 0 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1616 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1617 | typename P3, typename P4, typename X1, typename X2, typename X3, |
| 1618 | typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1619 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1620 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, X4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1621 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1622 | MutantRunner<R, Tuple0>* t = |
| 1623 | new Mutant<R, T, R (U::*)(X1, X2, X3, X4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1624 | Tuple4<P1, P2, P3, P4>, Tuple0> |
| 1625 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1626 | return MutantFunctor<R, Tuple0>(t); |
| 1627 | } |
| 1628 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1629 | template <typename R, typename P1, typename P2, typename P3, typename P4, |
| 1630 | typename X1, typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1631 | inline MutantFunctor<R, Tuple0> |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1632 | CreateFunctor(R (*function)(X1, X2, X3, X4), const P1& p1, const P2& p2, |
| 1633 | const P3& p3, const P4& p4) { |
| 1634 | MutantRunner<R, Tuple0>* t = |
| 1635 | new MutantFunction<R, R (*)(X1, X2, X3, X4), |
| 1636 | Tuple4<P1, P2, P3, P4>, Tuple0> |
| 1637 | (function, MakeTuple(p1, p2, p3, p4)); |
| 1638 | return MutantFunctor<R, Tuple0>(t); |
| 1639 | } |
| 1640 | |
| 1641 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1642 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1643 | typename P3, typename P4, typename X1, typename X2, typename X3, |
| 1644 | typename X4> |
| 1645 | inline MutantFunctor<R, Tuple0> |
| 1646 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, X4), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1647 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1648 | MutantRunner<R, Tuple0>* t = |
| 1649 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, X4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1650 | Tuple4<P1, P2, P3, P4>, Tuple0> |
| 1651 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1652 | return MutantFunctor<R, Tuple0>(t); |
| 1653 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1654 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1655 | |
| 1656 | #if defined (OS_WIN) |
| 1657 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1658 | typename P3, typename P4, typename X1, typename X2, typename X3, |
| 1659 | typename X4> |
| 1660 | inline MutantFunctor<R, Tuple0> |
| 1661 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4), const P1& p1, |
| 1662 | const P2& p2, const P3& p3, const P4& p4) { |
| 1663 | MutantRunner<R, Tuple0>* t = |
| 1664 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, X4), |
| 1665 | Tuple4<P1, P2, P3, P4>, Tuple0> |
| 1666 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1667 | return MutantFunctor<R, Tuple0>(t); |
| 1668 | } |
| 1669 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1670 | |
| 1671 | // 4 - 1 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1672 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1673 | typename P3, typename P4, typename A1, typename X1, typename X2, |
| 1674 | typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1675 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1676 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, X4, A1), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1677 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1678 | MutantRunner<R, Tuple1<A1> >* t = |
| 1679 | new Mutant<R, T, R (U::*)(X1, X2, X3, X4, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1680 | Tuple4<P1, P2, P3, P4>, Tuple1<A1> > |
| 1681 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1682 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1683 | } |
| 1684 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1685 | template <typename R, typename P1, typename P2, typename P3, typename P4, |
| 1686 | typename A1, typename X1, typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1687 | inline MutantFunctor<R, Tuple1<A1> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1688 | CreateFunctor(R (*function)(X1, X2, X3, X4, A1), const P1& p1, const P2& p2, |
| 1689 | const P3& p3, const P4& p4) { |
| 1690 | MutantRunner<R, Tuple1<A1> >* t = |
| 1691 | new MutantFunction<R, R (*)(X1, X2, X3, X4, A1), |
| 1692 | Tuple4<P1, P2, P3, P4>, Tuple1<A1> > |
| 1693 | (function, MakeTuple(p1, p2, p3, p4)); |
| 1694 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1695 | } |
| 1696 | |
| 1697 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1698 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1699 | typename P3, typename P4, typename A1, typename X1, typename X2, |
| 1700 | typename X3, typename X4> |
| 1701 | inline MutantFunctor<R, Tuple1<A1> > |
| 1702 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, X4, A1), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1703 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1704 | MutantRunner<R, Tuple1<A1> >* t = |
| 1705 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, X4, A1), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1706 | Tuple4<P1, P2, P3, P4>, Tuple1<A1> > |
| 1707 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1708 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1709 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1710 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1711 | |
| 1712 | #if defined (OS_WIN) |
| 1713 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1714 | typename P3, typename P4, typename A1, typename X1, typename X2, |
| 1715 | typename X3, typename X4> |
| 1716 | inline MutantFunctor<R, Tuple1<A1> > |
| 1717 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1), |
| 1718 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
| 1719 | MutantRunner<R, Tuple1<A1> >* t = |
| 1720 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, X4, A1), |
| 1721 | Tuple4<P1, P2, P3, P4>, Tuple1<A1> > |
| 1722 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1723 | return MutantFunctor<R, Tuple1<A1> >(t); |
| 1724 | } |
| 1725 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1726 | |
| 1727 | // 4 - 2 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1728 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1729 | typename P3, typename P4, typename A1, typename A2, typename X1, |
| 1730 | typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1731 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1732 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, X4, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1733 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1734 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1735 | new Mutant<R, T, R (U::*)(X1, X2, X3, X4, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1736 | Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> > |
| 1737 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1738 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1739 | } |
| 1740 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1741 | template <typename R, typename P1, typename P2, typename P3, typename P4, |
| 1742 | typename A1, typename A2, typename X1, typename X2, typename X3, |
| 1743 | typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1744 | inline MutantFunctor<R, Tuple2<A1, A2> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1745 | CreateFunctor(R (*function)(X1, X2, X3, X4, A1, A2), const P1& p1, const P2& p2, |
| 1746 | const P3& p3, const P4& p4) { |
| 1747 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1748 | new MutantFunction<R, R (*)(X1, X2, X3, X4, A1, A2), |
| 1749 | Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> > |
| 1750 | (function, MakeTuple(p1, p2, p3, p4)); |
| 1751 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1752 | } |
| 1753 | |
| 1754 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1755 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1756 | typename P3, typename P4, typename A1, typename A2, typename X1, |
| 1757 | typename X2, typename X3, typename X4> |
| 1758 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1759 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, X4, A1, A2), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1760 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1761 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1762 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, X4, A1, A2), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1763 | Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> > |
| 1764 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1765 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1766 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1767 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1768 | |
| 1769 | #if defined (OS_WIN) |
| 1770 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1771 | typename P3, typename P4, typename A1, typename A2, typename X1, |
| 1772 | typename X2, typename X3, typename X4> |
| 1773 | inline MutantFunctor<R, Tuple2<A1, A2> > |
| 1774 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2), |
| 1775 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
| 1776 | MutantRunner<R, Tuple2<A1, A2> >* t = |
| 1777 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, X4, A1, A2), |
| 1778 | Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> > |
| 1779 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1780 | return MutantFunctor<R, Tuple2<A1, A2> >(t); |
| 1781 | } |
| 1782 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1783 | |
| 1784 | // 4 - 3 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1785 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1786 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1787 | typename X1, typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1788 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1789 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, X4, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1790 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1791 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1792 | new Mutant<R, T, R (U::*)(X1, X2, X3, X4, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1793 | Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> > |
| 1794 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1795 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1796 | } |
| 1797 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1798 | template <typename R, typename P1, typename P2, typename P3, typename P4, |
| 1799 | typename A1, typename A2, typename A3, typename X1, typename X2, |
| 1800 | typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1801 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1802 | CreateFunctor(R (*function)(X1, X2, X3, X4, A1, A2, A3), const P1& p1, |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1803 | const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1804 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1805 | new MutantFunction<R, R (*)(X1, X2, X3, X4, A1, A2, A3), |
| 1806 | Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> > |
| 1807 | (function, MakeTuple(p1, p2, p3, p4)); |
| 1808 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1809 | } |
| 1810 | |
| 1811 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1812 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1813 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1814 | typename X1, typename X2, typename X3, typename X4> |
| 1815 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1816 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, X4, A1, A2, A3), const P1& p1, |
| 1817 | const P2& p2, const P3& p3, const P4& p4) { |
| 1818 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1819 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, X4, A1, A2, A3), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1820 | Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> > |
| 1821 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1822 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1823 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1824 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1825 | |
| 1826 | #if defined (OS_WIN) |
| 1827 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1828 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1829 | typename X1, typename X2, typename X3, typename X4> |
| 1830 | inline MutantFunctor<R, Tuple3<A1, A2, A3> > |
| 1831 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3), |
| 1832 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
| 1833 | MutantRunner<R, Tuple3<A1, A2, A3> >* t = |
| 1834 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, X4, A1, A2, A3), |
| 1835 | Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> > |
| 1836 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1837 | return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); |
| 1838 | } |
| 1839 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1840 | |
| 1841 | // 4 - 4 |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1842 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1843 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1844 | typename A4, typename X1, typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1845 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1846 | CreateFunctor(T* obj, R (U::*method)(X1, X2, X3, X4, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1847 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1848 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1849 | new Mutant<R, T, R (U::*)(X1, X2, X3, X4, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1850 | Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> > |
| 1851 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1852 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1853 | } |
| 1854 | |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1855 | template <typename R, typename P1, typename P2, typename P3, typename P4, |
| 1856 | typename A1, typename A2, typename A3, typename A4, typename X1, |
| 1857 | typename X2, typename X3, typename X4> |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1858 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1859 | CreateFunctor(R (*function)(X1, X2, X3, X4, A1, A2, A3, A4), const P1& p1, |
| 1860 | const P2& p2, const P3& p3, const P4& p4) { |
| 1861 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1862 | new MutantFunction<R, R (*)(X1, X2, X3, X4, A1, A2, A3, A4), |
| 1863 | Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> > |
| 1864 | (function, MakeTuple(p1, p2, p3, p4)); |
| 1865 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1866 | } |
| 1867 | |
| 1868 | #ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1869 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1870 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1871 | typename A4, typename X1, typename X2, typename X3, typename X4> |
| 1872 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1873 | CreateFunctor(T** obj, R (U::*method)(X1, X2, X3, X4, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1874 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1875 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1876 | new MutantLateObjectBind<R, T, R (U::*)(X1, X2, X3, X4, A1, A2, A3, A4), |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1877 | Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> > |
| 1878 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1879 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1880 | } |
stoyan@chromium.org | 81758fe | 2009-11-13 08:10:11 +0900 | [diff] [blame^] | 1881 | #endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 1882 | |
| 1883 | #if defined (OS_WIN) |
| 1884 | template <typename R, typename T, typename U, typename P1, typename P2, |
| 1885 | typename P3, typename P4, typename A1, typename A2, typename A3, |
| 1886 | typename A4, typename X1, typename X2, typename X3, typename X4> |
| 1887 | inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > |
| 1888 | CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3, A4), |
| 1889 | const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
| 1890 | MutantRunner<R, Tuple4<A1, A2, A3, A4> >* t = |
| 1891 | new Mutant<R, T, R (__stdcall U::*)(X1, X2, X3, X4, A1, A2, A3, A4), |
| 1892 | Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> > |
| 1893 | (obj, method, MakeTuple(p1, p2, p3, p4)); |
| 1894 | return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); |
| 1895 | } |
| 1896 | #endif // OS_WIN |
stoyan@google.com | ce161d8 | 2009-10-27 09:05:00 +0900 | [diff] [blame] | 1897 | |
| 1898 | } // namespace testing |
| 1899 | |
| 1900 | #endif // TESTING_GMOCK_MUTANT_H_ |