OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py bind_internal.h.pump | 2 // pump.py bind_internal.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 | 5 |
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
7 // Use of this source code is governed by a BSD-style license that can be | 7 // Use of this source code is governed by a BSD-style license that can be |
8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
9 | 9 |
10 #ifndef BASE_BIND_INTERNAL_H_ | 10 #ifndef BASE_BIND_INTERNAL_H_ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // and for ignoring return values. This is separate from | 69 // and for ignoring return values. This is separate from |
70 // Invoker to avoid creating multiple version of Invoker<> | 70 // Invoker to avoid creating multiple version of Invoker<> |
71 // which grows at O(n^2) with the arity. | 71 // which grows at O(n^2) with the arity. |
72 // There are |k*ARITY| InvokeHelper types. | 72 // There are |k*ARITY| InvokeHelper types. |
73 // Invoker<> -- Unwraps the curried parameters and executes the Runnable. | 73 // Invoker<> -- Unwraps the curried parameters and executes the Runnable. |
74 // There are |(ARITY^2 + ARITY)/2| Invoketypes. | 74 // There are |(ARITY^2 + ARITY)/2| Invoketypes. |
75 // BindState<> -- Stores the curried parameters, and is the main entry point | 75 // BindState<> -- Stores the curried parameters, and is the main entry point |
76 // into the Bind() system, doing most of the type resolution. | 76 // into the Bind() system, doing most of the type resolution. |
77 // There are ARITY BindState types. | 77 // There are ARITY BindState types. |
78 | 78 |
79 | |
80 // RunnableAdapter<> | 79 // RunnableAdapter<> |
81 // | 80 // |
82 // The RunnableAdapter<> templates provide a uniform interface for invoking | 81 // The RunnableAdapter<> templates provide a uniform interface for invoking |
83 // a function pointer, method pointer, or const method pointer. The adapter | 82 // a function pointer, method pointer, or const method pointer. The adapter |
84 // exposes a Run() method with an appropriate signature. Using this wrapper | 83 // exposes a Run() method with an appropriate signature. Using this wrapper |
85 // allows for writing code that supports all three pointer types without | 84 // allows for writing code that supports all three pointer types without |
86 // undue repetition. Without it, a lot of code would need to be repeated 3 | 85 // undue repetition. Without it, a lot of code would need to be repeated 3 |
87 // times. | 86 // times. |
88 // | 87 // |
89 // For method pointers and const method pointers the first argument to Run() | 88 // For method pointers and const method pointers the first argument to Run() |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 template <typename R, typename A1> | 159 template <typename R, typename A1> |
161 class RunnableAdapter<R(*)(A1)> { | 160 class RunnableAdapter<R(*)(A1)> { |
162 public: | 161 public: |
163 typedef R (RunType)(A1); | 162 typedef R (RunType)(A1); |
164 | 163 |
165 explicit RunnableAdapter(R(*function)(A1)) | 164 explicit RunnableAdapter(R(*function)(A1)) |
166 : function_(function) { | 165 : function_(function) { |
167 } | 166 } |
168 | 167 |
169 R Run(typename CallbackParamTraits<A1>::ForwardType a1) { | 168 R Run(typename CallbackParamTraits<A1>::ForwardType a1) { |
170 return function_(a1); | 169 return function_(CallbackForward(a1)); |
171 } | 170 } |
172 | 171 |
173 private: | 172 private: |
174 R (*function_)(A1); | 173 R (*function_)(A1); |
175 }; | 174 }; |
176 | 175 |
177 // Method: Arity 1. | 176 // Method: Arity 1. |
178 template <typename R, typename T, typename A1> | 177 template <typename R, typename T, typename A1> |
179 class RunnableAdapter<R(T::*)(A1)> { | 178 class RunnableAdapter<R(T::*)(A1)> { |
180 public: | 179 public: |
181 typedef R (RunType)(T*, A1); | 180 typedef R (RunType)(T*, A1); |
182 typedef true_type IsMethod; | 181 typedef true_type IsMethod; |
183 | 182 |
184 explicit RunnableAdapter(R(T::*method)(A1)) | 183 explicit RunnableAdapter(R(T::*method)(A1)) |
185 : method_(method) { | 184 : method_(method) { |
186 } | 185 } |
187 | 186 |
188 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1) { | 187 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1) { |
189 return (object->*method_)(a1); | 188 return (object->*method_)(CallbackForward(a1)); |
190 } | 189 } |
191 | 190 |
192 private: | 191 private: |
193 R (T::*method_)(A1); | 192 R (T::*method_)(A1); |
194 }; | 193 }; |
195 | 194 |
196 // Const Method: Arity 1. | 195 // Const Method: Arity 1. |
197 template <typename R, typename T, typename A1> | 196 template <typename R, typename T, typename A1> |
198 class RunnableAdapter<R(T::*)(A1) const> { | 197 class RunnableAdapter<R(T::*)(A1) const> { |
199 public: | 198 public: |
200 typedef R (RunType)(const T*, A1); | 199 typedef R (RunType)(const T*, A1); |
201 typedef true_type IsMethod; | 200 typedef true_type IsMethod; |
202 | 201 |
203 explicit RunnableAdapter(R(T::*method)(A1) const) | 202 explicit RunnableAdapter(R(T::*method)(A1) const) |
204 : method_(method) { | 203 : method_(method) { |
205 } | 204 } |
206 | 205 |
207 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1) { | 206 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1) { |
208 return (object->*method_)(a1); | 207 return (object->*method_)(CallbackForward(a1)); |
209 } | 208 } |
210 | 209 |
211 private: | 210 private: |
212 R (T::*method_)(A1) const; | 211 R (T::*method_)(A1) const; |
213 }; | 212 }; |
214 | 213 |
215 // Function: Arity 2. | 214 // Function: Arity 2. |
216 template <typename R, typename A1, typename A2> | 215 template <typename R, typename A1, typename A2> |
217 class RunnableAdapter<R(*)(A1, A2)> { | 216 class RunnableAdapter<R(*)(A1, A2)> { |
218 public: | 217 public: |
219 typedef R (RunType)(A1, A2); | 218 typedef R (RunType)(A1, A2); |
220 | 219 |
221 explicit RunnableAdapter(R(*function)(A1, A2)) | 220 explicit RunnableAdapter(R(*function)(A1, A2)) |
222 : function_(function) { | 221 : function_(function) { |
223 } | 222 } |
224 | 223 |
225 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 224 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
226 typename CallbackParamTraits<A2>::ForwardType a2) { | 225 typename CallbackParamTraits<A2>::ForwardType a2) { |
227 return function_(a1, a2); | 226 return function_(CallbackForward(a1), CallbackForward(a2)); |
228 } | 227 } |
229 | 228 |
230 private: | 229 private: |
231 R (*function_)(A1, A2); | 230 R (*function_)(A1, A2); |
232 }; | 231 }; |
233 | 232 |
234 // Method: Arity 2. | 233 // Method: Arity 2. |
235 template <typename R, typename T, typename A1, typename A2> | 234 template <typename R, typename T, typename A1, typename A2> |
236 class RunnableAdapter<R(T::*)(A1, A2)> { | 235 class RunnableAdapter<R(T::*)(A1, A2)> { |
237 public: | 236 public: |
238 typedef R (RunType)(T*, A1, A2); | 237 typedef R (RunType)(T*, A1, A2); |
239 typedef true_type IsMethod; | 238 typedef true_type IsMethod; |
240 | 239 |
241 explicit RunnableAdapter(R(T::*method)(A1, A2)) | 240 explicit RunnableAdapter(R(T::*method)(A1, A2)) |
242 : method_(method) { | 241 : method_(method) { |
243 } | 242 } |
244 | 243 |
245 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 244 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
246 typename CallbackParamTraits<A2>::ForwardType a2) { | 245 typename CallbackParamTraits<A2>::ForwardType a2) { |
247 return (object->*method_)(a1, a2); | 246 return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); |
248 } | 247 } |
249 | 248 |
250 private: | 249 private: |
251 R (T::*method_)(A1, A2); | 250 R (T::*method_)(A1, A2); |
252 }; | 251 }; |
253 | 252 |
254 // Const Method: Arity 2. | 253 // Const Method: Arity 2. |
255 template <typename R, typename T, typename A1, typename A2> | 254 template <typename R, typename T, typename A1, typename A2> |
256 class RunnableAdapter<R(T::*)(A1, A2) const> { | 255 class RunnableAdapter<R(T::*)(A1, A2) const> { |
257 public: | 256 public: |
258 typedef R (RunType)(const T*, A1, A2); | 257 typedef R (RunType)(const T*, A1, A2); |
259 typedef true_type IsMethod; | 258 typedef true_type IsMethod; |
260 | 259 |
261 explicit RunnableAdapter(R(T::*method)(A1, A2) const) | 260 explicit RunnableAdapter(R(T::*method)(A1, A2) const) |
262 : method_(method) { | 261 : method_(method) { |
263 } | 262 } |
264 | 263 |
265 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 264 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
266 typename CallbackParamTraits<A2>::ForwardType a2) { | 265 typename CallbackParamTraits<A2>::ForwardType a2) { |
267 return (object->*method_)(a1, a2); | 266 return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); |
268 } | 267 } |
269 | 268 |
270 private: | 269 private: |
271 R (T::*method_)(A1, A2) const; | 270 R (T::*method_)(A1, A2) const; |
272 }; | 271 }; |
273 | 272 |
274 // Function: Arity 3. | 273 // Function: Arity 3. |
275 template <typename R, typename A1, typename A2, typename A3> | 274 template <typename R, typename A1, typename A2, typename A3> |
276 class RunnableAdapter<R(*)(A1, A2, A3)> { | 275 class RunnableAdapter<R(*)(A1, A2, A3)> { |
277 public: | 276 public: |
278 typedef R (RunType)(A1, A2, A3); | 277 typedef R (RunType)(A1, A2, A3); |
279 | 278 |
280 explicit RunnableAdapter(R(*function)(A1, A2, A3)) | 279 explicit RunnableAdapter(R(*function)(A1, A2, A3)) |
281 : function_(function) { | 280 : function_(function) { |
282 } | 281 } |
283 | 282 |
284 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 283 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
285 typename CallbackParamTraits<A2>::ForwardType a2, | 284 typename CallbackParamTraits<A2>::ForwardType a2, |
286 typename CallbackParamTraits<A3>::ForwardType a3) { | 285 typename CallbackParamTraits<A3>::ForwardType a3) { |
287 return function_(a1, a2, a3); | 286 return function_(CallbackForward(a1), CallbackForward(a2), |
| 287 CallbackForward(a3)); |
288 } | 288 } |
289 | 289 |
290 private: | 290 private: |
291 R (*function_)(A1, A2, A3); | 291 R (*function_)(A1, A2, A3); |
292 }; | 292 }; |
293 | 293 |
294 // Method: Arity 3. | 294 // Method: Arity 3. |
295 template <typename R, typename T, typename A1, typename A2, typename A3> | 295 template <typename R, typename T, typename A1, typename A2, typename A3> |
296 class RunnableAdapter<R(T::*)(A1, A2, A3)> { | 296 class RunnableAdapter<R(T::*)(A1, A2, A3)> { |
297 public: | 297 public: |
298 typedef R (RunType)(T*, A1, A2, A3); | 298 typedef R (RunType)(T*, A1, A2, A3); |
299 typedef true_type IsMethod; | 299 typedef true_type IsMethod; |
300 | 300 |
301 explicit RunnableAdapter(R(T::*method)(A1, A2, A3)) | 301 explicit RunnableAdapter(R(T::*method)(A1, A2, A3)) |
302 : method_(method) { | 302 : method_(method) { |
303 } | 303 } |
304 | 304 |
305 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 305 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
306 typename CallbackParamTraits<A2>::ForwardType a2, | 306 typename CallbackParamTraits<A2>::ForwardType a2, |
307 typename CallbackParamTraits<A3>::ForwardType a3) { | 307 typename CallbackParamTraits<A3>::ForwardType a3) { |
308 return (object->*method_)(a1, a2, a3); | 308 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 309 CallbackForward(a3)); |
309 } | 310 } |
310 | 311 |
311 private: | 312 private: |
312 R (T::*method_)(A1, A2, A3); | 313 R (T::*method_)(A1, A2, A3); |
313 }; | 314 }; |
314 | 315 |
315 // Const Method: Arity 3. | 316 // Const Method: Arity 3. |
316 template <typename R, typename T, typename A1, typename A2, typename A3> | 317 template <typename R, typename T, typename A1, typename A2, typename A3> |
317 class RunnableAdapter<R(T::*)(A1, A2, A3) const> { | 318 class RunnableAdapter<R(T::*)(A1, A2, A3) const> { |
318 public: | 319 public: |
319 typedef R (RunType)(const T*, A1, A2, A3); | 320 typedef R (RunType)(const T*, A1, A2, A3); |
320 typedef true_type IsMethod; | 321 typedef true_type IsMethod; |
321 | 322 |
322 explicit RunnableAdapter(R(T::*method)(A1, A2, A3) const) | 323 explicit RunnableAdapter(R(T::*method)(A1, A2, A3) const) |
323 : method_(method) { | 324 : method_(method) { |
324 } | 325 } |
325 | 326 |
326 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 327 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
327 typename CallbackParamTraits<A2>::ForwardType a2, | 328 typename CallbackParamTraits<A2>::ForwardType a2, |
328 typename CallbackParamTraits<A3>::ForwardType a3) { | 329 typename CallbackParamTraits<A3>::ForwardType a3) { |
329 return (object->*method_)(a1, a2, a3); | 330 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 331 CallbackForward(a3)); |
330 } | 332 } |
331 | 333 |
332 private: | 334 private: |
333 R (T::*method_)(A1, A2, A3) const; | 335 R (T::*method_)(A1, A2, A3) const; |
334 }; | 336 }; |
335 | 337 |
336 // Function: Arity 4. | 338 // Function: Arity 4. |
337 template <typename R, typename A1, typename A2, typename A3, typename A4> | 339 template <typename R, typename A1, typename A2, typename A3, typename A4> |
338 class RunnableAdapter<R(*)(A1, A2, A3, A4)> { | 340 class RunnableAdapter<R(*)(A1, A2, A3, A4)> { |
339 public: | 341 public: |
340 typedef R (RunType)(A1, A2, A3, A4); | 342 typedef R (RunType)(A1, A2, A3, A4); |
341 | 343 |
342 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4)) | 344 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4)) |
343 : function_(function) { | 345 : function_(function) { |
344 } | 346 } |
345 | 347 |
346 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 348 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
347 typename CallbackParamTraits<A2>::ForwardType a2, | 349 typename CallbackParamTraits<A2>::ForwardType a2, |
348 typename CallbackParamTraits<A3>::ForwardType a3, | 350 typename CallbackParamTraits<A3>::ForwardType a3, |
349 typename CallbackParamTraits<A4>::ForwardType a4) { | 351 typename CallbackParamTraits<A4>::ForwardType a4) { |
350 return function_(a1, a2, a3, a4); | 352 return function_(CallbackForward(a1), CallbackForward(a2), |
| 353 CallbackForward(a3), CallbackForward(a4)); |
351 } | 354 } |
352 | 355 |
353 private: | 356 private: |
354 R (*function_)(A1, A2, A3, A4); | 357 R (*function_)(A1, A2, A3, A4); |
355 }; | 358 }; |
356 | 359 |
357 // Method: Arity 4. | 360 // Method: Arity 4. |
358 template <typename R, typename T, typename A1, typename A2, typename A3, | 361 template <typename R, typename T, typename A1, typename A2, typename A3, |
359 typename A4> | 362 typename A4> |
360 class RunnableAdapter<R(T::*)(A1, A2, A3, A4)> { | 363 class RunnableAdapter<R(T::*)(A1, A2, A3, A4)> { |
361 public: | 364 public: |
362 typedef R (RunType)(T*, A1, A2, A3, A4); | 365 typedef R (RunType)(T*, A1, A2, A3, A4); |
363 typedef true_type IsMethod; | 366 typedef true_type IsMethod; |
364 | 367 |
365 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4)) | 368 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4)) |
366 : method_(method) { | 369 : method_(method) { |
367 } | 370 } |
368 | 371 |
369 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 372 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
370 typename CallbackParamTraits<A2>::ForwardType a2, | 373 typename CallbackParamTraits<A2>::ForwardType a2, |
371 typename CallbackParamTraits<A3>::ForwardType a3, | 374 typename CallbackParamTraits<A3>::ForwardType a3, |
372 typename CallbackParamTraits<A4>::ForwardType a4) { | 375 typename CallbackParamTraits<A4>::ForwardType a4) { |
373 return (object->*method_)(a1, a2, a3, a4); | 376 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 377 CallbackForward(a3), CallbackForward(a4)); |
374 } | 378 } |
375 | 379 |
376 private: | 380 private: |
377 R (T::*method_)(A1, A2, A3, A4); | 381 R (T::*method_)(A1, A2, A3, A4); |
378 }; | 382 }; |
379 | 383 |
380 // Const Method: Arity 4. | 384 // Const Method: Arity 4. |
381 template <typename R, typename T, typename A1, typename A2, typename A3, | 385 template <typename R, typename T, typename A1, typename A2, typename A3, |
382 typename A4> | 386 typename A4> |
383 class RunnableAdapter<R(T::*)(A1, A2, A3, A4) const> { | 387 class RunnableAdapter<R(T::*)(A1, A2, A3, A4) const> { |
384 public: | 388 public: |
385 typedef R (RunType)(const T*, A1, A2, A3, A4); | 389 typedef R (RunType)(const T*, A1, A2, A3, A4); |
386 typedef true_type IsMethod; | 390 typedef true_type IsMethod; |
387 | 391 |
388 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4) const) | 392 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4) const) |
389 : method_(method) { | 393 : method_(method) { |
390 } | 394 } |
391 | 395 |
392 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 396 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
393 typename CallbackParamTraits<A2>::ForwardType a2, | 397 typename CallbackParamTraits<A2>::ForwardType a2, |
394 typename CallbackParamTraits<A3>::ForwardType a3, | 398 typename CallbackParamTraits<A3>::ForwardType a3, |
395 typename CallbackParamTraits<A4>::ForwardType a4) { | 399 typename CallbackParamTraits<A4>::ForwardType a4) { |
396 return (object->*method_)(a1, a2, a3, a4); | 400 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 401 CallbackForward(a3), CallbackForward(a4)); |
397 } | 402 } |
398 | 403 |
399 private: | 404 private: |
400 R (T::*method_)(A1, A2, A3, A4) const; | 405 R (T::*method_)(A1, A2, A3, A4) const; |
401 }; | 406 }; |
402 | 407 |
403 // Function: Arity 5. | 408 // Function: Arity 5. |
404 template <typename R, typename A1, typename A2, typename A3, typename A4, | 409 template <typename R, typename A1, typename A2, typename A3, typename A4, |
405 typename A5> | 410 typename A5> |
406 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5)> { | 411 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5)> { |
407 public: | 412 public: |
408 typedef R (RunType)(A1, A2, A3, A4, A5); | 413 typedef R (RunType)(A1, A2, A3, A4, A5); |
409 | 414 |
410 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5)) | 415 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5)) |
411 : function_(function) { | 416 : function_(function) { |
412 } | 417 } |
413 | 418 |
414 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 419 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
415 typename CallbackParamTraits<A2>::ForwardType a2, | 420 typename CallbackParamTraits<A2>::ForwardType a2, |
416 typename CallbackParamTraits<A3>::ForwardType a3, | 421 typename CallbackParamTraits<A3>::ForwardType a3, |
417 typename CallbackParamTraits<A4>::ForwardType a4, | 422 typename CallbackParamTraits<A4>::ForwardType a4, |
418 typename CallbackParamTraits<A5>::ForwardType a5) { | 423 typename CallbackParamTraits<A5>::ForwardType a5) { |
419 return function_(a1, a2, a3, a4, a5); | 424 return function_(CallbackForward(a1), CallbackForward(a2), |
| 425 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); |
420 } | 426 } |
421 | 427 |
422 private: | 428 private: |
423 R (*function_)(A1, A2, A3, A4, A5); | 429 R (*function_)(A1, A2, A3, A4, A5); |
424 }; | 430 }; |
425 | 431 |
426 // Method: Arity 5. | 432 // Method: Arity 5. |
427 template <typename R, typename T, typename A1, typename A2, typename A3, | 433 template <typename R, typename T, typename A1, typename A2, typename A3, |
428 typename A4, typename A5> | 434 typename A4, typename A5> |
429 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5)> { | 435 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5)> { |
430 public: | 436 public: |
431 typedef R (RunType)(T*, A1, A2, A3, A4, A5); | 437 typedef R (RunType)(T*, A1, A2, A3, A4, A5); |
432 typedef true_type IsMethod; | 438 typedef true_type IsMethod; |
433 | 439 |
434 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5)) | 440 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5)) |
435 : method_(method) { | 441 : method_(method) { |
436 } | 442 } |
437 | 443 |
438 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 444 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
439 typename CallbackParamTraits<A2>::ForwardType a2, | 445 typename CallbackParamTraits<A2>::ForwardType a2, |
440 typename CallbackParamTraits<A3>::ForwardType a3, | 446 typename CallbackParamTraits<A3>::ForwardType a3, |
441 typename CallbackParamTraits<A4>::ForwardType a4, | 447 typename CallbackParamTraits<A4>::ForwardType a4, |
442 typename CallbackParamTraits<A5>::ForwardType a5) { | 448 typename CallbackParamTraits<A5>::ForwardType a5) { |
443 return (object->*method_)(a1, a2, a3, a4, a5); | 449 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 450 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); |
444 } | 451 } |
445 | 452 |
446 private: | 453 private: |
447 R (T::*method_)(A1, A2, A3, A4, A5); | 454 R (T::*method_)(A1, A2, A3, A4, A5); |
448 }; | 455 }; |
449 | 456 |
450 // Const Method: Arity 5. | 457 // Const Method: Arity 5. |
451 template <typename R, typename T, typename A1, typename A2, typename A3, | 458 template <typename R, typename T, typename A1, typename A2, typename A3, |
452 typename A4, typename A5> | 459 typename A4, typename A5> |
453 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5) const> { | 460 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5) const> { |
454 public: | 461 public: |
455 typedef R (RunType)(const T*, A1, A2, A3, A4, A5); | 462 typedef R (RunType)(const T*, A1, A2, A3, A4, A5); |
456 typedef true_type IsMethod; | 463 typedef true_type IsMethod; |
457 | 464 |
458 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5) const) | 465 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5) const) |
459 : method_(method) { | 466 : method_(method) { |
460 } | 467 } |
461 | 468 |
462 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 469 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
463 typename CallbackParamTraits<A2>::ForwardType a2, | 470 typename CallbackParamTraits<A2>::ForwardType a2, |
464 typename CallbackParamTraits<A3>::ForwardType a3, | 471 typename CallbackParamTraits<A3>::ForwardType a3, |
465 typename CallbackParamTraits<A4>::ForwardType a4, | 472 typename CallbackParamTraits<A4>::ForwardType a4, |
466 typename CallbackParamTraits<A5>::ForwardType a5) { | 473 typename CallbackParamTraits<A5>::ForwardType a5) { |
467 return (object->*method_)(a1, a2, a3, a4, a5); | 474 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 475 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); |
468 } | 476 } |
469 | 477 |
470 private: | 478 private: |
471 R (T::*method_)(A1, A2, A3, A4, A5) const; | 479 R (T::*method_)(A1, A2, A3, A4, A5) const; |
472 }; | 480 }; |
473 | 481 |
474 // Function: Arity 6. | 482 // Function: Arity 6. |
475 template <typename R, typename A1, typename A2, typename A3, typename A4, | 483 template <typename R, typename A1, typename A2, typename A3, typename A4, |
476 typename A5, typename A6> | 484 typename A5, typename A6> |
477 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6)> { | 485 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6)> { |
478 public: | 486 public: |
479 typedef R (RunType)(A1, A2, A3, A4, A5, A6); | 487 typedef R (RunType)(A1, A2, A3, A4, A5, A6); |
480 | 488 |
481 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6)) | 489 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6)) |
482 : function_(function) { | 490 : function_(function) { |
483 } | 491 } |
484 | 492 |
485 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 493 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
486 typename CallbackParamTraits<A2>::ForwardType a2, | 494 typename CallbackParamTraits<A2>::ForwardType a2, |
487 typename CallbackParamTraits<A3>::ForwardType a3, | 495 typename CallbackParamTraits<A3>::ForwardType a3, |
488 typename CallbackParamTraits<A4>::ForwardType a4, | 496 typename CallbackParamTraits<A4>::ForwardType a4, |
489 typename CallbackParamTraits<A5>::ForwardType a5, | 497 typename CallbackParamTraits<A5>::ForwardType a5, |
490 typename CallbackParamTraits<A6>::ForwardType a6) { | 498 typename CallbackParamTraits<A6>::ForwardType a6) { |
491 return function_(a1, a2, a3, a4, a5, a6); | 499 return function_(CallbackForward(a1), CallbackForward(a2), |
| 500 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 501 CallbackForward(a6)); |
492 } | 502 } |
493 | 503 |
494 private: | 504 private: |
495 R (*function_)(A1, A2, A3, A4, A5, A6); | 505 R (*function_)(A1, A2, A3, A4, A5, A6); |
496 }; | 506 }; |
497 | 507 |
498 // Method: Arity 6. | 508 // Method: Arity 6. |
499 template <typename R, typename T, typename A1, typename A2, typename A3, | 509 template <typename R, typename T, typename A1, typename A2, typename A3, |
500 typename A4, typename A5, typename A6> | 510 typename A4, typename A5, typename A6> |
501 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6)> { | 511 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6)> { |
502 public: | 512 public: |
503 typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6); | 513 typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6); |
504 typedef true_type IsMethod; | 514 typedef true_type IsMethod; |
505 | 515 |
506 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6)) | 516 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6)) |
507 : method_(method) { | 517 : method_(method) { |
508 } | 518 } |
509 | 519 |
510 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 520 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
511 typename CallbackParamTraits<A2>::ForwardType a2, | 521 typename CallbackParamTraits<A2>::ForwardType a2, |
512 typename CallbackParamTraits<A3>::ForwardType a3, | 522 typename CallbackParamTraits<A3>::ForwardType a3, |
513 typename CallbackParamTraits<A4>::ForwardType a4, | 523 typename CallbackParamTraits<A4>::ForwardType a4, |
514 typename CallbackParamTraits<A5>::ForwardType a5, | 524 typename CallbackParamTraits<A5>::ForwardType a5, |
515 typename CallbackParamTraits<A6>::ForwardType a6) { | 525 typename CallbackParamTraits<A6>::ForwardType a6) { |
516 return (object->*method_)(a1, a2, a3, a4, a5, a6); | 526 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 527 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 528 CallbackForward(a6)); |
517 } | 529 } |
518 | 530 |
519 private: | 531 private: |
520 R (T::*method_)(A1, A2, A3, A4, A5, A6); | 532 R (T::*method_)(A1, A2, A3, A4, A5, A6); |
521 }; | 533 }; |
522 | 534 |
523 // Const Method: Arity 6. | 535 // Const Method: Arity 6. |
524 template <typename R, typename T, typename A1, typename A2, typename A3, | 536 template <typename R, typename T, typename A1, typename A2, typename A3, |
525 typename A4, typename A5, typename A6> | 537 typename A4, typename A5, typename A6> |
526 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6) const> { | 538 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6) const> { |
527 public: | 539 public: |
528 typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6); | 540 typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6); |
529 typedef true_type IsMethod; | 541 typedef true_type IsMethod; |
530 | 542 |
531 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6) const) | 543 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6) const) |
532 : method_(method) { | 544 : method_(method) { |
533 } | 545 } |
534 | 546 |
535 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 547 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
536 typename CallbackParamTraits<A2>::ForwardType a2, | 548 typename CallbackParamTraits<A2>::ForwardType a2, |
537 typename CallbackParamTraits<A3>::ForwardType a3, | 549 typename CallbackParamTraits<A3>::ForwardType a3, |
538 typename CallbackParamTraits<A4>::ForwardType a4, | 550 typename CallbackParamTraits<A4>::ForwardType a4, |
539 typename CallbackParamTraits<A5>::ForwardType a5, | 551 typename CallbackParamTraits<A5>::ForwardType a5, |
540 typename CallbackParamTraits<A6>::ForwardType a6) { | 552 typename CallbackParamTraits<A6>::ForwardType a6) { |
541 return (object->*method_)(a1, a2, a3, a4, a5, a6); | 553 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 554 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 555 CallbackForward(a6)); |
542 } | 556 } |
543 | 557 |
544 private: | 558 private: |
545 R (T::*method_)(A1, A2, A3, A4, A5, A6) const; | 559 R (T::*method_)(A1, A2, A3, A4, A5, A6) const; |
546 }; | 560 }; |
547 | 561 |
548 // Function: Arity 7. | 562 // Function: Arity 7. |
549 template <typename R, typename A1, typename A2, typename A3, typename A4, | 563 template <typename R, typename A1, typename A2, typename A3, typename A4, |
550 typename A5, typename A6, typename A7> | 564 typename A5, typename A6, typename A7> |
551 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7)> { | 565 class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7)> { |
552 public: | 566 public: |
553 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); | 567 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); |
554 | 568 |
555 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) | 569 explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) |
556 : function_(function) { | 570 : function_(function) { |
557 } | 571 } |
558 | 572 |
559 R Run(typename CallbackParamTraits<A1>::ForwardType a1, | 573 R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
560 typename CallbackParamTraits<A2>::ForwardType a2, | 574 typename CallbackParamTraits<A2>::ForwardType a2, |
561 typename CallbackParamTraits<A3>::ForwardType a3, | 575 typename CallbackParamTraits<A3>::ForwardType a3, |
562 typename CallbackParamTraits<A4>::ForwardType a4, | 576 typename CallbackParamTraits<A4>::ForwardType a4, |
563 typename CallbackParamTraits<A5>::ForwardType a5, | 577 typename CallbackParamTraits<A5>::ForwardType a5, |
564 typename CallbackParamTraits<A6>::ForwardType a6, | 578 typename CallbackParamTraits<A6>::ForwardType a6, |
565 typename CallbackParamTraits<A7>::ForwardType a7) { | 579 typename CallbackParamTraits<A7>::ForwardType a7) { |
566 return function_(a1, a2, a3, a4, a5, a6, a7); | 580 return function_(CallbackForward(a1), CallbackForward(a2), |
| 581 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 582 CallbackForward(a6), CallbackForward(a7)); |
567 } | 583 } |
568 | 584 |
569 private: | 585 private: |
570 R (*function_)(A1, A2, A3, A4, A5, A6, A7); | 586 R (*function_)(A1, A2, A3, A4, A5, A6, A7); |
571 }; | 587 }; |
572 | 588 |
573 // Method: Arity 7. | 589 // Method: Arity 7. |
574 template <typename R, typename T, typename A1, typename A2, typename A3, | 590 template <typename R, typename T, typename A1, typename A2, typename A3, |
575 typename A4, typename A5, typename A6, typename A7> | 591 typename A4, typename A5, typename A6, typename A7> |
576 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7)> { | 592 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7)> { |
577 public: | 593 public: |
578 typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); | 594 typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); |
579 typedef true_type IsMethod; | 595 typedef true_type IsMethod; |
580 | 596 |
581 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) | 597 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) |
582 : method_(method) { | 598 : method_(method) { |
583 } | 599 } |
584 | 600 |
585 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 601 R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
586 typename CallbackParamTraits<A2>::ForwardType a2, | 602 typename CallbackParamTraits<A2>::ForwardType a2, |
587 typename CallbackParamTraits<A3>::ForwardType a3, | 603 typename CallbackParamTraits<A3>::ForwardType a3, |
588 typename CallbackParamTraits<A4>::ForwardType a4, | 604 typename CallbackParamTraits<A4>::ForwardType a4, |
589 typename CallbackParamTraits<A5>::ForwardType a5, | 605 typename CallbackParamTraits<A5>::ForwardType a5, |
590 typename CallbackParamTraits<A6>::ForwardType a6, | 606 typename CallbackParamTraits<A6>::ForwardType a6, |
591 typename CallbackParamTraits<A7>::ForwardType a7) { | 607 typename CallbackParamTraits<A7>::ForwardType a7) { |
592 return (object->*method_)(a1, a2, a3, a4, a5, a6, a7); | 608 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 609 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 610 CallbackForward(a6), CallbackForward(a7)); |
593 } | 611 } |
594 | 612 |
595 private: | 613 private: |
596 R (T::*method_)(A1, A2, A3, A4, A5, A6, A7); | 614 R (T::*method_)(A1, A2, A3, A4, A5, A6, A7); |
597 }; | 615 }; |
598 | 616 |
599 // Const Method: Arity 7. | 617 // Const Method: Arity 7. |
600 template <typename R, typename T, typename A1, typename A2, typename A3, | 618 template <typename R, typename T, typename A1, typename A2, typename A3, |
601 typename A4, typename A5, typename A6, typename A7> | 619 typename A4, typename A5, typename A6, typename A7> |
602 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7) const> { | 620 class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7) const> { |
603 public: | 621 public: |
604 typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); | 622 typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); |
605 typedef true_type IsMethod; | 623 typedef true_type IsMethod; |
606 | 624 |
607 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) | 625 explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) |
608 : method_(method) { | 626 : method_(method) { |
609 } | 627 } |
610 | 628 |
611 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, | 629 R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, |
612 typename CallbackParamTraits<A2>::ForwardType a2, | 630 typename CallbackParamTraits<A2>::ForwardType a2, |
613 typename CallbackParamTraits<A3>::ForwardType a3, | 631 typename CallbackParamTraits<A3>::ForwardType a3, |
614 typename CallbackParamTraits<A4>::ForwardType a4, | 632 typename CallbackParamTraits<A4>::ForwardType a4, |
615 typename CallbackParamTraits<A5>::ForwardType a5, | 633 typename CallbackParamTraits<A5>::ForwardType a5, |
616 typename CallbackParamTraits<A6>::ForwardType a6, | 634 typename CallbackParamTraits<A6>::ForwardType a6, |
617 typename CallbackParamTraits<A7>::ForwardType a7) { | 635 typename CallbackParamTraits<A7>::ForwardType a7) { |
618 return (object->*method_)(a1, a2, a3, a4, a5, a6, a7); | 636 return (object->*method_)(CallbackForward(a1), CallbackForward(a2), |
| 637 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 638 CallbackForward(a6), CallbackForward(a7)); |
619 } | 639 } |
620 | 640 |
621 private: | 641 private: |
622 R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; | 642 R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; |
623 }; | 643 }; |
624 | 644 |
625 | 645 |
626 // FunctionTraits<> | 646 // FunctionTraits<> |
627 // | 647 // |
628 // Breaks a function signature apart into typedefs for easier introspection. | 648 // Breaks a function signature apart into typedefs for easier introspection. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 void()> { | 850 void()> { |
831 static void MakeItSo(Runnable runnable) { | 851 static void MakeItSo(Runnable runnable) { |
832 runnable.Run(); | 852 runnable.Run(); |
833 } | 853 } |
834 }; | 854 }; |
835 | 855 |
836 template <typename ReturnType, typename Runnable,typename A1> | 856 template <typename ReturnType, typename Runnable,typename A1> |
837 struct InvokeHelper<false, ReturnType, Runnable, | 857 struct InvokeHelper<false, ReturnType, Runnable, |
838 void(A1)> { | 858 void(A1)> { |
839 static ReturnType MakeItSo(Runnable runnable, A1 a1) { | 859 static ReturnType MakeItSo(Runnable runnable, A1 a1) { |
840 return runnable.Run(a1); | 860 return runnable.Run(CallbackForward(a1)); |
841 } | 861 } |
842 }; | 862 }; |
843 | 863 |
844 template <typename Runnable,typename A1> | 864 template <typename Runnable,typename A1> |
845 struct InvokeHelper<false, void, Runnable, | 865 struct InvokeHelper<false, void, Runnable, |
846 void(A1)> { | 866 void(A1)> { |
847 static void MakeItSo(Runnable runnable, A1 a1) { | 867 static void MakeItSo(Runnable runnable, A1 a1) { |
848 runnable.Run(a1); | 868 runnable.Run(CallbackForward(a1)); |
849 } | 869 } |
850 }; | 870 }; |
851 | 871 |
852 template <typename Runnable, typename A1> | 872 template <typename Runnable, typename A1> |
853 struct InvokeHelper<true, void, Runnable, | 873 struct InvokeHelper<true, void, Runnable, |
854 void(A1)> { | 874 void(A1)> { |
855 static void MakeItSo(Runnable runnable, A1 a1) { | 875 static void MakeItSo(Runnable runnable, A1 a1) { |
856 if (!a1.get()) { | 876 if (!a1.get()) { |
857 return; | 877 return; |
858 } | 878 } |
859 | 879 |
860 runnable.Run(a1); | 880 runnable.Run(CallbackForward(a1)); |
861 } | 881 } |
862 }; | 882 }; |
863 | 883 |
864 template <typename ReturnType, typename Runnable,typename A1, typename A2> | 884 template <typename ReturnType, typename Runnable,typename A1, typename A2> |
865 struct InvokeHelper<false, ReturnType, Runnable, | 885 struct InvokeHelper<false, ReturnType, Runnable, |
866 void(A1, A2)> { | 886 void(A1, A2)> { |
867 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) { | 887 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) { |
868 return runnable.Run(a1, a2); | 888 return runnable.Run(CallbackForward(a1), CallbackForward(a2)); |
869 } | 889 } |
870 }; | 890 }; |
871 | 891 |
872 template <typename Runnable,typename A1, typename A2> | 892 template <typename Runnable,typename A1, typename A2> |
873 struct InvokeHelper<false, void, Runnable, | 893 struct InvokeHelper<false, void, Runnable, |
874 void(A1, A2)> { | 894 void(A1, A2)> { |
875 static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { | 895 static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { |
876 runnable.Run(a1, a2); | 896 runnable.Run(CallbackForward(a1), CallbackForward(a2)); |
877 } | 897 } |
878 }; | 898 }; |
879 | 899 |
880 template <typename Runnable, typename A1, typename A2> | 900 template <typename Runnable, typename A1, typename A2> |
881 struct InvokeHelper<true, void, Runnable, | 901 struct InvokeHelper<true, void, Runnable, |
882 void(A1, A2)> { | 902 void(A1, A2)> { |
883 static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { | 903 static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { |
884 if (!a1.get()) { | 904 if (!a1.get()) { |
885 return; | 905 return; |
886 } | 906 } |
887 | 907 |
888 runnable.Run(a1, a2); | 908 runnable.Run(CallbackForward(a1), CallbackForward(a2)); |
889 } | 909 } |
890 }; | 910 }; |
891 | 911 |
892 template <typename ReturnType, typename Runnable,typename A1, typename A2, | 912 template <typename ReturnType, typename Runnable,typename A1, typename A2, |
893 typename A3> | 913 typename A3> |
894 struct InvokeHelper<false, ReturnType, Runnable, | 914 struct InvokeHelper<false, ReturnType, Runnable, |
895 void(A1, A2, A3)> { | 915 void(A1, A2, A3)> { |
896 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { | 916 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { |
897 return runnable.Run(a1, a2, a3); | 917 return runnable.Run(CallbackForward(a1), CallbackForward(a2), |
| 918 CallbackForward(a3)); |
898 } | 919 } |
899 }; | 920 }; |
900 | 921 |
901 template <typename Runnable,typename A1, typename A2, typename A3> | 922 template <typename Runnable,typename A1, typename A2, typename A3> |
902 struct InvokeHelper<false, void, Runnable, | 923 struct InvokeHelper<false, void, Runnable, |
903 void(A1, A2, A3)> { | 924 void(A1, A2, A3)> { |
904 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { | 925 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { |
905 runnable.Run(a1, a2, a3); | 926 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3)); |
906 } | 927 } |
907 }; | 928 }; |
908 | 929 |
909 template <typename Runnable, typename A1, typename A2, typename A3> | 930 template <typename Runnable, typename A1, typename A2, typename A3> |
910 struct InvokeHelper<true, void, Runnable, | 931 struct InvokeHelper<true, void, Runnable, |
911 void(A1, A2, A3)> { | 932 void(A1, A2, A3)> { |
912 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { | 933 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { |
913 if (!a1.get()) { | 934 if (!a1.get()) { |
914 return; | 935 return; |
915 } | 936 } |
916 | 937 |
917 runnable.Run(a1, a2, a3); | 938 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3)); |
918 } | 939 } |
919 }; | 940 }; |
920 | 941 |
921 template <typename ReturnType, typename Runnable,typename A1, typename A2, | 942 template <typename ReturnType, typename Runnable,typename A1, typename A2, |
922 typename A3, typename A4> | 943 typename A3, typename A4> |
923 struct InvokeHelper<false, ReturnType, Runnable, | 944 struct InvokeHelper<false, ReturnType, Runnable, |
924 void(A1, A2, A3, A4)> { | 945 void(A1, A2, A3, A4)> { |
925 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { | 946 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { |
926 return runnable.Run(a1, a2, a3, a4); | 947 return runnable.Run(CallbackForward(a1), CallbackForward(a2), |
| 948 CallbackForward(a3), CallbackForward(a4)); |
927 } | 949 } |
928 }; | 950 }; |
929 | 951 |
930 template <typename Runnable,typename A1, typename A2, typename A3, typename A4> | 952 template <typename Runnable,typename A1, typename A2, typename A3, typename A4> |
931 struct InvokeHelper<false, void, Runnable, | 953 struct InvokeHelper<false, void, Runnable, |
932 void(A1, A2, A3, A4)> { | 954 void(A1, A2, A3, A4)> { |
933 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { | 955 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { |
934 runnable.Run(a1, a2, a3, a4); | 956 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 957 CallbackForward(a4)); |
935 } | 958 } |
936 }; | 959 }; |
937 | 960 |
938 template <typename Runnable, typename A1, typename A2, typename A3, typename A4> | 961 template <typename Runnable, typename A1, typename A2, typename A3, typename A4> |
939 struct InvokeHelper<true, void, Runnable, | 962 struct InvokeHelper<true, void, Runnable, |
940 void(A1, A2, A3, A4)> { | 963 void(A1, A2, A3, A4)> { |
941 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { | 964 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { |
942 if (!a1.get()) { | 965 if (!a1.get()) { |
943 return; | 966 return; |
944 } | 967 } |
945 | 968 |
946 runnable.Run(a1, a2, a3, a4); | 969 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 970 CallbackForward(a4)); |
947 } | 971 } |
948 }; | 972 }; |
949 | 973 |
950 template <typename ReturnType, typename Runnable,typename A1, typename A2, | 974 template <typename ReturnType, typename Runnable,typename A1, typename A2, |
951 typename A3, typename A4, typename A5> | 975 typename A3, typename A4, typename A5> |
952 struct InvokeHelper<false, ReturnType, Runnable, | 976 struct InvokeHelper<false, ReturnType, Runnable, |
953 void(A1, A2, A3, A4, A5)> { | 977 void(A1, A2, A3, A4, A5)> { |
954 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, | 978 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, |
955 A5 a5) { | 979 A5 a5) { |
956 return runnable.Run(a1, a2, a3, a4, a5); | 980 return runnable.Run(CallbackForward(a1), CallbackForward(a2), |
| 981 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); |
957 } | 982 } |
958 }; | 983 }; |
959 | 984 |
960 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, | 985 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, |
961 typename A5> | 986 typename A5> |
962 struct InvokeHelper<false, void, Runnable, | 987 struct InvokeHelper<false, void, Runnable, |
963 void(A1, A2, A3, A4, A5)> { | 988 void(A1, A2, A3, A4, A5)> { |
964 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { | 989 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { |
965 runnable.Run(a1, a2, a3, a4, a5); | 990 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 991 CallbackForward(a4), CallbackForward(a5)); |
966 } | 992 } |
967 }; | 993 }; |
968 | 994 |
969 template <typename Runnable, typename A1, typename A2, typename A3, | 995 template <typename Runnable, typename A1, typename A2, typename A3, |
970 typename A4, typename A5> | 996 typename A4, typename A5> |
971 struct InvokeHelper<true, void, Runnable, | 997 struct InvokeHelper<true, void, Runnable, |
972 void(A1, A2, A3, A4, A5)> { | 998 void(A1, A2, A3, A4, A5)> { |
973 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { | 999 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { |
974 if (!a1.get()) { | 1000 if (!a1.get()) { |
975 return; | 1001 return; |
976 } | 1002 } |
977 | 1003 |
978 runnable.Run(a1, a2, a3, a4, a5); | 1004 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 1005 CallbackForward(a4), CallbackForward(a5)); |
979 } | 1006 } |
980 }; | 1007 }; |
981 | 1008 |
982 template <typename ReturnType, typename Runnable,typename A1, typename A2, | 1009 template <typename ReturnType, typename Runnable,typename A1, typename A2, |
983 typename A3, typename A4, typename A5, typename A6> | 1010 typename A3, typename A4, typename A5, typename A6> |
984 struct InvokeHelper<false, ReturnType, Runnable, | 1011 struct InvokeHelper<false, ReturnType, Runnable, |
985 void(A1, A2, A3, A4, A5, A6)> { | 1012 void(A1, A2, A3, A4, A5, A6)> { |
986 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, | 1013 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, |
987 A5 a5, A6 a6) { | 1014 A5 a5, A6 a6) { |
988 return runnable.Run(a1, a2, a3, a4, a5, a6); | 1015 return runnable.Run(CallbackForward(a1), CallbackForward(a2), |
| 1016 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 1017 CallbackForward(a6)); |
989 } | 1018 } |
990 }; | 1019 }; |
991 | 1020 |
992 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, | 1021 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, |
993 typename A5, typename A6> | 1022 typename A5, typename A6> |
994 struct InvokeHelper<false, void, Runnable, | 1023 struct InvokeHelper<false, void, Runnable, |
995 void(A1, A2, A3, A4, A5, A6)> { | 1024 void(A1, A2, A3, A4, A5, A6)> { |
996 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, | 1025 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, |
997 A6 a6) { | 1026 A6 a6) { |
998 runnable.Run(a1, a2, a3, a4, a5, a6); | 1027 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 1028 CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); |
999 } | 1029 } |
1000 }; | 1030 }; |
1001 | 1031 |
1002 template <typename Runnable, typename A1, typename A2, typename A3, | 1032 template <typename Runnable, typename A1, typename A2, typename A3, |
1003 typename A4, typename A5, typename A6> | 1033 typename A4, typename A5, typename A6> |
1004 struct InvokeHelper<true, void, Runnable, | 1034 struct InvokeHelper<true, void, Runnable, |
1005 void(A1, A2, A3, A4, A5, A6)> { | 1035 void(A1, A2, A3, A4, A5, A6)> { |
1006 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, | 1036 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, |
1007 A6 a6) { | 1037 A6 a6) { |
1008 if (!a1.get()) { | 1038 if (!a1.get()) { |
1009 return; | 1039 return; |
1010 } | 1040 } |
1011 | 1041 |
1012 runnable.Run(a1, a2, a3, a4, a5, a6); | 1042 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 1043 CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); |
1013 } | 1044 } |
1014 }; | 1045 }; |
1015 | 1046 |
1016 template <typename ReturnType, typename Runnable,typename A1, typename A2, | 1047 template <typename ReturnType, typename Runnable,typename A1, typename A2, |
1017 typename A3, typename A4, typename A5, typename A6, typename A7> | 1048 typename A3, typename A4, typename A5, typename A6, typename A7> |
1018 struct InvokeHelper<false, ReturnType, Runnable, | 1049 struct InvokeHelper<false, ReturnType, Runnable, |
1019 void(A1, A2, A3, A4, A5, A6, A7)> { | 1050 void(A1, A2, A3, A4, A5, A6, A7)> { |
1020 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, | 1051 static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, |
1021 A5 a5, A6 a6, A7 a7) { | 1052 A5 a5, A6 a6, A7 a7) { |
1022 return runnable.Run(a1, a2, a3, a4, a5, a6, a7); | 1053 return runnable.Run(CallbackForward(a1), CallbackForward(a2), |
| 1054 CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), |
| 1055 CallbackForward(a6), CallbackForward(a7)); |
1023 } | 1056 } |
1024 }; | 1057 }; |
1025 | 1058 |
1026 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, | 1059 template <typename Runnable,typename A1, typename A2, typename A3, typename A4, |
1027 typename A5, typename A6, typename A7> | 1060 typename A5, typename A6, typename A7> |
1028 struct InvokeHelper<false, void, Runnable, | 1061 struct InvokeHelper<false, void, Runnable, |
1029 void(A1, A2, A3, A4, A5, A6, A7)> { | 1062 void(A1, A2, A3, A4, A5, A6, A7)> { |
1030 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, | 1063 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, |
1031 A6 a6, A7 a7) { | 1064 A6 a6, A7 a7) { |
1032 runnable.Run(a1, a2, a3, a4, a5, a6, a7); | 1065 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 1066 CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), |
| 1067 CallbackForward(a7)); |
1033 } | 1068 } |
1034 }; | 1069 }; |
1035 | 1070 |
1036 template <typename Runnable, typename A1, typename A2, typename A3, | 1071 template <typename Runnable, typename A1, typename A2, typename A3, |
1037 typename A4, typename A5, typename A6, typename A7> | 1072 typename A4, typename A5, typename A6, typename A7> |
1038 struct InvokeHelper<true, void, Runnable, | 1073 struct InvokeHelper<true, void, Runnable, |
1039 void(A1, A2, A3, A4, A5, A6, A7)> { | 1074 void(A1, A2, A3, A4, A5, A6, A7)> { |
1040 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, | 1075 static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, |
1041 A6 a6, A7 a7) { | 1076 A6 a6, A7 a7) { |
1042 if (!a1.get()) { | 1077 if (!a1.get()) { |
1043 return; | 1078 return; |
1044 } | 1079 } |
1045 | 1080 |
1046 runnable.Run(a1, a2, a3, a4, a5, a6, a7); | 1081 runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), |
| 1082 CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), |
| 1083 CallbackForward(a7)); |
1047 } | 1084 } |
1048 }; | 1085 }; |
1049 | 1086 |
1050 #if !defined(_MSC_VER) | 1087 #if !defined(_MSC_VER) |
1051 | 1088 |
1052 template <typename ReturnType, typename Runnable, typename ArgsType> | 1089 template <typename ReturnType, typename Runnable, typename ArgsType> |
1053 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { | 1090 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { |
1054 // WeakCalls are only supported for functions with a void return type. | 1091 // WeakCalls are only supported for functions with a void return type. |
1055 // Otherwise, the function result would be undefined if the the WeakPtr<> | 1092 // Otherwise, the function result would be undefined if the the WeakPtr<> |
1056 // is invalidated. | 1093 // is invalidated. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 typename CallbackParamTraits<X1>::ForwardType x1) { | 1136 typename CallbackParamTraits<X1>::ForwardType x1) { |
1100 StorageType* storage = static_cast<StorageType*>(base); | 1137 StorageType* storage = static_cast<StorageType*>(base); |
1101 | 1138 |
1102 // Local references to make debugger stepping easier. If in a debugger, | 1139 // Local references to make debugger stepping easier. If in a debugger, |
1103 // you really want to warp ahead and step through the | 1140 // you really want to warp ahead and step through the |
1104 // InvokeHelper<>::MakeItSo() call below. | 1141 // InvokeHelper<>::MakeItSo() call below. |
1105 | 1142 |
1106 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1143 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1107 typename StorageType::RunnableType, | 1144 typename StorageType::RunnableType, |
1108 void(typename CallbackParamTraits<X1>::ForwardType x1)> | 1145 void(typename CallbackParamTraits<X1>::ForwardType x1)> |
1109 ::MakeItSo(storage->runnable_, x1); | 1146 ::MakeItSo(storage->runnable_, CallbackForward(x1)); |
1110 } | 1147 } |
1111 }; | 1148 }; |
1112 | 1149 |
1113 // Arity 1 -> 0. | 1150 // Arity 1 -> 0. |
1114 template <typename StorageType, typename R,typename X1> | 1151 template <typename StorageType, typename R,typename X1> |
1115 struct Invoker<1, StorageType, R(X1)> { | 1152 struct Invoker<1, StorageType, R(X1)> { |
1116 typedef R(RunType)(BindStateBase*); | 1153 typedef R(RunType)(BindStateBase*); |
1117 | 1154 |
1118 typedef R(UnboundRunType)(); | 1155 typedef R(UnboundRunType)(); |
1119 | 1156 |
1120 static R Run(BindStateBase* base) { | 1157 static R Run(BindStateBase* base) { |
1121 StorageType* storage = static_cast<StorageType*>(base); | 1158 StorageType* storage = static_cast<StorageType*>(base); |
1122 | 1159 |
1123 // Local references to make debugger stepping easier. If in a debugger, | 1160 // Local references to make debugger stepping easier. If in a debugger, |
1124 // you really want to warp ahead and step through the | 1161 // you really want to warp ahead and step through the |
1125 // InvokeHelper<>::MakeItSo() call below. | 1162 // InvokeHelper<>::MakeItSo() call below. |
1126 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | 1163 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; |
1127 | 1164 |
1128 typename Bound1UnwrapTraits::ForwardType x1 = | 1165 typename Bound1UnwrapTraits::ForwardType x1 = |
1129 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1166 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1130 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1167 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1131 typename StorageType::RunnableType, | 1168 typename StorageType::RunnableType, |
1132 void(typename Bound1UnwrapTraits::ForwardType)> | 1169 void(typename Bound1UnwrapTraits::ForwardType)> |
1133 ::MakeItSo(storage->runnable_, x1); | 1170 ::MakeItSo(storage->runnable_, CallbackForward(x1)); |
1134 } | 1171 } |
1135 }; | 1172 }; |
1136 | 1173 |
1137 // Arity 2 -> 2. | 1174 // Arity 2 -> 2. |
1138 template <typename StorageType, typename R,typename X1, typename X2> | 1175 template <typename StorageType, typename R,typename X1, typename X2> |
1139 struct Invoker<0, StorageType, R(X1, X2)> { | 1176 struct Invoker<0, StorageType, R(X1, X2)> { |
1140 typedef R(RunType)(BindStateBase*, | 1177 typedef R(RunType)(BindStateBase*, |
1141 typename CallbackParamTraits<X1>::ForwardType, | 1178 typename CallbackParamTraits<X1>::ForwardType, |
1142 typename CallbackParamTraits<X2>::ForwardType); | 1179 typename CallbackParamTraits<X2>::ForwardType); |
1143 | 1180 |
1144 typedef R(UnboundRunType)(X1, X2); | 1181 typedef R(UnboundRunType)(X1, X2); |
1145 | 1182 |
1146 static R Run(BindStateBase* base, | 1183 static R Run(BindStateBase* base, |
1147 typename CallbackParamTraits<X1>::ForwardType x1, | 1184 typename CallbackParamTraits<X1>::ForwardType x1, |
1148 typename CallbackParamTraits<X2>::ForwardType x2) { | 1185 typename CallbackParamTraits<X2>::ForwardType x2) { |
1149 StorageType* storage = static_cast<StorageType*>(base); | 1186 StorageType* storage = static_cast<StorageType*>(base); |
1150 | 1187 |
1151 // Local references to make debugger stepping easier. If in a debugger, | 1188 // Local references to make debugger stepping easier. If in a debugger, |
1152 // you really want to warp ahead and step through the | 1189 // you really want to warp ahead and step through the |
1153 // InvokeHelper<>::MakeItSo() call below. | 1190 // InvokeHelper<>::MakeItSo() call below. |
1154 | 1191 |
1155 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1192 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1156 typename StorageType::RunnableType, | 1193 typename StorageType::RunnableType, |
1157 void(typename CallbackParamTraits<X1>::ForwardType x1, | 1194 void(typename CallbackParamTraits<X1>::ForwardType x1, |
1158 typename CallbackParamTraits<X2>::ForwardType x2)> | 1195 typename CallbackParamTraits<X2>::ForwardType x2)> |
1159 ::MakeItSo(storage->runnable_, x1, x2); | 1196 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1197 CallbackForward(x2)); |
1160 } | 1198 } |
1161 }; | 1199 }; |
1162 | 1200 |
1163 // Arity 2 -> 1. | 1201 // Arity 2 -> 1. |
1164 template <typename StorageType, typename R,typename X1, typename X2> | 1202 template <typename StorageType, typename R,typename X1, typename X2> |
1165 struct Invoker<1, StorageType, R(X1, X2)> { | 1203 struct Invoker<1, StorageType, R(X1, X2)> { |
1166 typedef R(RunType)(BindStateBase*, | 1204 typedef R(RunType)(BindStateBase*, |
1167 typename CallbackParamTraits<X2>::ForwardType); | 1205 typename CallbackParamTraits<X2>::ForwardType); |
1168 | 1206 |
1169 typedef R(UnboundRunType)(X2); | 1207 typedef R(UnboundRunType)(X2); |
1170 | 1208 |
1171 static R Run(BindStateBase* base, | 1209 static R Run(BindStateBase* base, |
1172 typename CallbackParamTraits<X2>::ForwardType x2) { | 1210 typename CallbackParamTraits<X2>::ForwardType x2) { |
1173 StorageType* storage = static_cast<StorageType*>(base); | 1211 StorageType* storage = static_cast<StorageType*>(base); |
1174 | 1212 |
1175 // Local references to make debugger stepping easier. If in a debugger, | 1213 // Local references to make debugger stepping easier. If in a debugger, |
1176 // you really want to warp ahead and step through the | 1214 // you really want to warp ahead and step through the |
1177 // InvokeHelper<>::MakeItSo() call below. | 1215 // InvokeHelper<>::MakeItSo() call below. |
1178 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | 1216 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; |
1179 | 1217 |
1180 typename Bound1UnwrapTraits::ForwardType x1 = | 1218 typename Bound1UnwrapTraits::ForwardType x1 = |
1181 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1219 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1182 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1220 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1183 typename StorageType::RunnableType, | 1221 typename StorageType::RunnableType, |
1184 void(typename Bound1UnwrapTraits::ForwardType, | 1222 void(typename Bound1UnwrapTraits::ForwardType, |
1185 typename CallbackParamTraits<X2>::ForwardType x2)> | 1223 typename CallbackParamTraits<X2>::ForwardType x2)> |
1186 ::MakeItSo(storage->runnable_, x1, x2); | 1224 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1225 CallbackForward(x2)); |
1187 } | 1226 } |
1188 }; | 1227 }; |
1189 | 1228 |
1190 // Arity 2 -> 0. | 1229 // Arity 2 -> 0. |
1191 template <typename StorageType, typename R,typename X1, typename X2> | 1230 template <typename StorageType, typename R,typename X1, typename X2> |
1192 struct Invoker<2, StorageType, R(X1, X2)> { | 1231 struct Invoker<2, StorageType, R(X1, X2)> { |
1193 typedef R(RunType)(BindStateBase*); | 1232 typedef R(RunType)(BindStateBase*); |
1194 | 1233 |
1195 typedef R(UnboundRunType)(); | 1234 typedef R(UnboundRunType)(); |
1196 | 1235 |
1197 static R Run(BindStateBase* base) { | 1236 static R Run(BindStateBase* base) { |
1198 StorageType* storage = static_cast<StorageType*>(base); | 1237 StorageType* storage = static_cast<StorageType*>(base); |
1199 | 1238 |
1200 // Local references to make debugger stepping easier. If in a debugger, | 1239 // Local references to make debugger stepping easier. If in a debugger, |
1201 // you really want to warp ahead and step through the | 1240 // you really want to warp ahead and step through the |
1202 // InvokeHelper<>::MakeItSo() call below. | 1241 // InvokeHelper<>::MakeItSo() call below. |
1203 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | 1242 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; |
1204 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | 1243 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; |
1205 | 1244 |
1206 typename Bound1UnwrapTraits::ForwardType x1 = | 1245 typename Bound1UnwrapTraits::ForwardType x1 = |
1207 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1246 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1208 typename Bound2UnwrapTraits::ForwardType x2 = | 1247 typename Bound2UnwrapTraits::ForwardType x2 = |
1209 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1248 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1210 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1249 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1211 typename StorageType::RunnableType, | 1250 typename StorageType::RunnableType, |
1212 void(typename Bound1UnwrapTraits::ForwardType, | 1251 void(typename Bound1UnwrapTraits::ForwardType, |
1213 typename Bound2UnwrapTraits::ForwardType)> | 1252 typename Bound2UnwrapTraits::ForwardType)> |
1214 ::MakeItSo(storage->runnable_, x1, x2); | 1253 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1254 CallbackForward(x2)); |
1215 } | 1255 } |
1216 }; | 1256 }; |
1217 | 1257 |
1218 // Arity 3 -> 3. | 1258 // Arity 3 -> 3. |
1219 template <typename StorageType, typename R,typename X1, typename X2, | 1259 template <typename StorageType, typename R,typename X1, typename X2, |
1220 typename X3> | 1260 typename X3> |
1221 struct Invoker<0, StorageType, R(X1, X2, X3)> { | 1261 struct Invoker<0, StorageType, R(X1, X2, X3)> { |
1222 typedef R(RunType)(BindStateBase*, | 1262 typedef R(RunType)(BindStateBase*, |
1223 typename CallbackParamTraits<X1>::ForwardType, | 1263 typename CallbackParamTraits<X1>::ForwardType, |
1224 typename CallbackParamTraits<X2>::ForwardType, | 1264 typename CallbackParamTraits<X2>::ForwardType, |
1225 typename CallbackParamTraits<X3>::ForwardType); | 1265 typename CallbackParamTraits<X3>::ForwardType); |
1226 | 1266 |
1227 typedef R(UnboundRunType)(X1, X2, X3); | 1267 typedef R(UnboundRunType)(X1, X2, X3); |
1228 | 1268 |
1229 static R Run(BindStateBase* base, | 1269 static R Run(BindStateBase* base, |
1230 typename CallbackParamTraits<X1>::ForwardType x1, | 1270 typename CallbackParamTraits<X1>::ForwardType x1, |
1231 typename CallbackParamTraits<X2>::ForwardType x2, | 1271 typename CallbackParamTraits<X2>::ForwardType x2, |
1232 typename CallbackParamTraits<X3>::ForwardType x3) { | 1272 typename CallbackParamTraits<X3>::ForwardType x3) { |
1233 StorageType* storage = static_cast<StorageType*>(base); | 1273 StorageType* storage = static_cast<StorageType*>(base); |
1234 | 1274 |
1235 // Local references to make debugger stepping easier. If in a debugger, | 1275 // Local references to make debugger stepping easier. If in a debugger, |
1236 // you really want to warp ahead and step through the | 1276 // you really want to warp ahead and step through the |
1237 // InvokeHelper<>::MakeItSo() call below. | 1277 // InvokeHelper<>::MakeItSo() call below. |
1238 | 1278 |
1239 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1279 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1240 typename StorageType::RunnableType, | 1280 typename StorageType::RunnableType, |
1241 void(typename CallbackParamTraits<X1>::ForwardType x1, | 1281 void(typename CallbackParamTraits<X1>::ForwardType x1, |
1242 typename CallbackParamTraits<X2>::ForwardType x2, | 1282 typename CallbackParamTraits<X2>::ForwardType x2, |
1243 typename CallbackParamTraits<X3>::ForwardType x3)> | 1283 typename CallbackParamTraits<X3>::ForwardType x3)> |
1244 ::MakeItSo(storage->runnable_, x1, x2, x3); | 1284 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1285 CallbackForward(x2), CallbackForward(x3)); |
1245 } | 1286 } |
1246 }; | 1287 }; |
1247 | 1288 |
1248 // Arity 3 -> 2. | 1289 // Arity 3 -> 2. |
1249 template <typename StorageType, typename R,typename X1, typename X2, | 1290 template <typename StorageType, typename R,typename X1, typename X2, |
1250 typename X3> | 1291 typename X3> |
1251 struct Invoker<1, StorageType, R(X1, X2, X3)> { | 1292 struct Invoker<1, StorageType, R(X1, X2, X3)> { |
1252 typedef R(RunType)(BindStateBase*, | 1293 typedef R(RunType)(BindStateBase*, |
1253 typename CallbackParamTraits<X2>::ForwardType, | 1294 typename CallbackParamTraits<X2>::ForwardType, |
1254 typename CallbackParamTraits<X3>::ForwardType); | 1295 typename CallbackParamTraits<X3>::ForwardType); |
(...skipping 10 matching lines...) Expand all Loading... |
1265 // InvokeHelper<>::MakeItSo() call below. | 1306 // InvokeHelper<>::MakeItSo() call below. |
1266 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | 1307 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; |
1267 | 1308 |
1268 typename Bound1UnwrapTraits::ForwardType x1 = | 1309 typename Bound1UnwrapTraits::ForwardType x1 = |
1269 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1310 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1270 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1311 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1271 typename StorageType::RunnableType, | 1312 typename StorageType::RunnableType, |
1272 void(typename Bound1UnwrapTraits::ForwardType, | 1313 void(typename Bound1UnwrapTraits::ForwardType, |
1273 typename CallbackParamTraits<X2>::ForwardType x2, | 1314 typename CallbackParamTraits<X2>::ForwardType x2, |
1274 typename CallbackParamTraits<X3>::ForwardType x3)> | 1315 typename CallbackParamTraits<X3>::ForwardType x3)> |
1275 ::MakeItSo(storage->runnable_, x1, x2, x3); | 1316 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1317 CallbackForward(x2), CallbackForward(x3)); |
1276 } | 1318 } |
1277 }; | 1319 }; |
1278 | 1320 |
1279 // Arity 3 -> 1. | 1321 // Arity 3 -> 1. |
1280 template <typename StorageType, typename R,typename X1, typename X2, | 1322 template <typename StorageType, typename R,typename X1, typename X2, |
1281 typename X3> | 1323 typename X3> |
1282 struct Invoker<2, StorageType, R(X1, X2, X3)> { | 1324 struct Invoker<2, StorageType, R(X1, X2, X3)> { |
1283 typedef R(RunType)(BindStateBase*, | 1325 typedef R(RunType)(BindStateBase*, |
1284 typename CallbackParamTraits<X3>::ForwardType); | 1326 typename CallbackParamTraits<X3>::ForwardType); |
1285 | 1327 |
(...skipping 11 matching lines...) Expand all Loading... |
1297 | 1339 |
1298 typename Bound1UnwrapTraits::ForwardType x1 = | 1340 typename Bound1UnwrapTraits::ForwardType x1 = |
1299 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1341 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1300 typename Bound2UnwrapTraits::ForwardType x2 = | 1342 typename Bound2UnwrapTraits::ForwardType x2 = |
1301 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1343 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1302 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1344 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1303 typename StorageType::RunnableType, | 1345 typename StorageType::RunnableType, |
1304 void(typename Bound1UnwrapTraits::ForwardType, | 1346 void(typename Bound1UnwrapTraits::ForwardType, |
1305 typename Bound2UnwrapTraits::ForwardType, | 1347 typename Bound2UnwrapTraits::ForwardType, |
1306 typename CallbackParamTraits<X3>::ForwardType x3)> | 1348 typename CallbackParamTraits<X3>::ForwardType x3)> |
1307 ::MakeItSo(storage->runnable_, x1, x2, x3); | 1349 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1350 CallbackForward(x2), CallbackForward(x3)); |
1308 } | 1351 } |
1309 }; | 1352 }; |
1310 | 1353 |
1311 // Arity 3 -> 0. | 1354 // Arity 3 -> 0. |
1312 template <typename StorageType, typename R,typename X1, typename X2, | 1355 template <typename StorageType, typename R,typename X1, typename X2, |
1313 typename X3> | 1356 typename X3> |
1314 struct Invoker<3, StorageType, R(X1, X2, X3)> { | 1357 struct Invoker<3, StorageType, R(X1, X2, X3)> { |
1315 typedef R(RunType)(BindStateBase*); | 1358 typedef R(RunType)(BindStateBase*); |
1316 | 1359 |
1317 typedef R(UnboundRunType)(); | 1360 typedef R(UnboundRunType)(); |
(...skipping 12 matching lines...) Expand all Loading... |
1330 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1373 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1331 typename Bound2UnwrapTraits::ForwardType x2 = | 1374 typename Bound2UnwrapTraits::ForwardType x2 = |
1332 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1375 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1333 typename Bound3UnwrapTraits::ForwardType x3 = | 1376 typename Bound3UnwrapTraits::ForwardType x3 = |
1334 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1377 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1335 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1378 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1336 typename StorageType::RunnableType, | 1379 typename StorageType::RunnableType, |
1337 void(typename Bound1UnwrapTraits::ForwardType, | 1380 void(typename Bound1UnwrapTraits::ForwardType, |
1338 typename Bound2UnwrapTraits::ForwardType, | 1381 typename Bound2UnwrapTraits::ForwardType, |
1339 typename Bound3UnwrapTraits::ForwardType)> | 1382 typename Bound3UnwrapTraits::ForwardType)> |
1340 ::MakeItSo(storage->runnable_, x1, x2, x3); | 1383 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1384 CallbackForward(x2), CallbackForward(x3)); |
1341 } | 1385 } |
1342 }; | 1386 }; |
1343 | 1387 |
1344 // Arity 4 -> 4. | 1388 // Arity 4 -> 4. |
1345 template <typename StorageType, typename R,typename X1, typename X2, | 1389 template <typename StorageType, typename R,typename X1, typename X2, |
1346 typename X3, typename X4> | 1390 typename X3, typename X4> |
1347 struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { | 1391 struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { |
1348 typedef R(RunType)(BindStateBase*, | 1392 typedef R(RunType)(BindStateBase*, |
1349 typename CallbackParamTraits<X1>::ForwardType, | 1393 typename CallbackParamTraits<X1>::ForwardType, |
1350 typename CallbackParamTraits<X2>::ForwardType, | 1394 typename CallbackParamTraits<X2>::ForwardType, |
(...skipping 12 matching lines...) Expand all Loading... |
1363 // Local references to make debugger stepping easier. If in a debugger, | 1407 // Local references to make debugger stepping easier. If in a debugger, |
1364 // you really want to warp ahead and step through the | 1408 // you really want to warp ahead and step through the |
1365 // InvokeHelper<>::MakeItSo() call below. | 1409 // InvokeHelper<>::MakeItSo() call below. |
1366 | 1410 |
1367 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1411 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1368 typename StorageType::RunnableType, | 1412 typename StorageType::RunnableType, |
1369 void(typename CallbackParamTraits<X1>::ForwardType x1, | 1413 void(typename CallbackParamTraits<X1>::ForwardType x1, |
1370 typename CallbackParamTraits<X2>::ForwardType x2, | 1414 typename CallbackParamTraits<X2>::ForwardType x2, |
1371 typename CallbackParamTraits<X3>::ForwardType x3, | 1415 typename CallbackParamTraits<X3>::ForwardType x3, |
1372 typename CallbackParamTraits<X4>::ForwardType x4)> | 1416 typename CallbackParamTraits<X4>::ForwardType x4)> |
1373 ::MakeItSo(storage->runnable_, x1, x2, x3, x4); | 1417 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1418 CallbackForward(x2), CallbackForward(x3), |
| 1419 CallbackForward(x4)); |
1374 } | 1420 } |
1375 }; | 1421 }; |
1376 | 1422 |
1377 // Arity 4 -> 3. | 1423 // Arity 4 -> 3. |
1378 template <typename StorageType, typename R,typename X1, typename X2, | 1424 template <typename StorageType, typename R,typename X1, typename X2, |
1379 typename X3, typename X4> | 1425 typename X3, typename X4> |
1380 struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { | 1426 struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { |
1381 typedef R(RunType)(BindStateBase*, | 1427 typedef R(RunType)(BindStateBase*, |
1382 typename CallbackParamTraits<X2>::ForwardType, | 1428 typename CallbackParamTraits<X2>::ForwardType, |
1383 typename CallbackParamTraits<X3>::ForwardType, | 1429 typename CallbackParamTraits<X3>::ForwardType, |
(...skipping 13 matching lines...) Expand all Loading... |
1397 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | 1443 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; |
1398 | 1444 |
1399 typename Bound1UnwrapTraits::ForwardType x1 = | 1445 typename Bound1UnwrapTraits::ForwardType x1 = |
1400 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1446 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1401 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1447 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1402 typename StorageType::RunnableType, | 1448 typename StorageType::RunnableType, |
1403 void(typename Bound1UnwrapTraits::ForwardType, | 1449 void(typename Bound1UnwrapTraits::ForwardType, |
1404 typename CallbackParamTraits<X2>::ForwardType x2, | 1450 typename CallbackParamTraits<X2>::ForwardType x2, |
1405 typename CallbackParamTraits<X3>::ForwardType x3, | 1451 typename CallbackParamTraits<X3>::ForwardType x3, |
1406 typename CallbackParamTraits<X4>::ForwardType x4)> | 1452 typename CallbackParamTraits<X4>::ForwardType x4)> |
1407 ::MakeItSo(storage->runnable_, x1, x2, x3, x4); | 1453 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1454 CallbackForward(x2), CallbackForward(x3), |
| 1455 CallbackForward(x4)); |
1408 } | 1456 } |
1409 }; | 1457 }; |
1410 | 1458 |
1411 // Arity 4 -> 2. | 1459 // Arity 4 -> 2. |
1412 template <typename StorageType, typename R,typename X1, typename X2, | 1460 template <typename StorageType, typename R,typename X1, typename X2, |
1413 typename X3, typename X4> | 1461 typename X3, typename X4> |
1414 struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { | 1462 struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { |
1415 typedef R(RunType)(BindStateBase*, | 1463 typedef R(RunType)(BindStateBase*, |
1416 typename CallbackParamTraits<X3>::ForwardType, | 1464 typename CallbackParamTraits<X3>::ForwardType, |
1417 typename CallbackParamTraits<X4>::ForwardType); | 1465 typename CallbackParamTraits<X4>::ForwardType); |
(...skipping 14 matching lines...) Expand all Loading... |
1432 typename Bound1UnwrapTraits::ForwardType x1 = | 1480 typename Bound1UnwrapTraits::ForwardType x1 = |
1433 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1481 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1434 typename Bound2UnwrapTraits::ForwardType x2 = | 1482 typename Bound2UnwrapTraits::ForwardType x2 = |
1435 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1483 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1436 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1484 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1437 typename StorageType::RunnableType, | 1485 typename StorageType::RunnableType, |
1438 void(typename Bound1UnwrapTraits::ForwardType, | 1486 void(typename Bound1UnwrapTraits::ForwardType, |
1439 typename Bound2UnwrapTraits::ForwardType, | 1487 typename Bound2UnwrapTraits::ForwardType, |
1440 typename CallbackParamTraits<X3>::ForwardType x3, | 1488 typename CallbackParamTraits<X3>::ForwardType x3, |
1441 typename CallbackParamTraits<X4>::ForwardType x4)> | 1489 typename CallbackParamTraits<X4>::ForwardType x4)> |
1442 ::MakeItSo(storage->runnable_, x1, x2, x3, x4); | 1490 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1491 CallbackForward(x2), CallbackForward(x3), |
| 1492 CallbackForward(x4)); |
1443 } | 1493 } |
1444 }; | 1494 }; |
1445 | 1495 |
1446 // Arity 4 -> 1. | 1496 // Arity 4 -> 1. |
1447 template <typename StorageType, typename R,typename X1, typename X2, | 1497 template <typename StorageType, typename R,typename X1, typename X2, |
1448 typename X3, typename X4> | 1498 typename X3, typename X4> |
1449 struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { | 1499 struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { |
1450 typedef R(RunType)(BindStateBase*, | 1500 typedef R(RunType)(BindStateBase*, |
1451 typename CallbackParamTraits<X4>::ForwardType); | 1501 typename CallbackParamTraits<X4>::ForwardType); |
1452 | 1502 |
(...skipping 15 matching lines...) Expand all Loading... |
1468 typename Bound2UnwrapTraits::ForwardType x2 = | 1518 typename Bound2UnwrapTraits::ForwardType x2 = |
1469 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1519 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1470 typename Bound3UnwrapTraits::ForwardType x3 = | 1520 typename Bound3UnwrapTraits::ForwardType x3 = |
1471 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1521 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1472 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1522 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1473 typename StorageType::RunnableType, | 1523 typename StorageType::RunnableType, |
1474 void(typename Bound1UnwrapTraits::ForwardType, | 1524 void(typename Bound1UnwrapTraits::ForwardType, |
1475 typename Bound2UnwrapTraits::ForwardType, | 1525 typename Bound2UnwrapTraits::ForwardType, |
1476 typename Bound3UnwrapTraits::ForwardType, | 1526 typename Bound3UnwrapTraits::ForwardType, |
1477 typename CallbackParamTraits<X4>::ForwardType x4)> | 1527 typename CallbackParamTraits<X4>::ForwardType x4)> |
1478 ::MakeItSo(storage->runnable_, x1, x2, x3, x4); | 1528 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1529 CallbackForward(x2), CallbackForward(x3), |
| 1530 CallbackForward(x4)); |
1479 } | 1531 } |
1480 }; | 1532 }; |
1481 | 1533 |
1482 // Arity 4 -> 0. | 1534 // Arity 4 -> 0. |
1483 template <typename StorageType, typename R,typename X1, typename X2, | 1535 template <typename StorageType, typename R,typename X1, typename X2, |
1484 typename X3, typename X4> | 1536 typename X3, typename X4> |
1485 struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { | 1537 struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { |
1486 typedef R(RunType)(BindStateBase*); | 1538 typedef R(RunType)(BindStateBase*); |
1487 | 1539 |
1488 typedef R(UnboundRunType)(); | 1540 typedef R(UnboundRunType)(); |
(...skipping 16 matching lines...) Expand all Loading... |
1505 typename Bound3UnwrapTraits::ForwardType x3 = | 1557 typename Bound3UnwrapTraits::ForwardType x3 = |
1506 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1558 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1507 typename Bound4UnwrapTraits::ForwardType x4 = | 1559 typename Bound4UnwrapTraits::ForwardType x4 = |
1508 Bound4UnwrapTraits::Unwrap(storage->p4_); | 1560 Bound4UnwrapTraits::Unwrap(storage->p4_); |
1509 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1561 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1510 typename StorageType::RunnableType, | 1562 typename StorageType::RunnableType, |
1511 void(typename Bound1UnwrapTraits::ForwardType, | 1563 void(typename Bound1UnwrapTraits::ForwardType, |
1512 typename Bound2UnwrapTraits::ForwardType, | 1564 typename Bound2UnwrapTraits::ForwardType, |
1513 typename Bound3UnwrapTraits::ForwardType, | 1565 typename Bound3UnwrapTraits::ForwardType, |
1514 typename Bound4UnwrapTraits::ForwardType)> | 1566 typename Bound4UnwrapTraits::ForwardType)> |
1515 ::MakeItSo(storage->runnable_, x1, x2, x3, x4); | 1567 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1568 CallbackForward(x2), CallbackForward(x3), |
| 1569 CallbackForward(x4)); |
1516 } | 1570 } |
1517 }; | 1571 }; |
1518 | 1572 |
1519 // Arity 5 -> 5. | 1573 // Arity 5 -> 5. |
1520 template <typename StorageType, typename R,typename X1, typename X2, | 1574 template <typename StorageType, typename R,typename X1, typename X2, |
1521 typename X3, typename X4, typename X5> | 1575 typename X3, typename X4, typename X5> |
1522 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { | 1576 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { |
1523 typedef R(RunType)(BindStateBase*, | 1577 typedef R(RunType)(BindStateBase*, |
1524 typename CallbackParamTraits<X1>::ForwardType, | 1578 typename CallbackParamTraits<X1>::ForwardType, |
1525 typename CallbackParamTraits<X2>::ForwardType, | 1579 typename CallbackParamTraits<X2>::ForwardType, |
(...skipping 15 matching lines...) Expand all Loading... |
1541 // you really want to warp ahead and step through the | 1595 // you really want to warp ahead and step through the |
1542 // InvokeHelper<>::MakeItSo() call below. | 1596 // InvokeHelper<>::MakeItSo() call below. |
1543 | 1597 |
1544 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1598 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1545 typename StorageType::RunnableType, | 1599 typename StorageType::RunnableType, |
1546 void(typename CallbackParamTraits<X1>::ForwardType x1, | 1600 void(typename CallbackParamTraits<X1>::ForwardType x1, |
1547 typename CallbackParamTraits<X2>::ForwardType x2, | 1601 typename CallbackParamTraits<X2>::ForwardType x2, |
1548 typename CallbackParamTraits<X3>::ForwardType x3, | 1602 typename CallbackParamTraits<X3>::ForwardType x3, |
1549 typename CallbackParamTraits<X4>::ForwardType x4, | 1603 typename CallbackParamTraits<X4>::ForwardType x4, |
1550 typename CallbackParamTraits<X5>::ForwardType x5)> | 1604 typename CallbackParamTraits<X5>::ForwardType x5)> |
1551 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1605 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1606 CallbackForward(x2), CallbackForward(x3), |
| 1607 CallbackForward(x4), CallbackForward(x5)); |
1552 } | 1608 } |
1553 }; | 1609 }; |
1554 | 1610 |
1555 // Arity 5 -> 4. | 1611 // Arity 5 -> 4. |
1556 template <typename StorageType, typename R,typename X1, typename X2, | 1612 template <typename StorageType, typename R,typename X1, typename X2, |
1557 typename X3, typename X4, typename X5> | 1613 typename X3, typename X4, typename X5> |
1558 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { | 1614 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { |
1559 typedef R(RunType)(BindStateBase*, | 1615 typedef R(RunType)(BindStateBase*, |
1560 typename CallbackParamTraits<X2>::ForwardType, | 1616 typename CallbackParamTraits<X2>::ForwardType, |
1561 typename CallbackParamTraits<X3>::ForwardType, | 1617 typename CallbackParamTraits<X3>::ForwardType, |
(...skipping 16 matching lines...) Expand all Loading... |
1578 | 1634 |
1579 typename Bound1UnwrapTraits::ForwardType x1 = | 1635 typename Bound1UnwrapTraits::ForwardType x1 = |
1580 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1636 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1581 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1637 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1582 typename StorageType::RunnableType, | 1638 typename StorageType::RunnableType, |
1583 void(typename Bound1UnwrapTraits::ForwardType, | 1639 void(typename Bound1UnwrapTraits::ForwardType, |
1584 typename CallbackParamTraits<X2>::ForwardType x2, | 1640 typename CallbackParamTraits<X2>::ForwardType x2, |
1585 typename CallbackParamTraits<X3>::ForwardType x3, | 1641 typename CallbackParamTraits<X3>::ForwardType x3, |
1586 typename CallbackParamTraits<X4>::ForwardType x4, | 1642 typename CallbackParamTraits<X4>::ForwardType x4, |
1587 typename CallbackParamTraits<X5>::ForwardType x5)> | 1643 typename CallbackParamTraits<X5>::ForwardType x5)> |
1588 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1644 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1645 CallbackForward(x2), CallbackForward(x3), |
| 1646 CallbackForward(x4), CallbackForward(x5)); |
1589 } | 1647 } |
1590 }; | 1648 }; |
1591 | 1649 |
1592 // Arity 5 -> 3. | 1650 // Arity 5 -> 3. |
1593 template <typename StorageType, typename R,typename X1, typename X2, | 1651 template <typename StorageType, typename R,typename X1, typename X2, |
1594 typename X3, typename X4, typename X5> | 1652 typename X3, typename X4, typename X5> |
1595 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { | 1653 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { |
1596 typedef R(RunType)(BindStateBase*, | 1654 typedef R(RunType)(BindStateBase*, |
1597 typename CallbackParamTraits<X3>::ForwardType, | 1655 typename CallbackParamTraits<X3>::ForwardType, |
1598 typename CallbackParamTraits<X4>::ForwardType, | 1656 typename CallbackParamTraits<X4>::ForwardType, |
(...skipping 17 matching lines...) Expand all Loading... |
1616 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1674 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1617 typename Bound2UnwrapTraits::ForwardType x2 = | 1675 typename Bound2UnwrapTraits::ForwardType x2 = |
1618 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1676 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1619 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1677 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1620 typename StorageType::RunnableType, | 1678 typename StorageType::RunnableType, |
1621 void(typename Bound1UnwrapTraits::ForwardType, | 1679 void(typename Bound1UnwrapTraits::ForwardType, |
1622 typename Bound2UnwrapTraits::ForwardType, | 1680 typename Bound2UnwrapTraits::ForwardType, |
1623 typename CallbackParamTraits<X3>::ForwardType x3, | 1681 typename CallbackParamTraits<X3>::ForwardType x3, |
1624 typename CallbackParamTraits<X4>::ForwardType x4, | 1682 typename CallbackParamTraits<X4>::ForwardType x4, |
1625 typename CallbackParamTraits<X5>::ForwardType x5)> | 1683 typename CallbackParamTraits<X5>::ForwardType x5)> |
1626 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1684 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1685 CallbackForward(x2), CallbackForward(x3), |
| 1686 CallbackForward(x4), CallbackForward(x5)); |
1627 } | 1687 } |
1628 }; | 1688 }; |
1629 | 1689 |
1630 // Arity 5 -> 2. | 1690 // Arity 5 -> 2. |
1631 template <typename StorageType, typename R,typename X1, typename X2, | 1691 template <typename StorageType, typename R,typename X1, typename X2, |
1632 typename X3, typename X4, typename X5> | 1692 typename X3, typename X4, typename X5> |
1633 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { | 1693 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { |
1634 typedef R(RunType)(BindStateBase*, | 1694 typedef R(RunType)(BindStateBase*, |
1635 typename CallbackParamTraits<X4>::ForwardType, | 1695 typename CallbackParamTraits<X4>::ForwardType, |
1636 typename CallbackParamTraits<X5>::ForwardType); | 1696 typename CallbackParamTraits<X5>::ForwardType); |
(...skipping 18 matching lines...) Expand all Loading... |
1655 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1715 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1656 typename Bound3UnwrapTraits::ForwardType x3 = | 1716 typename Bound3UnwrapTraits::ForwardType x3 = |
1657 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1717 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1658 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1718 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1659 typename StorageType::RunnableType, | 1719 typename StorageType::RunnableType, |
1660 void(typename Bound1UnwrapTraits::ForwardType, | 1720 void(typename Bound1UnwrapTraits::ForwardType, |
1661 typename Bound2UnwrapTraits::ForwardType, | 1721 typename Bound2UnwrapTraits::ForwardType, |
1662 typename Bound3UnwrapTraits::ForwardType, | 1722 typename Bound3UnwrapTraits::ForwardType, |
1663 typename CallbackParamTraits<X4>::ForwardType x4, | 1723 typename CallbackParamTraits<X4>::ForwardType x4, |
1664 typename CallbackParamTraits<X5>::ForwardType x5)> | 1724 typename CallbackParamTraits<X5>::ForwardType x5)> |
1665 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1725 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1726 CallbackForward(x2), CallbackForward(x3), |
| 1727 CallbackForward(x4), CallbackForward(x5)); |
1666 } | 1728 } |
1667 }; | 1729 }; |
1668 | 1730 |
1669 // Arity 5 -> 1. | 1731 // Arity 5 -> 1. |
1670 template <typename StorageType, typename R,typename X1, typename X2, | 1732 template <typename StorageType, typename R,typename X1, typename X2, |
1671 typename X3, typename X4, typename X5> | 1733 typename X3, typename X4, typename X5> |
1672 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { | 1734 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { |
1673 typedef R(RunType)(BindStateBase*, | 1735 typedef R(RunType)(BindStateBase*, |
1674 typename CallbackParamTraits<X5>::ForwardType); | 1736 typename CallbackParamTraits<X5>::ForwardType); |
1675 | 1737 |
(...skipping 19 matching lines...) Expand all Loading... |
1695 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1757 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1696 typename Bound4UnwrapTraits::ForwardType x4 = | 1758 typename Bound4UnwrapTraits::ForwardType x4 = |
1697 Bound4UnwrapTraits::Unwrap(storage->p4_); | 1759 Bound4UnwrapTraits::Unwrap(storage->p4_); |
1698 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1760 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1699 typename StorageType::RunnableType, | 1761 typename StorageType::RunnableType, |
1700 void(typename Bound1UnwrapTraits::ForwardType, | 1762 void(typename Bound1UnwrapTraits::ForwardType, |
1701 typename Bound2UnwrapTraits::ForwardType, | 1763 typename Bound2UnwrapTraits::ForwardType, |
1702 typename Bound3UnwrapTraits::ForwardType, | 1764 typename Bound3UnwrapTraits::ForwardType, |
1703 typename Bound4UnwrapTraits::ForwardType, | 1765 typename Bound4UnwrapTraits::ForwardType, |
1704 typename CallbackParamTraits<X5>::ForwardType x5)> | 1766 typename CallbackParamTraits<X5>::ForwardType x5)> |
1705 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1767 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1768 CallbackForward(x2), CallbackForward(x3), |
| 1769 CallbackForward(x4), CallbackForward(x5)); |
1706 } | 1770 } |
1707 }; | 1771 }; |
1708 | 1772 |
1709 // Arity 5 -> 0. | 1773 // Arity 5 -> 0. |
1710 template <typename StorageType, typename R,typename X1, typename X2, | 1774 template <typename StorageType, typename R,typename X1, typename X2, |
1711 typename X3, typename X4, typename X5> | 1775 typename X3, typename X4, typename X5> |
1712 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { | 1776 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { |
1713 typedef R(RunType)(BindStateBase*); | 1777 typedef R(RunType)(BindStateBase*); |
1714 | 1778 |
1715 typedef R(UnboundRunType)(); | 1779 typedef R(UnboundRunType)(); |
(...skipping 20 matching lines...) Expand all Loading... |
1736 Bound4UnwrapTraits::Unwrap(storage->p4_); | 1800 Bound4UnwrapTraits::Unwrap(storage->p4_); |
1737 typename Bound5UnwrapTraits::ForwardType x5 = | 1801 typename Bound5UnwrapTraits::ForwardType x5 = |
1738 Bound5UnwrapTraits::Unwrap(storage->p5_); | 1802 Bound5UnwrapTraits::Unwrap(storage->p5_); |
1739 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1803 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1740 typename StorageType::RunnableType, | 1804 typename StorageType::RunnableType, |
1741 void(typename Bound1UnwrapTraits::ForwardType, | 1805 void(typename Bound1UnwrapTraits::ForwardType, |
1742 typename Bound2UnwrapTraits::ForwardType, | 1806 typename Bound2UnwrapTraits::ForwardType, |
1743 typename Bound3UnwrapTraits::ForwardType, | 1807 typename Bound3UnwrapTraits::ForwardType, |
1744 typename Bound4UnwrapTraits::ForwardType, | 1808 typename Bound4UnwrapTraits::ForwardType, |
1745 typename Bound5UnwrapTraits::ForwardType)> | 1809 typename Bound5UnwrapTraits::ForwardType)> |
1746 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5); | 1810 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1811 CallbackForward(x2), CallbackForward(x3), |
| 1812 CallbackForward(x4), CallbackForward(x5)); |
1747 } | 1813 } |
1748 }; | 1814 }; |
1749 | 1815 |
1750 // Arity 6 -> 6. | 1816 // Arity 6 -> 6. |
1751 template <typename StorageType, typename R,typename X1, typename X2, | 1817 template <typename StorageType, typename R,typename X1, typename X2, |
1752 typename X3, typename X4, typename X5, typename X6> | 1818 typename X3, typename X4, typename X5, typename X6> |
1753 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 1819 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1754 typedef R(RunType)(BindStateBase*, | 1820 typedef R(RunType)(BindStateBase*, |
1755 typename CallbackParamTraits<X1>::ForwardType, | 1821 typename CallbackParamTraits<X1>::ForwardType, |
1756 typename CallbackParamTraits<X2>::ForwardType, | 1822 typename CallbackParamTraits<X2>::ForwardType, |
(...skipping 18 matching lines...) Expand all Loading... |
1775 // InvokeHelper<>::MakeItSo() call below. | 1841 // InvokeHelper<>::MakeItSo() call below. |
1776 | 1842 |
1777 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1843 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1778 typename StorageType::RunnableType, | 1844 typename StorageType::RunnableType, |
1779 void(typename CallbackParamTraits<X1>::ForwardType x1, | 1845 void(typename CallbackParamTraits<X1>::ForwardType x1, |
1780 typename CallbackParamTraits<X2>::ForwardType x2, | 1846 typename CallbackParamTraits<X2>::ForwardType x2, |
1781 typename CallbackParamTraits<X3>::ForwardType x3, | 1847 typename CallbackParamTraits<X3>::ForwardType x3, |
1782 typename CallbackParamTraits<X4>::ForwardType x4, | 1848 typename CallbackParamTraits<X4>::ForwardType x4, |
1783 typename CallbackParamTraits<X5>::ForwardType x5, | 1849 typename CallbackParamTraits<X5>::ForwardType x5, |
1784 typename CallbackParamTraits<X6>::ForwardType x6)> | 1850 typename CallbackParamTraits<X6>::ForwardType x6)> |
1785 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 1851 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1852 CallbackForward(x2), CallbackForward(x3), |
| 1853 CallbackForward(x4), CallbackForward(x5), |
| 1854 CallbackForward(x6)); |
1786 } | 1855 } |
1787 }; | 1856 }; |
1788 | 1857 |
1789 // Arity 6 -> 5. | 1858 // Arity 6 -> 5. |
1790 template <typename StorageType, typename R,typename X1, typename X2, | 1859 template <typename StorageType, typename R,typename X1, typename X2, |
1791 typename X3, typename X4, typename X5, typename X6> | 1860 typename X3, typename X4, typename X5, typename X6> |
1792 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 1861 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1793 typedef R(RunType)(BindStateBase*, | 1862 typedef R(RunType)(BindStateBase*, |
1794 typename CallbackParamTraits<X2>::ForwardType, | 1863 typename CallbackParamTraits<X2>::ForwardType, |
1795 typename CallbackParamTraits<X3>::ForwardType, | 1864 typename CallbackParamTraits<X3>::ForwardType, |
(...skipping 19 matching lines...) Expand all Loading... |
1815 typename Bound1UnwrapTraits::ForwardType x1 = | 1884 typename Bound1UnwrapTraits::ForwardType x1 = |
1816 Bound1UnwrapTraits::Unwrap(storage->p1_); | 1885 Bound1UnwrapTraits::Unwrap(storage->p1_); |
1817 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1886 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1818 typename StorageType::RunnableType, | 1887 typename StorageType::RunnableType, |
1819 void(typename Bound1UnwrapTraits::ForwardType, | 1888 void(typename Bound1UnwrapTraits::ForwardType, |
1820 typename CallbackParamTraits<X2>::ForwardType x2, | 1889 typename CallbackParamTraits<X2>::ForwardType x2, |
1821 typename CallbackParamTraits<X3>::ForwardType x3, | 1890 typename CallbackParamTraits<X3>::ForwardType x3, |
1822 typename CallbackParamTraits<X4>::ForwardType x4, | 1891 typename CallbackParamTraits<X4>::ForwardType x4, |
1823 typename CallbackParamTraits<X5>::ForwardType x5, | 1892 typename CallbackParamTraits<X5>::ForwardType x5, |
1824 typename CallbackParamTraits<X6>::ForwardType x6)> | 1893 typename CallbackParamTraits<X6>::ForwardType x6)> |
1825 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 1894 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1895 CallbackForward(x2), CallbackForward(x3), |
| 1896 CallbackForward(x4), CallbackForward(x5), |
| 1897 CallbackForward(x6)); |
1826 } | 1898 } |
1827 }; | 1899 }; |
1828 | 1900 |
1829 // Arity 6 -> 4. | 1901 // Arity 6 -> 4. |
1830 template <typename StorageType, typename R,typename X1, typename X2, | 1902 template <typename StorageType, typename R,typename X1, typename X2, |
1831 typename X3, typename X4, typename X5, typename X6> | 1903 typename X3, typename X4, typename X5, typename X6> |
1832 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 1904 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1833 typedef R(RunType)(BindStateBase*, | 1905 typedef R(RunType)(BindStateBase*, |
1834 typename CallbackParamTraits<X3>::ForwardType, | 1906 typename CallbackParamTraits<X3>::ForwardType, |
1835 typename CallbackParamTraits<X4>::ForwardType, | 1907 typename CallbackParamTraits<X4>::ForwardType, |
(...skipping 20 matching lines...) Expand all Loading... |
1856 typename Bound2UnwrapTraits::ForwardType x2 = | 1928 typename Bound2UnwrapTraits::ForwardType x2 = |
1857 Bound2UnwrapTraits::Unwrap(storage->p2_); | 1929 Bound2UnwrapTraits::Unwrap(storage->p2_); |
1858 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1930 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1859 typename StorageType::RunnableType, | 1931 typename StorageType::RunnableType, |
1860 void(typename Bound1UnwrapTraits::ForwardType, | 1932 void(typename Bound1UnwrapTraits::ForwardType, |
1861 typename Bound2UnwrapTraits::ForwardType, | 1933 typename Bound2UnwrapTraits::ForwardType, |
1862 typename CallbackParamTraits<X3>::ForwardType x3, | 1934 typename CallbackParamTraits<X3>::ForwardType x3, |
1863 typename CallbackParamTraits<X4>::ForwardType x4, | 1935 typename CallbackParamTraits<X4>::ForwardType x4, |
1864 typename CallbackParamTraits<X5>::ForwardType x5, | 1936 typename CallbackParamTraits<X5>::ForwardType x5, |
1865 typename CallbackParamTraits<X6>::ForwardType x6)> | 1937 typename CallbackParamTraits<X6>::ForwardType x6)> |
1866 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 1938 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1939 CallbackForward(x2), CallbackForward(x3), |
| 1940 CallbackForward(x4), CallbackForward(x5), |
| 1941 CallbackForward(x6)); |
1867 } | 1942 } |
1868 }; | 1943 }; |
1869 | 1944 |
1870 // Arity 6 -> 3. | 1945 // Arity 6 -> 3. |
1871 template <typename StorageType, typename R,typename X1, typename X2, | 1946 template <typename StorageType, typename R,typename X1, typename X2, |
1872 typename X3, typename X4, typename X5, typename X6> | 1947 typename X3, typename X4, typename X5, typename X6> |
1873 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 1948 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1874 typedef R(RunType)(BindStateBase*, | 1949 typedef R(RunType)(BindStateBase*, |
1875 typename CallbackParamTraits<X4>::ForwardType, | 1950 typename CallbackParamTraits<X4>::ForwardType, |
1876 typename CallbackParamTraits<X5>::ForwardType, | 1951 typename CallbackParamTraits<X5>::ForwardType, |
(...skipping 21 matching lines...) Expand all Loading... |
1898 typename Bound3UnwrapTraits::ForwardType x3 = | 1973 typename Bound3UnwrapTraits::ForwardType x3 = |
1899 Bound3UnwrapTraits::Unwrap(storage->p3_); | 1974 Bound3UnwrapTraits::Unwrap(storage->p3_); |
1900 return InvokeHelper<StorageType::IsWeakCall::value, R, | 1975 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1901 typename StorageType::RunnableType, | 1976 typename StorageType::RunnableType, |
1902 void(typename Bound1UnwrapTraits::ForwardType, | 1977 void(typename Bound1UnwrapTraits::ForwardType, |
1903 typename Bound2UnwrapTraits::ForwardType, | 1978 typename Bound2UnwrapTraits::ForwardType, |
1904 typename Bound3UnwrapTraits::ForwardType, | 1979 typename Bound3UnwrapTraits::ForwardType, |
1905 typename CallbackParamTraits<X4>::ForwardType x4, | 1980 typename CallbackParamTraits<X4>::ForwardType x4, |
1906 typename CallbackParamTraits<X5>::ForwardType x5, | 1981 typename CallbackParamTraits<X5>::ForwardType x5, |
1907 typename CallbackParamTraits<X6>::ForwardType x6)> | 1982 typename CallbackParamTraits<X6>::ForwardType x6)> |
1908 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 1983 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 1984 CallbackForward(x2), CallbackForward(x3), |
| 1985 CallbackForward(x4), CallbackForward(x5), |
| 1986 CallbackForward(x6)); |
1909 } | 1987 } |
1910 }; | 1988 }; |
1911 | 1989 |
1912 // Arity 6 -> 2. | 1990 // Arity 6 -> 2. |
1913 template <typename StorageType, typename R,typename X1, typename X2, | 1991 template <typename StorageType, typename R,typename X1, typename X2, |
1914 typename X3, typename X4, typename X5, typename X6> | 1992 typename X3, typename X4, typename X5, typename X6> |
1915 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 1993 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1916 typedef R(RunType)(BindStateBase*, | 1994 typedef R(RunType)(BindStateBase*, |
1917 typename CallbackParamTraits<X5>::ForwardType, | 1995 typename CallbackParamTraits<X5>::ForwardType, |
1918 typename CallbackParamTraits<X6>::ForwardType); | 1996 typename CallbackParamTraits<X6>::ForwardType); |
(...skipping 22 matching lines...) Expand all Loading... |
1941 typename Bound4UnwrapTraits::ForwardType x4 = | 2019 typename Bound4UnwrapTraits::ForwardType x4 = |
1942 Bound4UnwrapTraits::Unwrap(storage->p4_); | 2020 Bound4UnwrapTraits::Unwrap(storage->p4_); |
1943 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2021 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1944 typename StorageType::RunnableType, | 2022 typename StorageType::RunnableType, |
1945 void(typename Bound1UnwrapTraits::ForwardType, | 2023 void(typename Bound1UnwrapTraits::ForwardType, |
1946 typename Bound2UnwrapTraits::ForwardType, | 2024 typename Bound2UnwrapTraits::ForwardType, |
1947 typename Bound3UnwrapTraits::ForwardType, | 2025 typename Bound3UnwrapTraits::ForwardType, |
1948 typename Bound4UnwrapTraits::ForwardType, | 2026 typename Bound4UnwrapTraits::ForwardType, |
1949 typename CallbackParamTraits<X5>::ForwardType x5, | 2027 typename CallbackParamTraits<X5>::ForwardType x5, |
1950 typename CallbackParamTraits<X6>::ForwardType x6)> | 2028 typename CallbackParamTraits<X6>::ForwardType x6)> |
1951 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 2029 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2030 CallbackForward(x2), CallbackForward(x3), |
| 2031 CallbackForward(x4), CallbackForward(x5), |
| 2032 CallbackForward(x6)); |
1952 } | 2033 } |
1953 }; | 2034 }; |
1954 | 2035 |
1955 // Arity 6 -> 1. | 2036 // Arity 6 -> 1. |
1956 template <typename StorageType, typename R,typename X1, typename X2, | 2037 template <typename StorageType, typename R,typename X1, typename X2, |
1957 typename X3, typename X4, typename X5, typename X6> | 2038 typename X3, typename X4, typename X5, typename X6> |
1958 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 2039 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
1959 typedef R(RunType)(BindStateBase*, | 2040 typedef R(RunType)(BindStateBase*, |
1960 typename CallbackParamTraits<X6>::ForwardType); | 2041 typename CallbackParamTraits<X6>::ForwardType); |
1961 | 2042 |
(...skipping 23 matching lines...) Expand all Loading... |
1985 typename Bound5UnwrapTraits::ForwardType x5 = | 2066 typename Bound5UnwrapTraits::ForwardType x5 = |
1986 Bound5UnwrapTraits::Unwrap(storage->p5_); | 2067 Bound5UnwrapTraits::Unwrap(storage->p5_); |
1987 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2068 return InvokeHelper<StorageType::IsWeakCall::value, R, |
1988 typename StorageType::RunnableType, | 2069 typename StorageType::RunnableType, |
1989 void(typename Bound1UnwrapTraits::ForwardType, | 2070 void(typename Bound1UnwrapTraits::ForwardType, |
1990 typename Bound2UnwrapTraits::ForwardType, | 2071 typename Bound2UnwrapTraits::ForwardType, |
1991 typename Bound3UnwrapTraits::ForwardType, | 2072 typename Bound3UnwrapTraits::ForwardType, |
1992 typename Bound4UnwrapTraits::ForwardType, | 2073 typename Bound4UnwrapTraits::ForwardType, |
1993 typename Bound5UnwrapTraits::ForwardType, | 2074 typename Bound5UnwrapTraits::ForwardType, |
1994 typename CallbackParamTraits<X6>::ForwardType x6)> | 2075 typename CallbackParamTraits<X6>::ForwardType x6)> |
1995 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 2076 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2077 CallbackForward(x2), CallbackForward(x3), |
| 2078 CallbackForward(x4), CallbackForward(x5), |
| 2079 CallbackForward(x6)); |
1996 } | 2080 } |
1997 }; | 2081 }; |
1998 | 2082 |
1999 // Arity 6 -> 0. | 2083 // Arity 6 -> 0. |
2000 template <typename StorageType, typename R,typename X1, typename X2, | 2084 template <typename StorageType, typename R,typename X1, typename X2, |
2001 typename X3, typename X4, typename X5, typename X6> | 2085 typename X3, typename X4, typename X5, typename X6> |
2002 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { | 2086 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { |
2003 typedef R(RunType)(BindStateBase*); | 2087 typedef R(RunType)(BindStateBase*); |
2004 | 2088 |
2005 typedef R(UnboundRunType)(); | 2089 typedef R(UnboundRunType)(); |
(...skipping 24 matching lines...) Expand all Loading... |
2030 typename Bound6UnwrapTraits::ForwardType x6 = | 2114 typename Bound6UnwrapTraits::ForwardType x6 = |
2031 Bound6UnwrapTraits::Unwrap(storage->p6_); | 2115 Bound6UnwrapTraits::Unwrap(storage->p6_); |
2032 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2116 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2033 typename StorageType::RunnableType, | 2117 typename StorageType::RunnableType, |
2034 void(typename Bound1UnwrapTraits::ForwardType, | 2118 void(typename Bound1UnwrapTraits::ForwardType, |
2035 typename Bound2UnwrapTraits::ForwardType, | 2119 typename Bound2UnwrapTraits::ForwardType, |
2036 typename Bound3UnwrapTraits::ForwardType, | 2120 typename Bound3UnwrapTraits::ForwardType, |
2037 typename Bound4UnwrapTraits::ForwardType, | 2121 typename Bound4UnwrapTraits::ForwardType, |
2038 typename Bound5UnwrapTraits::ForwardType, | 2122 typename Bound5UnwrapTraits::ForwardType, |
2039 typename Bound6UnwrapTraits::ForwardType)> | 2123 typename Bound6UnwrapTraits::ForwardType)> |
2040 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6); | 2124 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2125 CallbackForward(x2), CallbackForward(x3), |
| 2126 CallbackForward(x4), CallbackForward(x5), |
| 2127 CallbackForward(x6)); |
2041 } | 2128 } |
2042 }; | 2129 }; |
2043 | 2130 |
2044 // Arity 7 -> 7. | 2131 // Arity 7 -> 7. |
2045 template <typename StorageType, typename R,typename X1, typename X2, | 2132 template <typename StorageType, typename R,typename X1, typename X2, |
2046 typename X3, typename X4, typename X5, typename X6, typename X7> | 2133 typename X3, typename X4, typename X5, typename X6, typename X7> |
2047 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2134 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2048 typedef R(RunType)(BindStateBase*, | 2135 typedef R(RunType)(BindStateBase*, |
2049 typename CallbackParamTraits<X1>::ForwardType, | 2136 typename CallbackParamTraits<X1>::ForwardType, |
2050 typename CallbackParamTraits<X2>::ForwardType, | 2137 typename CallbackParamTraits<X2>::ForwardType, |
(...skipping 21 matching lines...) Expand all Loading... |
2072 | 2159 |
2073 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2160 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2074 typename StorageType::RunnableType, | 2161 typename StorageType::RunnableType, |
2075 void(typename CallbackParamTraits<X1>::ForwardType x1, | 2162 void(typename CallbackParamTraits<X1>::ForwardType x1, |
2076 typename CallbackParamTraits<X2>::ForwardType x2, | 2163 typename CallbackParamTraits<X2>::ForwardType x2, |
2077 typename CallbackParamTraits<X3>::ForwardType x3, | 2164 typename CallbackParamTraits<X3>::ForwardType x3, |
2078 typename CallbackParamTraits<X4>::ForwardType x4, | 2165 typename CallbackParamTraits<X4>::ForwardType x4, |
2079 typename CallbackParamTraits<X5>::ForwardType x5, | 2166 typename CallbackParamTraits<X5>::ForwardType x5, |
2080 typename CallbackParamTraits<X6>::ForwardType x6, | 2167 typename CallbackParamTraits<X6>::ForwardType x6, |
2081 typename CallbackParamTraits<X7>::ForwardType x7)> | 2168 typename CallbackParamTraits<X7>::ForwardType x7)> |
2082 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2169 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2170 CallbackForward(x2), CallbackForward(x3), |
| 2171 CallbackForward(x4), CallbackForward(x5), |
| 2172 CallbackForward(x6), CallbackForward(x7)); |
2083 } | 2173 } |
2084 }; | 2174 }; |
2085 | 2175 |
2086 // Arity 7 -> 6. | 2176 // Arity 7 -> 6. |
2087 template <typename StorageType, typename R,typename X1, typename X2, | 2177 template <typename StorageType, typename R,typename X1, typename X2, |
2088 typename X3, typename X4, typename X5, typename X6, typename X7> | 2178 typename X3, typename X4, typename X5, typename X6, typename X7> |
2089 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2179 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2090 typedef R(RunType)(BindStateBase*, | 2180 typedef R(RunType)(BindStateBase*, |
2091 typename CallbackParamTraits<X2>::ForwardType, | 2181 typename CallbackParamTraits<X2>::ForwardType, |
2092 typename CallbackParamTraits<X3>::ForwardType, | 2182 typename CallbackParamTraits<X3>::ForwardType, |
(...skipping 22 matching lines...) Expand all Loading... |
2115 Bound1UnwrapTraits::Unwrap(storage->p1_); | 2205 Bound1UnwrapTraits::Unwrap(storage->p1_); |
2116 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2206 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2117 typename StorageType::RunnableType, | 2207 typename StorageType::RunnableType, |
2118 void(typename Bound1UnwrapTraits::ForwardType, | 2208 void(typename Bound1UnwrapTraits::ForwardType, |
2119 typename CallbackParamTraits<X2>::ForwardType x2, | 2209 typename CallbackParamTraits<X2>::ForwardType x2, |
2120 typename CallbackParamTraits<X3>::ForwardType x3, | 2210 typename CallbackParamTraits<X3>::ForwardType x3, |
2121 typename CallbackParamTraits<X4>::ForwardType x4, | 2211 typename CallbackParamTraits<X4>::ForwardType x4, |
2122 typename CallbackParamTraits<X5>::ForwardType x5, | 2212 typename CallbackParamTraits<X5>::ForwardType x5, |
2123 typename CallbackParamTraits<X6>::ForwardType x6, | 2213 typename CallbackParamTraits<X6>::ForwardType x6, |
2124 typename CallbackParamTraits<X7>::ForwardType x7)> | 2214 typename CallbackParamTraits<X7>::ForwardType x7)> |
2125 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2215 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2216 CallbackForward(x2), CallbackForward(x3), |
| 2217 CallbackForward(x4), CallbackForward(x5), |
| 2218 CallbackForward(x6), CallbackForward(x7)); |
2126 } | 2219 } |
2127 }; | 2220 }; |
2128 | 2221 |
2129 // Arity 7 -> 5. | 2222 // Arity 7 -> 5. |
2130 template <typename StorageType, typename R,typename X1, typename X2, | 2223 template <typename StorageType, typename R,typename X1, typename X2, |
2131 typename X3, typename X4, typename X5, typename X6, typename X7> | 2224 typename X3, typename X4, typename X5, typename X6, typename X7> |
2132 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2225 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2133 typedef R(RunType)(BindStateBase*, | 2226 typedef R(RunType)(BindStateBase*, |
2134 typename CallbackParamTraits<X3>::ForwardType, | 2227 typename CallbackParamTraits<X3>::ForwardType, |
2135 typename CallbackParamTraits<X4>::ForwardType, | 2228 typename CallbackParamTraits<X4>::ForwardType, |
(...skipping 23 matching lines...) Expand all Loading... |
2159 Bound2UnwrapTraits::Unwrap(storage->p2_); | 2252 Bound2UnwrapTraits::Unwrap(storage->p2_); |
2160 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2253 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2161 typename StorageType::RunnableType, | 2254 typename StorageType::RunnableType, |
2162 void(typename Bound1UnwrapTraits::ForwardType, | 2255 void(typename Bound1UnwrapTraits::ForwardType, |
2163 typename Bound2UnwrapTraits::ForwardType, | 2256 typename Bound2UnwrapTraits::ForwardType, |
2164 typename CallbackParamTraits<X3>::ForwardType x3, | 2257 typename CallbackParamTraits<X3>::ForwardType x3, |
2165 typename CallbackParamTraits<X4>::ForwardType x4, | 2258 typename CallbackParamTraits<X4>::ForwardType x4, |
2166 typename CallbackParamTraits<X5>::ForwardType x5, | 2259 typename CallbackParamTraits<X5>::ForwardType x5, |
2167 typename CallbackParamTraits<X6>::ForwardType x6, | 2260 typename CallbackParamTraits<X6>::ForwardType x6, |
2168 typename CallbackParamTraits<X7>::ForwardType x7)> | 2261 typename CallbackParamTraits<X7>::ForwardType x7)> |
2169 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2262 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2263 CallbackForward(x2), CallbackForward(x3), |
| 2264 CallbackForward(x4), CallbackForward(x5), |
| 2265 CallbackForward(x6), CallbackForward(x7)); |
2170 } | 2266 } |
2171 }; | 2267 }; |
2172 | 2268 |
2173 // Arity 7 -> 4. | 2269 // Arity 7 -> 4. |
2174 template <typename StorageType, typename R,typename X1, typename X2, | 2270 template <typename StorageType, typename R,typename X1, typename X2, |
2175 typename X3, typename X4, typename X5, typename X6, typename X7> | 2271 typename X3, typename X4, typename X5, typename X6, typename X7> |
2176 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2272 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2177 typedef R(RunType)(BindStateBase*, | 2273 typedef R(RunType)(BindStateBase*, |
2178 typename CallbackParamTraits<X4>::ForwardType, | 2274 typename CallbackParamTraits<X4>::ForwardType, |
2179 typename CallbackParamTraits<X5>::ForwardType, | 2275 typename CallbackParamTraits<X5>::ForwardType, |
(...skipping 24 matching lines...) Expand all Loading... |
2204 Bound3UnwrapTraits::Unwrap(storage->p3_); | 2300 Bound3UnwrapTraits::Unwrap(storage->p3_); |
2205 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2301 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2206 typename StorageType::RunnableType, | 2302 typename StorageType::RunnableType, |
2207 void(typename Bound1UnwrapTraits::ForwardType, | 2303 void(typename Bound1UnwrapTraits::ForwardType, |
2208 typename Bound2UnwrapTraits::ForwardType, | 2304 typename Bound2UnwrapTraits::ForwardType, |
2209 typename Bound3UnwrapTraits::ForwardType, | 2305 typename Bound3UnwrapTraits::ForwardType, |
2210 typename CallbackParamTraits<X4>::ForwardType x4, | 2306 typename CallbackParamTraits<X4>::ForwardType x4, |
2211 typename CallbackParamTraits<X5>::ForwardType x5, | 2307 typename CallbackParamTraits<X5>::ForwardType x5, |
2212 typename CallbackParamTraits<X6>::ForwardType x6, | 2308 typename CallbackParamTraits<X6>::ForwardType x6, |
2213 typename CallbackParamTraits<X7>::ForwardType x7)> | 2309 typename CallbackParamTraits<X7>::ForwardType x7)> |
2214 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2310 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2311 CallbackForward(x2), CallbackForward(x3), |
| 2312 CallbackForward(x4), CallbackForward(x5), |
| 2313 CallbackForward(x6), CallbackForward(x7)); |
2215 } | 2314 } |
2216 }; | 2315 }; |
2217 | 2316 |
2218 // Arity 7 -> 3. | 2317 // Arity 7 -> 3. |
2219 template <typename StorageType, typename R,typename X1, typename X2, | 2318 template <typename StorageType, typename R,typename X1, typename X2, |
2220 typename X3, typename X4, typename X5, typename X6, typename X7> | 2319 typename X3, typename X4, typename X5, typename X6, typename X7> |
2221 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2320 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2222 typedef R(RunType)(BindStateBase*, | 2321 typedef R(RunType)(BindStateBase*, |
2223 typename CallbackParamTraits<X5>::ForwardType, | 2322 typename CallbackParamTraits<X5>::ForwardType, |
2224 typename CallbackParamTraits<X6>::ForwardType, | 2323 typename CallbackParamTraits<X6>::ForwardType, |
(...skipping 25 matching lines...) Expand all Loading... |
2250 Bound4UnwrapTraits::Unwrap(storage->p4_); | 2349 Bound4UnwrapTraits::Unwrap(storage->p4_); |
2251 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2350 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2252 typename StorageType::RunnableType, | 2351 typename StorageType::RunnableType, |
2253 void(typename Bound1UnwrapTraits::ForwardType, | 2352 void(typename Bound1UnwrapTraits::ForwardType, |
2254 typename Bound2UnwrapTraits::ForwardType, | 2353 typename Bound2UnwrapTraits::ForwardType, |
2255 typename Bound3UnwrapTraits::ForwardType, | 2354 typename Bound3UnwrapTraits::ForwardType, |
2256 typename Bound4UnwrapTraits::ForwardType, | 2355 typename Bound4UnwrapTraits::ForwardType, |
2257 typename CallbackParamTraits<X5>::ForwardType x5, | 2356 typename CallbackParamTraits<X5>::ForwardType x5, |
2258 typename CallbackParamTraits<X6>::ForwardType x6, | 2357 typename CallbackParamTraits<X6>::ForwardType x6, |
2259 typename CallbackParamTraits<X7>::ForwardType x7)> | 2358 typename CallbackParamTraits<X7>::ForwardType x7)> |
2260 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2359 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2360 CallbackForward(x2), CallbackForward(x3), |
| 2361 CallbackForward(x4), CallbackForward(x5), |
| 2362 CallbackForward(x6), CallbackForward(x7)); |
2261 } | 2363 } |
2262 }; | 2364 }; |
2263 | 2365 |
2264 // Arity 7 -> 2. | 2366 // Arity 7 -> 2. |
2265 template <typename StorageType, typename R,typename X1, typename X2, | 2367 template <typename StorageType, typename R,typename X1, typename X2, |
2266 typename X3, typename X4, typename X5, typename X6, typename X7> | 2368 typename X3, typename X4, typename X5, typename X6, typename X7> |
2267 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2369 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2268 typedef R(RunType)(BindStateBase*, | 2370 typedef R(RunType)(BindStateBase*, |
2269 typename CallbackParamTraits<X6>::ForwardType, | 2371 typename CallbackParamTraits<X6>::ForwardType, |
2270 typename CallbackParamTraits<X7>::ForwardType); | 2372 typename CallbackParamTraits<X7>::ForwardType); |
(...skipping 26 matching lines...) Expand all Loading... |
2297 Bound5UnwrapTraits::Unwrap(storage->p5_); | 2399 Bound5UnwrapTraits::Unwrap(storage->p5_); |
2298 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2400 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2299 typename StorageType::RunnableType, | 2401 typename StorageType::RunnableType, |
2300 void(typename Bound1UnwrapTraits::ForwardType, | 2402 void(typename Bound1UnwrapTraits::ForwardType, |
2301 typename Bound2UnwrapTraits::ForwardType, | 2403 typename Bound2UnwrapTraits::ForwardType, |
2302 typename Bound3UnwrapTraits::ForwardType, | 2404 typename Bound3UnwrapTraits::ForwardType, |
2303 typename Bound4UnwrapTraits::ForwardType, | 2405 typename Bound4UnwrapTraits::ForwardType, |
2304 typename Bound5UnwrapTraits::ForwardType, | 2406 typename Bound5UnwrapTraits::ForwardType, |
2305 typename CallbackParamTraits<X6>::ForwardType x6, | 2407 typename CallbackParamTraits<X6>::ForwardType x6, |
2306 typename CallbackParamTraits<X7>::ForwardType x7)> | 2408 typename CallbackParamTraits<X7>::ForwardType x7)> |
2307 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2409 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2410 CallbackForward(x2), CallbackForward(x3), |
| 2411 CallbackForward(x4), CallbackForward(x5), |
| 2412 CallbackForward(x6), CallbackForward(x7)); |
2308 } | 2413 } |
2309 }; | 2414 }; |
2310 | 2415 |
2311 // Arity 7 -> 1. | 2416 // Arity 7 -> 1. |
2312 template <typename StorageType, typename R,typename X1, typename X2, | 2417 template <typename StorageType, typename R,typename X1, typename X2, |
2313 typename X3, typename X4, typename X5, typename X6, typename X7> | 2418 typename X3, typename X4, typename X5, typename X6, typename X7> |
2314 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2419 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2315 typedef R(RunType)(BindStateBase*, | 2420 typedef R(RunType)(BindStateBase*, |
2316 typename CallbackParamTraits<X7>::ForwardType); | 2421 typename CallbackParamTraits<X7>::ForwardType); |
2317 | 2422 |
(...skipping 27 matching lines...) Expand all Loading... |
2345 Bound6UnwrapTraits::Unwrap(storage->p6_); | 2450 Bound6UnwrapTraits::Unwrap(storage->p6_); |
2346 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2451 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2347 typename StorageType::RunnableType, | 2452 typename StorageType::RunnableType, |
2348 void(typename Bound1UnwrapTraits::ForwardType, | 2453 void(typename Bound1UnwrapTraits::ForwardType, |
2349 typename Bound2UnwrapTraits::ForwardType, | 2454 typename Bound2UnwrapTraits::ForwardType, |
2350 typename Bound3UnwrapTraits::ForwardType, | 2455 typename Bound3UnwrapTraits::ForwardType, |
2351 typename Bound4UnwrapTraits::ForwardType, | 2456 typename Bound4UnwrapTraits::ForwardType, |
2352 typename Bound5UnwrapTraits::ForwardType, | 2457 typename Bound5UnwrapTraits::ForwardType, |
2353 typename Bound6UnwrapTraits::ForwardType, | 2458 typename Bound6UnwrapTraits::ForwardType, |
2354 typename CallbackParamTraits<X7>::ForwardType x7)> | 2459 typename CallbackParamTraits<X7>::ForwardType x7)> |
2355 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2460 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2461 CallbackForward(x2), CallbackForward(x3), |
| 2462 CallbackForward(x4), CallbackForward(x5), |
| 2463 CallbackForward(x6), CallbackForward(x7)); |
2356 } | 2464 } |
2357 }; | 2465 }; |
2358 | 2466 |
2359 // Arity 7 -> 0. | 2467 // Arity 7 -> 0. |
2360 template <typename StorageType, typename R,typename X1, typename X2, | 2468 template <typename StorageType, typename R,typename X1, typename X2, |
2361 typename X3, typename X4, typename X5, typename X6, typename X7> | 2469 typename X3, typename X4, typename X5, typename X6, typename X7> |
2362 struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | 2470 struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { |
2363 typedef R(RunType)(BindStateBase*); | 2471 typedef R(RunType)(BindStateBase*); |
2364 | 2472 |
2365 typedef R(UnboundRunType)(); | 2473 typedef R(UnboundRunType)(); |
(...skipping 28 matching lines...) Expand all Loading... |
2394 Bound7UnwrapTraits::Unwrap(storage->p7_); | 2502 Bound7UnwrapTraits::Unwrap(storage->p7_); |
2395 return InvokeHelper<StorageType::IsWeakCall::value, R, | 2503 return InvokeHelper<StorageType::IsWeakCall::value, R, |
2396 typename StorageType::RunnableType, | 2504 typename StorageType::RunnableType, |
2397 void(typename Bound1UnwrapTraits::ForwardType, | 2505 void(typename Bound1UnwrapTraits::ForwardType, |
2398 typename Bound2UnwrapTraits::ForwardType, | 2506 typename Bound2UnwrapTraits::ForwardType, |
2399 typename Bound3UnwrapTraits::ForwardType, | 2507 typename Bound3UnwrapTraits::ForwardType, |
2400 typename Bound4UnwrapTraits::ForwardType, | 2508 typename Bound4UnwrapTraits::ForwardType, |
2401 typename Bound5UnwrapTraits::ForwardType, | 2509 typename Bound5UnwrapTraits::ForwardType, |
2402 typename Bound6UnwrapTraits::ForwardType, | 2510 typename Bound6UnwrapTraits::ForwardType, |
2403 typename Bound7UnwrapTraits::ForwardType)> | 2511 typename Bound7UnwrapTraits::ForwardType)> |
2404 ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); | 2512 ::MakeItSo(storage->runnable_, CallbackForward(x1), |
| 2513 CallbackForward(x2), CallbackForward(x3), |
| 2514 CallbackForward(x4), CallbackForward(x5), |
| 2515 CallbackForward(x6), CallbackForward(x7)); |
2405 } | 2516 } |
2406 }; | 2517 }; |
2407 | 2518 |
2408 | 2519 |
2409 // BindState<> | 2520 // BindState<> |
2410 // | 2521 // |
2411 // This stores all the state passed into Bind() and is also where most | 2522 // This stores all the state passed into Bind() and is also where most |
2412 // of the template resolution magic occurs. | 2523 // of the template resolution magic occurs. |
2413 // | 2524 // |
2414 // Runnable is the functor we are binding arguments to. | 2525 // Runnable is the functor we are binding arguments to. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 P4 p4_; | 2781 P4 p4_; |
2671 P5 p5_; | 2782 P5 p5_; |
2672 P6 p6_; | 2783 P6 p6_; |
2673 P7 p7_; | 2784 P7 p7_; |
2674 }; | 2785 }; |
2675 | 2786 |
2676 } // namespace internal | 2787 } // namespace internal |
2677 } // namespace base | 2788 } // namespace base |
2678 | 2789 |
2679 #endif // BASE_BIND_INTERNAL_H_ | 2790 #endif // BASE_BIND_INTERNAL_H_ |
OLD | NEW |