Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // This file was GENERATED by command: | |
| 2 // pump.py bind_internal.h.pump | |
| 3 // DO NOT EDIT BY HAND!!! | |
| 4 | |
| 5 | |
| 6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 8 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 9 | 4 |
| 10 #ifndef BASE_BIND_INTERNAL_H_ | 5 #ifndef BASE_BIND_INTERNAL_H_ |
| 11 #define BASE_BIND_INTERNAL_H_ | 6 #define BASE_BIND_INTERNAL_H_ |
| 12 | 7 |
| 13 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 14 #include "base/callback_internal.h" | 9 #include "base/callback_internal.h" |
| 10 #include "base/callback_tuple.h" | |
| 15 #include "base/memory/raw_scoped_refptr_mismatch_checker.h" | 11 #include "base/memory/raw_scoped_refptr_mismatch_checker.h" |
| 16 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 17 #include "base/template_util.h" | 13 #include "base/template_util.h" |
| 18 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 19 | 15 |
| 20 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 21 #include "base/bind_internal_win.h" | 17 #include "base/bind_internal_win.h" |
| 22 #endif | 18 #endif |
| 23 | 19 |
| 24 namespace base { | 20 namespace base { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 44 // (Bound)ArgsType -- A function type that is being (ab)used to store the | 40 // (Bound)ArgsType -- A function type that is being (ab)used to store the |
| 45 // types of set of arguments. The "return" type is always | 41 // types of set of arguments. The "return" type is always |
| 46 // void here. We use this hack so that we do not need | 42 // void here. We use this hack so that we do not need |
| 47 // a new type name for each arity of type. (eg., | 43 // a new type name for each arity of type. (eg., |
| 48 // BindState1, BindState2). This makes forward | 44 // BindState1, BindState2). This makes forward |
| 49 // declarations and friending much much easier. | 45 // declarations and friending much much easier. |
| 50 // | 46 // |
| 51 // Types: | 47 // Types: |
| 52 // RunnableAdapter<> -- Wraps the various "function" pointer types into an | 48 // RunnableAdapter<> -- Wraps the various "function" pointer types into an |
| 53 // object that adheres to the Runnable interface. | 49 // object that adheres to the Runnable interface. |
| 54 // FunctionTraits<> -- Type traits that unwrap a function signature into a | |
| 55 // a set of easier to use typedefs. Used mainly for | |
| 56 // compile time asserts. | |
| 57 // There are |ARITY| FunctionTraits types. | |
| 58 // ForceVoidReturn<> -- Helper class for translating function signatures to | 50 // ForceVoidReturn<> -- Helper class for translating function signatures to |
| 59 // equivalent forms with a "void" return type. | 51 // equivalent forms with a "void" return type. |
| 60 // FunctorTraits<> -- Type traits used determine the correct RunType and | 52 // FunctorTraits<> -- Type traits used determine the correct RunType and |
| 61 // RunnableType for a Functor. This is where function | 53 // RunnableType for a Functor. This is where function |
| 62 // signature adapters are applied. | 54 // signature adapters are applied. |
| 63 // MakeRunnable<> -- Takes a Functor and returns an object in the Runnable | 55 // MakeRunnable<> -- Takes a Functor and returns an object in the Runnable |
| 64 // type class that represents the underlying Functor. | 56 // type class that represents the underlying Functor. |
| 65 // There are |O(1)| MakeRunnable types. | 57 // There are |O(1)| MakeRunnable types. |
| 66 // InvokeHelper<> -- Take a Runnable + arguments and actully invokes it. | 58 // InvokeHelper<> -- Take a Runnable + arguments and actully invokes it. |
| 67 // Handle the differing syntaxes needed for WeakPtr<> support, | 59 // Handle the differing syntaxes needed for WeakPtr<> support, |
| 68 // and for ignoring return values. This is separate from | 60 // and for ignoring return values. This is separate from |
| 69 // Invoker to avoid creating multiple version of Invoker<> | 61 // Invoker to avoid creating multiple version of Invoker<> |
| 70 // which grows at O(n^2) with the arity. | 62 // which grows at O(n^2) with the arity. |
|
Nico
2014/12/08 19:58:08
I guess this is still true, except that they're no
tzik
2014/12/09 14:50:27
Removed the comment. Assuming our compilers are wi
| |
| 71 // Invoker<> -- Unwraps the curried parameters and executes the Runnable. | 63 // Invoker<> -- Unwraps the curried parameters and executes the Runnable. |
| 72 // There are |(ARITY^2 + ARITY)/2| Invoketypes. | 64 // There are |(ARITY^2 + ARITY)/2| Invoketypes. |
| 73 // BindState<> -- Stores the curried parameters, and is the main entry point | 65 // BindState<> -- Stores the curried parameters, and is the main entry point |
| 74 // into the Bind() system, doing most of the type resolution. | 66 // into the Bind() system, doing most of the type resolution. |
| 75 // There are ARITY BindState types. | 67 // There are ARITY BindState types. |
| 76 | 68 |
| 77 // HasNonConstReferenceParam selects true_type when any of the parameters in | 69 // HasNonConstReferenceParam selects true_type when any of the parameters in |
| 78 // |Sig| is a non-const reference. | 70 // |Sig| is a non-const reference. |
| 79 // Implementation note: This non-specialized case handles zero-arity case only. | 71 // Implementation note: This non-specialized case handles zero-arity case only. |
| 80 // Non-zero-arity cases should be handled by the specialization below. | 72 // Non-zero-arity cases should be handled by the specialization below. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 | 194 |
| 203 R Run(const T* object, | 195 R Run(const T* object, |
| 204 typename CallbackParamTraits<Args>::ForwardType... args) { | 196 typename CallbackParamTraits<Args>::ForwardType... args) { |
| 205 return (object->*method_)(CallbackForward(args)...); | 197 return (object->*method_)(CallbackForward(args)...); |
| 206 } | 198 } |
| 207 | 199 |
| 208 private: | 200 private: |
| 209 R (T::*method_)(Args...) const; | 201 R (T::*method_)(Args...) const; |
| 210 }; | 202 }; |
| 211 | 203 |
| 212 // TODO(tzik): Remove FunctionTraits after we finish removing bind.pump. | |
| 213 // FunctionTraits<> | |
| 214 // | |
| 215 // Breaks a function signature apart into typedefs for easier introspection. | |
| 216 template <typename Sig> | |
| 217 struct FunctionTraits; | |
| 218 | |
| 219 template <typename R> | |
| 220 struct FunctionTraits<R()> { | |
| 221 typedef R ReturnType; | |
| 222 }; | |
| 223 | |
| 224 template <typename R, typename A1> | |
| 225 struct FunctionTraits<R(A1)> { | |
| 226 typedef R ReturnType; | |
| 227 typedef A1 A1Type; | |
| 228 }; | |
| 229 | |
| 230 template <typename R, typename A1, typename A2> | |
| 231 struct FunctionTraits<R(A1, A2)> { | |
| 232 typedef R ReturnType; | |
| 233 typedef A1 A1Type; | |
| 234 typedef A2 A2Type; | |
| 235 }; | |
| 236 | |
| 237 template <typename R, typename A1, typename A2, typename A3> | |
| 238 struct FunctionTraits<R(A1, A2, A3)> { | |
| 239 typedef R ReturnType; | |
| 240 typedef A1 A1Type; | |
| 241 typedef A2 A2Type; | |
| 242 typedef A3 A3Type; | |
| 243 }; | |
| 244 | |
| 245 template <typename R, typename A1, typename A2, typename A3, typename A4> | |
| 246 struct FunctionTraits<R(A1, A2, A3, A4)> { | |
| 247 typedef R ReturnType; | |
| 248 typedef A1 A1Type; | |
| 249 typedef A2 A2Type; | |
| 250 typedef A3 A3Type; | |
| 251 typedef A4 A4Type; | |
| 252 }; | |
| 253 | |
| 254 template <typename R, typename A1, typename A2, typename A3, typename A4, | |
| 255 typename A5> | |
| 256 struct FunctionTraits<R(A1, A2, A3, A4, A5)> { | |
| 257 typedef R ReturnType; | |
| 258 typedef A1 A1Type; | |
| 259 typedef A2 A2Type; | |
| 260 typedef A3 A3Type; | |
| 261 typedef A4 A4Type; | |
| 262 typedef A5 A5Type; | |
| 263 }; | |
| 264 | |
| 265 template <typename R, typename A1, typename A2, typename A3, typename A4, | |
| 266 typename A5, typename A6> | |
| 267 struct FunctionTraits<R(A1, A2, A3, A4, A5, A6)> { | |
| 268 typedef R ReturnType; | |
| 269 typedef A1 A1Type; | |
| 270 typedef A2 A2Type; | |
| 271 typedef A3 A3Type; | |
| 272 typedef A4 A4Type; | |
| 273 typedef A5 A5Type; | |
| 274 typedef A6 A6Type; | |
| 275 }; | |
| 276 | |
| 277 template <typename R, typename A1, typename A2, typename A3, typename A4, | |
| 278 typename A5, typename A6, typename A7> | |
| 279 struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7)> { | |
| 280 typedef R ReturnType; | |
| 281 typedef A1 A1Type; | |
| 282 typedef A2 A2Type; | |
| 283 typedef A3 A3Type; | |
| 284 typedef A4 A4Type; | |
| 285 typedef A5 A5Type; | |
| 286 typedef A6 A6Type; | |
| 287 typedef A7 A7Type; | |
| 288 }; | |
| 289 | |
| 290 | 204 |
| 291 // ForceVoidReturn<> | 205 // ForceVoidReturn<> |
| 292 // | 206 // |
| 293 // Set of templates that support forcing the function return type to void. | 207 // Set of templates that support forcing the function return type to void. |
| 294 template <typename Sig> | 208 template <typename Sig> |
| 295 struct ForceVoidReturn; | 209 struct ForceVoidReturn; |
| 296 | 210 |
| 297 template <typename R, typename... Args> | 211 template <typename R, typename... Args> |
| 298 struct ForceVoidReturn<R(Args...)> { | 212 struct ForceVoidReturn<R(Args...)> { |
| 299 typedef void(RunType)(Args...); | 213 typedef void(RunType)(Args...); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 // need a partial specialization to change the syntax to drop the "return" | 275 // need a partial specialization to change the syntax to drop the "return" |
| 362 // from the invocation call. | 276 // from the invocation call. |
| 363 // | 277 // |
| 364 // WeakCalls similarly need special syntax that is applied to the first | 278 // WeakCalls similarly need special syntax that is applied to the first |
| 365 // argument to check if they should no-op themselves. | 279 // argument to check if they should no-op themselves. |
| 366 template <bool IsWeakCall, typename ReturnType, typename Runnable, | 280 template <bool IsWeakCall, typename ReturnType, typename Runnable, |
| 367 typename ArgsType> | 281 typename ArgsType> |
| 368 struct InvokeHelper; | 282 struct InvokeHelper; |
| 369 | 283 |
| 370 template <typename ReturnType, typename Runnable, typename... Args> | 284 template <typename ReturnType, typename Runnable, typename... Args> |
| 371 struct InvokeHelper<false, ReturnType, Runnable, | 285 struct InvokeHelper<false, ReturnType, Runnable, TypeList<Args...>> { |
| 372 void(Args...)> { | |
| 373 static ReturnType MakeItSo(Runnable runnable, Args... args) { | 286 static ReturnType MakeItSo(Runnable runnable, Args... args) { |
| 374 return runnable.Run(CallbackForward(args)...); | 287 return runnable.Run(CallbackForward(args)...); |
| 375 } | 288 } |
| 376 }; | 289 }; |
| 377 | 290 |
| 378 template <typename Runnable, typename... Args> | 291 template <typename Runnable, typename... Args> |
| 379 struct InvokeHelper<false, void, Runnable, void(Args...)> { | 292 struct InvokeHelper<false, void, Runnable, TypeList<Args...>> { |
| 380 static void MakeItSo(Runnable runnable, Args... args) { | 293 static void MakeItSo(Runnable runnable, Args... args) { |
| 381 runnable.Run(CallbackForward(args)...); | 294 runnable.Run(CallbackForward(args)...); |
| 382 } | 295 } |
| 383 }; | 296 }; |
| 384 | 297 |
| 385 template <typename Runnable, typename BoundWeakPtr, typename... Args> | 298 template <typename Runnable, typename BoundWeakPtr, typename... Args> |
| 386 struct InvokeHelper<true, void, Runnable, void(BoundWeakPtr, Args...)> { | 299 struct InvokeHelper<true, void, Runnable, TypeList<BoundWeakPtr, Args...>> { |
| 387 static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, Args... args) { | 300 static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, Args... args) { |
| 388 if (!weak_ptr.get()) { | 301 if (!weak_ptr.get()) { |
| 389 return; | 302 return; |
| 390 } | 303 } |
| 391 runnable.Run(weak_ptr.get(), CallbackForward(args)...); | 304 runnable.Run(weak_ptr.get(), CallbackForward(args)...); |
| 392 } | 305 } |
| 393 }; | 306 }; |
| 394 | 307 |
| 395 #if !defined(_MSC_VER) | 308 #if !defined(_MSC_VER) |
| 396 | 309 |
| 397 template <typename ReturnType, typename Runnable, typename ArgsType> | 310 template <typename ReturnType, typename Runnable, typename ArgsType> |
| 398 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { | 311 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { |
| 399 // WeakCalls are only supported for functions with a void return type. | 312 // WeakCalls are only supported for functions with a void return type. |
| 400 // Otherwise, the function result would be undefined if the the WeakPtr<> | 313 // Otherwise, the function result would be undefined if the the WeakPtr<> |
| 401 // is invalidated. | 314 // is invalidated. |
| 402 COMPILE_ASSERT(is_void<ReturnType>::value, | 315 COMPILE_ASSERT(is_void<ReturnType>::value, |
| 403 weak_ptrs_can_only_bind_to_methods_without_return_values); | 316 weak_ptrs_can_only_bind_to_methods_without_return_values); |
| 404 }; | 317 }; |
| 405 | 318 |
| 406 #endif | 319 #endif |
| 407 | 320 |
| 408 // Invoker<> | 321 // Invoker<> |
| 409 // | 322 // |
| 410 // See description at the top of the file. | 323 // See description at the top of the file. |
| 411 template <int NumBound, typename Storage, typename RunType> | 324 template <typename BoundIndexes, |
|
Nico
2014/12/08 19:58:08
nit: "index" confusingly has two valid plurals, "i
tzik
2014/12/09 14:50:27
Done.
| |
| 325 typename StorageType, typename Unwrappers, | |
| 326 typename InvokeHelperType, typename UnboundForwardRunType> | |
| 412 struct Invoker; | 327 struct Invoker; |
| 413 | 328 |
| 414 // Arity 0 -> 0. | 329 template <size_t... bound_indexes, |
|
Nico
2014/12/08 19:58:08
likewise
tzik
2014/12/09 14:50:27
Done.
| |
| 415 template <typename StorageType, typename R> | 330 typename StorageType, |
| 416 struct Invoker<0, StorageType, R()> { | 331 typename... Unwrappers, |
| 417 typedef R(RunType)(BindStateBase*); | 332 typename InvokeHelperType, |
| 418 | 333 typename R, |
| 419 typedef R(UnboundRunType)(); | 334 typename... UnboundForwardArgs> |
| 420 | 335 struct Invoker<IndexSequence<bound_indexes...>, |
| 421 static R Run(BindStateBase* base) { | 336 StorageType, TypeList<Unwrappers...>, |
| 337 InvokeHelperType, R(UnboundForwardArgs...)> { | |
| 338 static R Run(BindStateBase* base, | |
| 339 UnboundForwardArgs... unbound_args) { | |
| 422 StorageType* storage = static_cast<StorageType*>(base); | 340 StorageType* storage = static_cast<StorageType*>(base); |
| 423 | 341 return InvokeHelperType::MakeItSo( |
| 424 // Local references to make debugger stepping easier. If in a debugger, | 342 storage->runnable_, |
| 425 // you really want to warp ahead and step through the | 343 Unwrappers::Unwrap(*GetTupleItem<bound_indexes>( |
| 426 // InvokeHelper<>::MakeItSo() call below. | 344 &storage->bound_args_))..., |
| 427 | 345 CallbackForward(unbound_args)...); |
| 428 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 429 typename StorageType::RunnableType, | |
| 430 void()> | |
| 431 ::MakeItSo(storage->runnable_); | |
| 432 } | 346 } |
| 433 }; | 347 }; |
| 434 | 348 |
| 435 // Arity 1 -> 1. | |
| 436 template <typename StorageType, typename R,typename X1> | |
| 437 struct Invoker<0, StorageType, R(X1)> { | |
| 438 typedef R(RunType)(BindStateBase*, | |
| 439 typename CallbackParamTraits<X1>::ForwardType); | |
| 440 | |
| 441 typedef R(UnboundRunType)(X1); | |
| 442 | |
| 443 static R Run(BindStateBase* base, | |
| 444 typename CallbackParamTraits<X1>::ForwardType x1) { | |
| 445 StorageType* storage = static_cast<StorageType*>(base); | |
| 446 | |
| 447 // Local references to make debugger stepping easier. If in a debugger, | |
| 448 // you really want to warp ahead and step through the | |
| 449 // InvokeHelper<>::MakeItSo() call below. | |
| 450 | |
| 451 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 452 typename StorageType::RunnableType, | |
| 453 void(typename CallbackParamTraits<X1>::ForwardType x1)> | |
| 454 ::MakeItSo(storage->runnable_, CallbackForward(x1)); | |
| 455 } | |
| 456 }; | |
| 457 | |
| 458 // Arity 1 -> 0. | |
| 459 template <typename StorageType, typename R,typename X1> | |
| 460 struct Invoker<1, StorageType, R(X1)> { | |
| 461 typedef R(RunType)(BindStateBase*); | |
| 462 | |
| 463 typedef R(UnboundRunType)(); | |
| 464 | |
| 465 static R Run(BindStateBase* base) { | |
| 466 StorageType* storage = static_cast<StorageType*>(base); | |
| 467 | |
| 468 // Local references to make debugger stepping easier. If in a debugger, | |
| 469 // you really want to warp ahead and step through the | |
| 470 // InvokeHelper<>::MakeItSo() call below. | |
| 471 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 472 | |
| 473 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 474 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 475 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 476 typename StorageType::RunnableType, | |
| 477 void(typename Bound1UnwrapTraits::ForwardType)> | |
| 478 ::MakeItSo(storage->runnable_, CallbackForward(x1)); | |
| 479 } | |
| 480 }; | |
| 481 | |
| 482 // Arity 2 -> 2. | |
| 483 template <typename StorageType, typename R,typename X1, typename X2> | |
| 484 struct Invoker<0, StorageType, R(X1, X2)> { | |
| 485 typedef R(RunType)(BindStateBase*, | |
| 486 typename CallbackParamTraits<X1>::ForwardType, | |
| 487 typename CallbackParamTraits<X2>::ForwardType); | |
| 488 | |
| 489 typedef R(UnboundRunType)(X1, X2); | |
| 490 | |
| 491 static R Run(BindStateBase* base, | |
| 492 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 493 typename CallbackParamTraits<X2>::ForwardType x2) { | |
| 494 StorageType* storage = static_cast<StorageType*>(base); | |
| 495 | |
| 496 // Local references to make debugger stepping easier. If in a debugger, | |
| 497 // you really want to warp ahead and step through the | |
| 498 // InvokeHelper<>::MakeItSo() call below. | |
| 499 | |
| 500 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 501 typename StorageType::RunnableType, | |
| 502 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 503 typename CallbackParamTraits<X2>::ForwardType x2)> | |
| 504 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 505 CallbackForward(x2)); | |
| 506 } | |
| 507 }; | |
| 508 | |
| 509 // Arity 2 -> 1. | |
| 510 template <typename StorageType, typename R,typename X1, typename X2> | |
| 511 struct Invoker<1, StorageType, R(X1, X2)> { | |
| 512 typedef R(RunType)(BindStateBase*, | |
| 513 typename CallbackParamTraits<X2>::ForwardType); | |
| 514 | |
| 515 typedef R(UnboundRunType)(X2); | |
| 516 | |
| 517 static R Run(BindStateBase* base, | |
| 518 typename CallbackParamTraits<X2>::ForwardType x2) { | |
| 519 StorageType* storage = static_cast<StorageType*>(base); | |
| 520 | |
| 521 // Local references to make debugger stepping easier. If in a debugger, | |
| 522 // you really want to warp ahead and step through the | |
| 523 // InvokeHelper<>::MakeItSo() call below. | |
| 524 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 525 | |
| 526 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 527 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 528 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 529 typename StorageType::RunnableType, | |
| 530 void(typename Bound1UnwrapTraits::ForwardType, | |
| 531 typename CallbackParamTraits<X2>::ForwardType x2)> | |
| 532 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 533 CallbackForward(x2)); | |
| 534 } | |
| 535 }; | |
| 536 | |
| 537 // Arity 2 -> 0. | |
| 538 template <typename StorageType, typename R,typename X1, typename X2> | |
| 539 struct Invoker<2, StorageType, R(X1, X2)> { | |
| 540 typedef R(RunType)(BindStateBase*); | |
| 541 | |
| 542 typedef R(UnboundRunType)(); | |
| 543 | |
| 544 static R Run(BindStateBase* base) { | |
| 545 StorageType* storage = static_cast<StorageType*>(base); | |
| 546 | |
| 547 // Local references to make debugger stepping easier. If in a debugger, | |
| 548 // you really want to warp ahead and step through the | |
| 549 // InvokeHelper<>::MakeItSo() call below. | |
| 550 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 551 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 552 | |
| 553 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 554 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 555 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 556 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 557 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 558 typename StorageType::RunnableType, | |
| 559 void(typename Bound1UnwrapTraits::ForwardType, | |
| 560 typename Bound2UnwrapTraits::ForwardType)> | |
| 561 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 562 CallbackForward(x2)); | |
| 563 } | |
| 564 }; | |
| 565 | |
| 566 // Arity 3 -> 3. | |
| 567 template <typename StorageType, typename R,typename X1, typename X2, | |
| 568 typename X3> | |
| 569 struct Invoker<0, StorageType, R(X1, X2, X3)> { | |
| 570 typedef R(RunType)(BindStateBase*, | |
| 571 typename CallbackParamTraits<X1>::ForwardType, | |
| 572 typename CallbackParamTraits<X2>::ForwardType, | |
| 573 typename CallbackParamTraits<X3>::ForwardType); | |
| 574 | |
| 575 typedef R(UnboundRunType)(X1, X2, X3); | |
| 576 | |
| 577 static R Run(BindStateBase* base, | |
| 578 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 579 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 580 typename CallbackParamTraits<X3>::ForwardType x3) { | |
| 581 StorageType* storage = static_cast<StorageType*>(base); | |
| 582 | |
| 583 // Local references to make debugger stepping easier. If in a debugger, | |
| 584 // you really want to warp ahead and step through the | |
| 585 // InvokeHelper<>::MakeItSo() call below. | |
| 586 | |
| 587 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 588 typename StorageType::RunnableType, | |
| 589 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 590 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 591 typename CallbackParamTraits<X3>::ForwardType x3)> | |
| 592 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 593 CallbackForward(x2), CallbackForward(x3)); | |
| 594 } | |
| 595 }; | |
| 596 | |
| 597 // Arity 3 -> 2. | |
| 598 template <typename StorageType, typename R,typename X1, typename X2, | |
| 599 typename X3> | |
| 600 struct Invoker<1, StorageType, R(X1, X2, X3)> { | |
| 601 typedef R(RunType)(BindStateBase*, | |
| 602 typename CallbackParamTraits<X2>::ForwardType, | |
| 603 typename CallbackParamTraits<X3>::ForwardType); | |
| 604 | |
| 605 typedef R(UnboundRunType)(X2, X3); | |
| 606 | |
| 607 static R Run(BindStateBase* base, | |
| 608 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 609 typename CallbackParamTraits<X3>::ForwardType x3) { | |
| 610 StorageType* storage = static_cast<StorageType*>(base); | |
| 611 | |
| 612 // Local references to make debugger stepping easier. If in a debugger, | |
| 613 // you really want to warp ahead and step through the | |
| 614 // InvokeHelper<>::MakeItSo() call below. | |
| 615 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 616 | |
| 617 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 618 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 619 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 620 typename StorageType::RunnableType, | |
| 621 void(typename Bound1UnwrapTraits::ForwardType, | |
| 622 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 623 typename CallbackParamTraits<X3>::ForwardType x3)> | |
| 624 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 625 CallbackForward(x2), CallbackForward(x3)); | |
| 626 } | |
| 627 }; | |
| 628 | |
| 629 // Arity 3 -> 1. | |
| 630 template <typename StorageType, typename R,typename X1, typename X2, | |
| 631 typename X3> | |
| 632 struct Invoker<2, StorageType, R(X1, X2, X3)> { | |
| 633 typedef R(RunType)(BindStateBase*, | |
| 634 typename CallbackParamTraits<X3>::ForwardType); | |
| 635 | |
| 636 typedef R(UnboundRunType)(X3); | |
| 637 | |
| 638 static R Run(BindStateBase* base, | |
| 639 typename CallbackParamTraits<X3>::ForwardType x3) { | |
| 640 StorageType* storage = static_cast<StorageType*>(base); | |
| 641 | |
| 642 // Local references to make debugger stepping easier. If in a debugger, | |
| 643 // you really want to warp ahead and step through the | |
| 644 // InvokeHelper<>::MakeItSo() call below. | |
| 645 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 646 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 647 | |
| 648 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 649 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 650 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 651 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 652 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 653 typename StorageType::RunnableType, | |
| 654 void(typename Bound1UnwrapTraits::ForwardType, | |
| 655 typename Bound2UnwrapTraits::ForwardType, | |
| 656 typename CallbackParamTraits<X3>::ForwardType x3)> | |
| 657 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 658 CallbackForward(x2), CallbackForward(x3)); | |
| 659 } | |
| 660 }; | |
| 661 | |
| 662 // Arity 3 -> 0. | |
| 663 template <typename StorageType, typename R,typename X1, typename X2, | |
| 664 typename X3> | |
| 665 struct Invoker<3, StorageType, R(X1, X2, X3)> { | |
| 666 typedef R(RunType)(BindStateBase*); | |
| 667 | |
| 668 typedef R(UnboundRunType)(); | |
| 669 | |
| 670 static R Run(BindStateBase* base) { | |
| 671 StorageType* storage = static_cast<StorageType*>(base); | |
| 672 | |
| 673 // Local references to make debugger stepping easier. If in a debugger, | |
| 674 // you really want to warp ahead and step through the | |
| 675 // InvokeHelper<>::MakeItSo() call below. | |
| 676 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 677 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 678 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 679 | |
| 680 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 681 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 682 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 683 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 684 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 685 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 686 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 687 typename StorageType::RunnableType, | |
| 688 void(typename Bound1UnwrapTraits::ForwardType, | |
| 689 typename Bound2UnwrapTraits::ForwardType, | |
| 690 typename Bound3UnwrapTraits::ForwardType)> | |
| 691 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 692 CallbackForward(x2), CallbackForward(x3)); | |
| 693 } | |
| 694 }; | |
| 695 | |
| 696 // Arity 4 -> 4. | |
| 697 template <typename StorageType, typename R,typename X1, typename X2, | |
| 698 typename X3, typename X4> | |
| 699 struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { | |
| 700 typedef R(RunType)(BindStateBase*, | |
| 701 typename CallbackParamTraits<X1>::ForwardType, | |
| 702 typename CallbackParamTraits<X2>::ForwardType, | |
| 703 typename CallbackParamTraits<X3>::ForwardType, | |
| 704 typename CallbackParamTraits<X4>::ForwardType); | |
| 705 | |
| 706 typedef R(UnboundRunType)(X1, X2, X3, X4); | |
| 707 | |
| 708 static R Run(BindStateBase* base, | |
| 709 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 710 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 711 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 712 typename CallbackParamTraits<X4>::ForwardType x4) { | |
| 713 StorageType* storage = static_cast<StorageType*>(base); | |
| 714 | |
| 715 // Local references to make debugger stepping easier. If in a debugger, | |
| 716 // you really want to warp ahead and step through the | |
| 717 // InvokeHelper<>::MakeItSo() call below. | |
| 718 | |
| 719 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 720 typename StorageType::RunnableType, | |
| 721 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 722 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 723 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 724 typename CallbackParamTraits<X4>::ForwardType x4)> | |
| 725 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 726 CallbackForward(x2), CallbackForward(x3), | |
| 727 CallbackForward(x4)); | |
| 728 } | |
| 729 }; | |
| 730 | |
| 731 // Arity 4 -> 3. | |
| 732 template <typename StorageType, typename R,typename X1, typename X2, | |
| 733 typename X3, typename X4> | |
| 734 struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { | |
| 735 typedef R(RunType)(BindStateBase*, | |
| 736 typename CallbackParamTraits<X2>::ForwardType, | |
| 737 typename CallbackParamTraits<X3>::ForwardType, | |
| 738 typename CallbackParamTraits<X4>::ForwardType); | |
| 739 | |
| 740 typedef R(UnboundRunType)(X2, X3, X4); | |
| 741 | |
| 742 static R Run(BindStateBase* base, | |
| 743 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 744 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 745 typename CallbackParamTraits<X4>::ForwardType x4) { | |
| 746 StorageType* storage = static_cast<StorageType*>(base); | |
| 747 | |
| 748 // Local references to make debugger stepping easier. If in a debugger, | |
| 749 // you really want to warp ahead and step through the | |
| 750 // InvokeHelper<>::MakeItSo() call below. | |
| 751 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 752 | |
| 753 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 754 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 755 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 756 typename StorageType::RunnableType, | |
| 757 void(typename Bound1UnwrapTraits::ForwardType, | |
| 758 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 759 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 760 typename CallbackParamTraits<X4>::ForwardType x4)> | |
| 761 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 762 CallbackForward(x2), CallbackForward(x3), | |
| 763 CallbackForward(x4)); | |
| 764 } | |
| 765 }; | |
| 766 | |
| 767 // Arity 4 -> 2. | |
| 768 template <typename StorageType, typename R,typename X1, typename X2, | |
| 769 typename X3, typename X4> | |
| 770 struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { | |
| 771 typedef R(RunType)(BindStateBase*, | |
| 772 typename CallbackParamTraits<X3>::ForwardType, | |
| 773 typename CallbackParamTraits<X4>::ForwardType); | |
| 774 | |
| 775 typedef R(UnboundRunType)(X3, X4); | |
| 776 | |
| 777 static R Run(BindStateBase* base, | |
| 778 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 779 typename CallbackParamTraits<X4>::ForwardType x4) { | |
| 780 StorageType* storage = static_cast<StorageType*>(base); | |
| 781 | |
| 782 // Local references to make debugger stepping easier. If in a debugger, | |
| 783 // you really want to warp ahead and step through the | |
| 784 // InvokeHelper<>::MakeItSo() call below. | |
| 785 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 786 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 787 | |
| 788 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 789 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 790 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 791 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 792 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 793 typename StorageType::RunnableType, | |
| 794 void(typename Bound1UnwrapTraits::ForwardType, | |
| 795 typename Bound2UnwrapTraits::ForwardType, | |
| 796 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 797 typename CallbackParamTraits<X4>::ForwardType x4)> | |
| 798 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 799 CallbackForward(x2), CallbackForward(x3), | |
| 800 CallbackForward(x4)); | |
| 801 } | |
| 802 }; | |
| 803 | |
| 804 // Arity 4 -> 1. | |
| 805 template <typename StorageType, typename R,typename X1, typename X2, | |
| 806 typename X3, typename X4> | |
| 807 struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { | |
| 808 typedef R(RunType)(BindStateBase*, | |
| 809 typename CallbackParamTraits<X4>::ForwardType); | |
| 810 | |
| 811 typedef R(UnboundRunType)(X4); | |
| 812 | |
| 813 static R Run(BindStateBase* base, | |
| 814 typename CallbackParamTraits<X4>::ForwardType x4) { | |
| 815 StorageType* storage = static_cast<StorageType*>(base); | |
| 816 | |
| 817 // Local references to make debugger stepping easier. If in a debugger, | |
| 818 // you really want to warp ahead and step through the | |
| 819 // InvokeHelper<>::MakeItSo() call below. | |
| 820 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 821 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 822 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 823 | |
| 824 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 825 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 826 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 827 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 828 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 829 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 830 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 831 typename StorageType::RunnableType, | |
| 832 void(typename Bound1UnwrapTraits::ForwardType, | |
| 833 typename Bound2UnwrapTraits::ForwardType, | |
| 834 typename Bound3UnwrapTraits::ForwardType, | |
| 835 typename CallbackParamTraits<X4>::ForwardType x4)> | |
| 836 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 837 CallbackForward(x2), CallbackForward(x3), | |
| 838 CallbackForward(x4)); | |
| 839 } | |
| 840 }; | |
| 841 | |
| 842 // Arity 4 -> 0. | |
| 843 template <typename StorageType, typename R,typename X1, typename X2, | |
| 844 typename X3, typename X4> | |
| 845 struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { | |
| 846 typedef R(RunType)(BindStateBase*); | |
| 847 | |
| 848 typedef R(UnboundRunType)(); | |
| 849 | |
| 850 static R Run(BindStateBase* base) { | |
| 851 StorageType* storage = static_cast<StorageType*>(base); | |
| 852 | |
| 853 // Local references to make debugger stepping easier. If in a debugger, | |
| 854 // you really want to warp ahead and step through the | |
| 855 // InvokeHelper<>::MakeItSo() call below. | |
| 856 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 857 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 858 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 859 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 860 | |
| 861 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 862 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 863 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 864 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 865 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 866 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 867 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 868 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 869 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 870 typename StorageType::RunnableType, | |
| 871 void(typename Bound1UnwrapTraits::ForwardType, | |
| 872 typename Bound2UnwrapTraits::ForwardType, | |
| 873 typename Bound3UnwrapTraits::ForwardType, | |
| 874 typename Bound4UnwrapTraits::ForwardType)> | |
| 875 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 876 CallbackForward(x2), CallbackForward(x3), | |
| 877 CallbackForward(x4)); | |
| 878 } | |
| 879 }; | |
| 880 | |
| 881 // Arity 5 -> 5. | |
| 882 template <typename StorageType, typename R,typename X1, typename X2, | |
| 883 typename X3, typename X4, typename X5> | |
| 884 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 885 typedef R(RunType)(BindStateBase*, | |
| 886 typename CallbackParamTraits<X1>::ForwardType, | |
| 887 typename CallbackParamTraits<X2>::ForwardType, | |
| 888 typename CallbackParamTraits<X3>::ForwardType, | |
| 889 typename CallbackParamTraits<X4>::ForwardType, | |
| 890 typename CallbackParamTraits<X5>::ForwardType); | |
| 891 | |
| 892 typedef R(UnboundRunType)(X1, X2, X3, X4, X5); | |
| 893 | |
| 894 static R Run(BindStateBase* base, | |
| 895 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 896 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 897 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 898 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 899 typename CallbackParamTraits<X5>::ForwardType x5) { | |
| 900 StorageType* storage = static_cast<StorageType*>(base); | |
| 901 | |
| 902 // Local references to make debugger stepping easier. If in a debugger, | |
| 903 // you really want to warp ahead and step through the | |
| 904 // InvokeHelper<>::MakeItSo() call below. | |
| 905 | |
| 906 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 907 typename StorageType::RunnableType, | |
| 908 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 909 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 910 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 911 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 912 typename CallbackParamTraits<X5>::ForwardType x5)> | |
| 913 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 914 CallbackForward(x2), CallbackForward(x3), | |
| 915 CallbackForward(x4), CallbackForward(x5)); | |
| 916 } | |
| 917 }; | |
| 918 | |
| 919 // Arity 5 -> 4. | |
| 920 template <typename StorageType, typename R,typename X1, typename X2, | |
| 921 typename X3, typename X4, typename X5> | |
| 922 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 923 typedef R(RunType)(BindStateBase*, | |
| 924 typename CallbackParamTraits<X2>::ForwardType, | |
| 925 typename CallbackParamTraits<X3>::ForwardType, | |
| 926 typename CallbackParamTraits<X4>::ForwardType, | |
| 927 typename CallbackParamTraits<X5>::ForwardType); | |
| 928 | |
| 929 typedef R(UnboundRunType)(X2, X3, X4, X5); | |
| 930 | |
| 931 static R Run(BindStateBase* base, | |
| 932 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 933 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 934 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 935 typename CallbackParamTraits<X5>::ForwardType x5) { | |
| 936 StorageType* storage = static_cast<StorageType*>(base); | |
| 937 | |
| 938 // Local references to make debugger stepping easier. If in a debugger, | |
| 939 // you really want to warp ahead and step through the | |
| 940 // InvokeHelper<>::MakeItSo() call below. | |
| 941 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 942 | |
| 943 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 944 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 945 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 946 typename StorageType::RunnableType, | |
| 947 void(typename Bound1UnwrapTraits::ForwardType, | |
| 948 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 949 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 950 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 951 typename CallbackParamTraits<X5>::ForwardType x5)> | |
| 952 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 953 CallbackForward(x2), CallbackForward(x3), | |
| 954 CallbackForward(x4), CallbackForward(x5)); | |
| 955 } | |
| 956 }; | |
| 957 | |
| 958 // Arity 5 -> 3. | |
| 959 template <typename StorageType, typename R,typename X1, typename X2, | |
| 960 typename X3, typename X4, typename X5> | |
| 961 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 962 typedef R(RunType)(BindStateBase*, | |
| 963 typename CallbackParamTraits<X3>::ForwardType, | |
| 964 typename CallbackParamTraits<X4>::ForwardType, | |
| 965 typename CallbackParamTraits<X5>::ForwardType); | |
| 966 | |
| 967 typedef R(UnboundRunType)(X3, X4, X5); | |
| 968 | |
| 969 static R Run(BindStateBase* base, | |
| 970 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 971 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 972 typename CallbackParamTraits<X5>::ForwardType x5) { | |
| 973 StorageType* storage = static_cast<StorageType*>(base); | |
| 974 | |
| 975 // Local references to make debugger stepping easier. If in a debugger, | |
| 976 // you really want to warp ahead and step through the | |
| 977 // InvokeHelper<>::MakeItSo() call below. | |
| 978 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 979 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 980 | |
| 981 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 982 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 983 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 984 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 985 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 986 typename StorageType::RunnableType, | |
| 987 void(typename Bound1UnwrapTraits::ForwardType, | |
| 988 typename Bound2UnwrapTraits::ForwardType, | |
| 989 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 990 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 991 typename CallbackParamTraits<X5>::ForwardType x5)> | |
| 992 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 993 CallbackForward(x2), CallbackForward(x3), | |
| 994 CallbackForward(x4), CallbackForward(x5)); | |
| 995 } | |
| 996 }; | |
| 997 | |
| 998 // Arity 5 -> 2. | |
| 999 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1000 typename X3, typename X4, typename X5> | |
| 1001 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 1002 typedef R(RunType)(BindStateBase*, | |
| 1003 typename CallbackParamTraits<X4>::ForwardType, | |
| 1004 typename CallbackParamTraits<X5>::ForwardType); | |
| 1005 | |
| 1006 typedef R(UnboundRunType)(X4, X5); | |
| 1007 | |
| 1008 static R Run(BindStateBase* base, | |
| 1009 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1010 typename CallbackParamTraits<X5>::ForwardType x5) { | |
| 1011 StorageType* storage = static_cast<StorageType*>(base); | |
| 1012 | |
| 1013 // Local references to make debugger stepping easier. If in a debugger, | |
| 1014 // you really want to warp ahead and step through the | |
| 1015 // InvokeHelper<>::MakeItSo() call below. | |
| 1016 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1017 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1018 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1019 | |
| 1020 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1021 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1022 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1023 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1024 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1025 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1026 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1027 typename StorageType::RunnableType, | |
| 1028 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1029 typename Bound2UnwrapTraits::ForwardType, | |
| 1030 typename Bound3UnwrapTraits::ForwardType, | |
| 1031 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1032 typename CallbackParamTraits<X5>::ForwardType x5)> | |
| 1033 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1034 CallbackForward(x2), CallbackForward(x3), | |
| 1035 CallbackForward(x4), CallbackForward(x5)); | |
| 1036 } | |
| 1037 }; | |
| 1038 | |
| 1039 // Arity 5 -> 1. | |
| 1040 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1041 typename X3, typename X4, typename X5> | |
| 1042 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 1043 typedef R(RunType)(BindStateBase*, | |
| 1044 typename CallbackParamTraits<X5>::ForwardType); | |
| 1045 | |
| 1046 typedef R(UnboundRunType)(X5); | |
| 1047 | |
| 1048 static R Run(BindStateBase* base, | |
| 1049 typename CallbackParamTraits<X5>::ForwardType x5) { | |
| 1050 StorageType* storage = static_cast<StorageType*>(base); | |
| 1051 | |
| 1052 // Local references to make debugger stepping easier. If in a debugger, | |
| 1053 // you really want to warp ahead and step through the | |
| 1054 // InvokeHelper<>::MakeItSo() call below. | |
| 1055 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1056 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1057 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1058 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1059 | |
| 1060 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1061 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1062 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1063 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1064 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1065 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1066 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1067 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1068 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1069 typename StorageType::RunnableType, | |
| 1070 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1071 typename Bound2UnwrapTraits::ForwardType, | |
| 1072 typename Bound3UnwrapTraits::ForwardType, | |
| 1073 typename Bound4UnwrapTraits::ForwardType, | |
| 1074 typename CallbackParamTraits<X5>::ForwardType x5)> | |
| 1075 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1076 CallbackForward(x2), CallbackForward(x3), | |
| 1077 CallbackForward(x4), CallbackForward(x5)); | |
| 1078 } | |
| 1079 }; | |
| 1080 | |
| 1081 // Arity 5 -> 0. | |
| 1082 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1083 typename X3, typename X4, typename X5> | |
| 1084 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { | |
| 1085 typedef R(RunType)(BindStateBase*); | |
| 1086 | |
| 1087 typedef R(UnboundRunType)(); | |
| 1088 | |
| 1089 static R Run(BindStateBase* base) { | |
| 1090 StorageType* storage = static_cast<StorageType*>(base); | |
| 1091 | |
| 1092 // Local references to make debugger stepping easier. If in a debugger, | |
| 1093 // you really want to warp ahead and step through the | |
| 1094 // InvokeHelper<>::MakeItSo() call below. | |
| 1095 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1096 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1097 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1098 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1099 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1100 | |
| 1101 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1102 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1103 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1104 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1105 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1106 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1107 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1108 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1109 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1110 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1111 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1112 typename StorageType::RunnableType, | |
| 1113 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1114 typename Bound2UnwrapTraits::ForwardType, | |
| 1115 typename Bound3UnwrapTraits::ForwardType, | |
| 1116 typename Bound4UnwrapTraits::ForwardType, | |
| 1117 typename Bound5UnwrapTraits::ForwardType)> | |
| 1118 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1119 CallbackForward(x2), CallbackForward(x3), | |
| 1120 CallbackForward(x4), CallbackForward(x5)); | |
| 1121 } | |
| 1122 }; | |
| 1123 | |
| 1124 // Arity 6 -> 6. | |
| 1125 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1126 typename X3, typename X4, typename X5, typename X6> | |
| 1127 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1128 typedef R(RunType)(BindStateBase*, | |
| 1129 typename CallbackParamTraits<X1>::ForwardType, | |
| 1130 typename CallbackParamTraits<X2>::ForwardType, | |
| 1131 typename CallbackParamTraits<X3>::ForwardType, | |
| 1132 typename CallbackParamTraits<X4>::ForwardType, | |
| 1133 typename CallbackParamTraits<X5>::ForwardType, | |
| 1134 typename CallbackParamTraits<X6>::ForwardType); | |
| 1135 | |
| 1136 typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6); | |
| 1137 | |
| 1138 static R Run(BindStateBase* base, | |
| 1139 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 1140 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1141 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1142 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1143 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1144 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1145 StorageType* storage = static_cast<StorageType*>(base); | |
| 1146 | |
| 1147 // Local references to make debugger stepping easier. If in a debugger, | |
| 1148 // you really want to warp ahead and step through the | |
| 1149 // InvokeHelper<>::MakeItSo() call below. | |
| 1150 | |
| 1151 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1152 typename StorageType::RunnableType, | |
| 1153 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 1154 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1155 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1156 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1157 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1158 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1159 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1160 CallbackForward(x2), CallbackForward(x3), | |
| 1161 CallbackForward(x4), CallbackForward(x5), | |
| 1162 CallbackForward(x6)); | |
| 1163 } | |
| 1164 }; | |
| 1165 | |
| 1166 // Arity 6 -> 5. | |
| 1167 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1168 typename X3, typename X4, typename X5, typename X6> | |
| 1169 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1170 typedef R(RunType)(BindStateBase*, | |
| 1171 typename CallbackParamTraits<X2>::ForwardType, | |
| 1172 typename CallbackParamTraits<X3>::ForwardType, | |
| 1173 typename CallbackParamTraits<X4>::ForwardType, | |
| 1174 typename CallbackParamTraits<X5>::ForwardType, | |
| 1175 typename CallbackParamTraits<X6>::ForwardType); | |
| 1176 | |
| 1177 typedef R(UnboundRunType)(X2, X3, X4, X5, X6); | |
| 1178 | |
| 1179 static R Run(BindStateBase* base, | |
| 1180 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1181 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1182 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1183 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1184 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1185 StorageType* storage = static_cast<StorageType*>(base); | |
| 1186 | |
| 1187 // Local references to make debugger stepping easier. If in a debugger, | |
| 1188 // you really want to warp ahead and step through the | |
| 1189 // InvokeHelper<>::MakeItSo() call below. | |
| 1190 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1191 | |
| 1192 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1193 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1194 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1195 typename StorageType::RunnableType, | |
| 1196 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1197 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1198 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1199 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1200 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1201 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1202 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1203 CallbackForward(x2), CallbackForward(x3), | |
| 1204 CallbackForward(x4), CallbackForward(x5), | |
| 1205 CallbackForward(x6)); | |
| 1206 } | |
| 1207 }; | |
| 1208 | |
| 1209 // Arity 6 -> 4. | |
| 1210 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1211 typename X3, typename X4, typename X5, typename X6> | |
| 1212 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1213 typedef R(RunType)(BindStateBase*, | |
| 1214 typename CallbackParamTraits<X3>::ForwardType, | |
| 1215 typename CallbackParamTraits<X4>::ForwardType, | |
| 1216 typename CallbackParamTraits<X5>::ForwardType, | |
| 1217 typename CallbackParamTraits<X6>::ForwardType); | |
| 1218 | |
| 1219 typedef R(UnboundRunType)(X3, X4, X5, X6); | |
| 1220 | |
| 1221 static R Run(BindStateBase* base, | |
| 1222 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1223 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1224 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1225 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1226 StorageType* storage = static_cast<StorageType*>(base); | |
| 1227 | |
| 1228 // Local references to make debugger stepping easier. If in a debugger, | |
| 1229 // you really want to warp ahead and step through the | |
| 1230 // InvokeHelper<>::MakeItSo() call below. | |
| 1231 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1232 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1233 | |
| 1234 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1235 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1236 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1237 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1238 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1239 typename StorageType::RunnableType, | |
| 1240 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1241 typename Bound2UnwrapTraits::ForwardType, | |
| 1242 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1243 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1244 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1245 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1246 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1247 CallbackForward(x2), CallbackForward(x3), | |
| 1248 CallbackForward(x4), CallbackForward(x5), | |
| 1249 CallbackForward(x6)); | |
| 1250 } | |
| 1251 }; | |
| 1252 | |
| 1253 // Arity 6 -> 3. | |
| 1254 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1255 typename X3, typename X4, typename X5, typename X6> | |
| 1256 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1257 typedef R(RunType)(BindStateBase*, | |
| 1258 typename CallbackParamTraits<X4>::ForwardType, | |
| 1259 typename CallbackParamTraits<X5>::ForwardType, | |
| 1260 typename CallbackParamTraits<X6>::ForwardType); | |
| 1261 | |
| 1262 typedef R(UnboundRunType)(X4, X5, X6); | |
| 1263 | |
| 1264 static R Run(BindStateBase* base, | |
| 1265 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1266 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1267 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1268 StorageType* storage = static_cast<StorageType*>(base); | |
| 1269 | |
| 1270 // Local references to make debugger stepping easier. If in a debugger, | |
| 1271 // you really want to warp ahead and step through the | |
| 1272 // InvokeHelper<>::MakeItSo() call below. | |
| 1273 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1274 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1275 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1276 | |
| 1277 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1278 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1279 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1280 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1281 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1282 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1283 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1284 typename StorageType::RunnableType, | |
| 1285 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1286 typename Bound2UnwrapTraits::ForwardType, | |
| 1287 typename Bound3UnwrapTraits::ForwardType, | |
| 1288 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1289 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1290 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1291 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1292 CallbackForward(x2), CallbackForward(x3), | |
| 1293 CallbackForward(x4), CallbackForward(x5), | |
| 1294 CallbackForward(x6)); | |
| 1295 } | |
| 1296 }; | |
| 1297 | |
| 1298 // Arity 6 -> 2. | |
| 1299 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1300 typename X3, typename X4, typename X5, typename X6> | |
| 1301 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1302 typedef R(RunType)(BindStateBase*, | |
| 1303 typename CallbackParamTraits<X5>::ForwardType, | |
| 1304 typename CallbackParamTraits<X6>::ForwardType); | |
| 1305 | |
| 1306 typedef R(UnboundRunType)(X5, X6); | |
| 1307 | |
| 1308 static R Run(BindStateBase* base, | |
| 1309 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1310 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1311 StorageType* storage = static_cast<StorageType*>(base); | |
| 1312 | |
| 1313 // Local references to make debugger stepping easier. If in a debugger, | |
| 1314 // you really want to warp ahead and step through the | |
| 1315 // InvokeHelper<>::MakeItSo() call below. | |
| 1316 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1317 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1318 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1319 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1320 | |
| 1321 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1322 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1323 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1324 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1325 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1326 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1327 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1328 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1329 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1330 typename StorageType::RunnableType, | |
| 1331 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1332 typename Bound2UnwrapTraits::ForwardType, | |
| 1333 typename Bound3UnwrapTraits::ForwardType, | |
| 1334 typename Bound4UnwrapTraits::ForwardType, | |
| 1335 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1336 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1337 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1338 CallbackForward(x2), CallbackForward(x3), | |
| 1339 CallbackForward(x4), CallbackForward(x5), | |
| 1340 CallbackForward(x6)); | |
| 1341 } | |
| 1342 }; | |
| 1343 | |
| 1344 // Arity 6 -> 1. | |
| 1345 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1346 typename X3, typename X4, typename X5, typename X6> | |
| 1347 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1348 typedef R(RunType)(BindStateBase*, | |
| 1349 typename CallbackParamTraits<X6>::ForwardType); | |
| 1350 | |
| 1351 typedef R(UnboundRunType)(X6); | |
| 1352 | |
| 1353 static R Run(BindStateBase* base, | |
| 1354 typename CallbackParamTraits<X6>::ForwardType x6) { | |
| 1355 StorageType* storage = static_cast<StorageType*>(base); | |
| 1356 | |
| 1357 // Local references to make debugger stepping easier. If in a debugger, | |
| 1358 // you really want to warp ahead and step through the | |
| 1359 // InvokeHelper<>::MakeItSo() call below. | |
| 1360 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1361 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1362 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1363 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1364 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1365 | |
| 1366 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1367 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1368 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1369 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1370 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1371 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1372 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1373 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1374 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1375 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1376 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1377 typename StorageType::RunnableType, | |
| 1378 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1379 typename Bound2UnwrapTraits::ForwardType, | |
| 1380 typename Bound3UnwrapTraits::ForwardType, | |
| 1381 typename Bound4UnwrapTraits::ForwardType, | |
| 1382 typename Bound5UnwrapTraits::ForwardType, | |
| 1383 typename CallbackParamTraits<X6>::ForwardType x6)> | |
| 1384 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1385 CallbackForward(x2), CallbackForward(x3), | |
| 1386 CallbackForward(x4), CallbackForward(x5), | |
| 1387 CallbackForward(x6)); | |
| 1388 } | |
| 1389 }; | |
| 1390 | |
| 1391 // Arity 6 -> 0. | |
| 1392 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1393 typename X3, typename X4, typename X5, typename X6> | |
| 1394 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { | |
| 1395 typedef R(RunType)(BindStateBase*); | |
| 1396 | |
| 1397 typedef R(UnboundRunType)(); | |
| 1398 | |
| 1399 static R Run(BindStateBase* base) { | |
| 1400 StorageType* storage = static_cast<StorageType*>(base); | |
| 1401 | |
| 1402 // Local references to make debugger stepping easier. If in a debugger, | |
| 1403 // you really want to warp ahead and step through the | |
| 1404 // InvokeHelper<>::MakeItSo() call below. | |
| 1405 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1406 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1407 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1408 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1409 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1410 typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; | |
| 1411 | |
| 1412 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1413 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1414 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1415 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1416 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1417 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1418 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1419 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1420 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1421 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1422 typename Bound6UnwrapTraits::ForwardType x6 = | |
| 1423 Bound6UnwrapTraits::Unwrap(storage->p6_); | |
| 1424 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1425 typename StorageType::RunnableType, | |
| 1426 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1427 typename Bound2UnwrapTraits::ForwardType, | |
| 1428 typename Bound3UnwrapTraits::ForwardType, | |
| 1429 typename Bound4UnwrapTraits::ForwardType, | |
| 1430 typename Bound5UnwrapTraits::ForwardType, | |
| 1431 typename Bound6UnwrapTraits::ForwardType)> | |
| 1432 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1433 CallbackForward(x2), CallbackForward(x3), | |
| 1434 CallbackForward(x4), CallbackForward(x5), | |
| 1435 CallbackForward(x6)); | |
| 1436 } | |
| 1437 }; | |
| 1438 | |
| 1439 // Arity 7 -> 7. | |
| 1440 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1441 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1442 struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1443 typedef R(RunType)(BindStateBase*, | |
| 1444 typename CallbackParamTraits<X1>::ForwardType, | |
| 1445 typename CallbackParamTraits<X2>::ForwardType, | |
| 1446 typename CallbackParamTraits<X3>::ForwardType, | |
| 1447 typename CallbackParamTraits<X4>::ForwardType, | |
| 1448 typename CallbackParamTraits<X5>::ForwardType, | |
| 1449 typename CallbackParamTraits<X6>::ForwardType, | |
| 1450 typename CallbackParamTraits<X7>::ForwardType); | |
| 1451 | |
| 1452 typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7); | |
| 1453 | |
| 1454 static R Run(BindStateBase* base, | |
| 1455 typename CallbackParamTraits<X1>::ForwardType x1, | |
| 1456 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1457 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1458 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1459 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1460 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1461 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1462 StorageType* storage = static_cast<StorageType*>(base); | |
| 1463 | |
| 1464 // Local references to make debugger stepping easier. If in a debugger, | |
| 1465 // you really want to warp ahead and step through the | |
| 1466 // InvokeHelper<>::MakeItSo() call below. | |
| 1467 | |
| 1468 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1469 typename StorageType::RunnableType, | |
| 1470 void(typename CallbackParamTraits<X1>::ForwardType x1, | |
| 1471 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1472 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1473 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1474 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1475 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1476 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1477 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1478 CallbackForward(x2), CallbackForward(x3), | |
| 1479 CallbackForward(x4), CallbackForward(x5), | |
| 1480 CallbackForward(x6), CallbackForward(x7)); | |
| 1481 } | |
| 1482 }; | |
| 1483 | |
| 1484 // Arity 7 -> 6. | |
| 1485 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1486 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1487 struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1488 typedef R(RunType)(BindStateBase*, | |
| 1489 typename CallbackParamTraits<X2>::ForwardType, | |
| 1490 typename CallbackParamTraits<X3>::ForwardType, | |
| 1491 typename CallbackParamTraits<X4>::ForwardType, | |
| 1492 typename CallbackParamTraits<X5>::ForwardType, | |
| 1493 typename CallbackParamTraits<X6>::ForwardType, | |
| 1494 typename CallbackParamTraits<X7>::ForwardType); | |
| 1495 | |
| 1496 typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); | |
| 1497 | |
| 1498 static R Run(BindStateBase* base, | |
| 1499 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1500 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1501 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1502 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1503 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1504 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1505 StorageType* storage = static_cast<StorageType*>(base); | |
| 1506 | |
| 1507 // Local references to make debugger stepping easier. If in a debugger, | |
| 1508 // you really want to warp ahead and step through the | |
| 1509 // InvokeHelper<>::MakeItSo() call below. | |
| 1510 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1511 | |
| 1512 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1513 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1514 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1515 typename StorageType::RunnableType, | |
| 1516 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1517 typename CallbackParamTraits<X2>::ForwardType x2, | |
| 1518 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1519 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1520 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1521 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1522 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1523 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1524 CallbackForward(x2), CallbackForward(x3), | |
| 1525 CallbackForward(x4), CallbackForward(x5), | |
| 1526 CallbackForward(x6), CallbackForward(x7)); | |
| 1527 } | |
| 1528 }; | |
| 1529 | |
| 1530 // Arity 7 -> 5. | |
| 1531 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1532 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1533 struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1534 typedef R(RunType)(BindStateBase*, | |
| 1535 typename CallbackParamTraits<X3>::ForwardType, | |
| 1536 typename CallbackParamTraits<X4>::ForwardType, | |
| 1537 typename CallbackParamTraits<X5>::ForwardType, | |
| 1538 typename CallbackParamTraits<X6>::ForwardType, | |
| 1539 typename CallbackParamTraits<X7>::ForwardType); | |
| 1540 | |
| 1541 typedef R(UnboundRunType)(X3, X4, X5, X6, X7); | |
| 1542 | |
| 1543 static R Run(BindStateBase* base, | |
| 1544 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1545 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1546 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1547 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1548 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1549 StorageType* storage = static_cast<StorageType*>(base); | |
| 1550 | |
| 1551 // Local references to make debugger stepping easier. If in a debugger, | |
| 1552 // you really want to warp ahead and step through the | |
| 1553 // InvokeHelper<>::MakeItSo() call below. | |
| 1554 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1555 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1556 | |
| 1557 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1558 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1559 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1560 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1561 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1562 typename StorageType::RunnableType, | |
| 1563 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1564 typename Bound2UnwrapTraits::ForwardType, | |
| 1565 typename CallbackParamTraits<X3>::ForwardType x3, | |
| 1566 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1567 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1568 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1569 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1570 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1571 CallbackForward(x2), CallbackForward(x3), | |
| 1572 CallbackForward(x4), CallbackForward(x5), | |
| 1573 CallbackForward(x6), CallbackForward(x7)); | |
| 1574 } | |
| 1575 }; | |
| 1576 | |
| 1577 // Arity 7 -> 4. | |
| 1578 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1579 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1580 struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1581 typedef R(RunType)(BindStateBase*, | |
| 1582 typename CallbackParamTraits<X4>::ForwardType, | |
| 1583 typename CallbackParamTraits<X5>::ForwardType, | |
| 1584 typename CallbackParamTraits<X6>::ForwardType, | |
| 1585 typename CallbackParamTraits<X7>::ForwardType); | |
| 1586 | |
| 1587 typedef R(UnboundRunType)(X4, X5, X6, X7); | |
| 1588 | |
| 1589 static R Run(BindStateBase* base, | |
| 1590 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1591 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1592 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1593 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1594 StorageType* storage = static_cast<StorageType*>(base); | |
| 1595 | |
| 1596 // Local references to make debugger stepping easier. If in a debugger, | |
| 1597 // you really want to warp ahead and step through the | |
| 1598 // InvokeHelper<>::MakeItSo() call below. | |
| 1599 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1600 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1601 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1602 | |
| 1603 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1604 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1605 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1606 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1607 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1608 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1609 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1610 typename StorageType::RunnableType, | |
| 1611 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1612 typename Bound2UnwrapTraits::ForwardType, | |
| 1613 typename Bound3UnwrapTraits::ForwardType, | |
| 1614 typename CallbackParamTraits<X4>::ForwardType x4, | |
| 1615 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1616 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1617 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1618 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1619 CallbackForward(x2), CallbackForward(x3), | |
| 1620 CallbackForward(x4), CallbackForward(x5), | |
| 1621 CallbackForward(x6), CallbackForward(x7)); | |
| 1622 } | |
| 1623 }; | |
| 1624 | |
| 1625 // Arity 7 -> 3. | |
| 1626 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1627 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1628 struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1629 typedef R(RunType)(BindStateBase*, | |
| 1630 typename CallbackParamTraits<X5>::ForwardType, | |
| 1631 typename CallbackParamTraits<X6>::ForwardType, | |
| 1632 typename CallbackParamTraits<X7>::ForwardType); | |
| 1633 | |
| 1634 typedef R(UnboundRunType)(X5, X6, X7); | |
| 1635 | |
| 1636 static R Run(BindStateBase* base, | |
| 1637 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1638 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1639 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1640 StorageType* storage = static_cast<StorageType*>(base); | |
| 1641 | |
| 1642 // Local references to make debugger stepping easier. If in a debugger, | |
| 1643 // you really want to warp ahead and step through the | |
| 1644 // InvokeHelper<>::MakeItSo() call below. | |
| 1645 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1646 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1647 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1648 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1649 | |
| 1650 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1651 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1652 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1653 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1654 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1655 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1656 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1657 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1658 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1659 typename StorageType::RunnableType, | |
| 1660 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1661 typename Bound2UnwrapTraits::ForwardType, | |
| 1662 typename Bound3UnwrapTraits::ForwardType, | |
| 1663 typename Bound4UnwrapTraits::ForwardType, | |
| 1664 typename CallbackParamTraits<X5>::ForwardType x5, | |
| 1665 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1666 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1667 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1668 CallbackForward(x2), CallbackForward(x3), | |
| 1669 CallbackForward(x4), CallbackForward(x5), | |
| 1670 CallbackForward(x6), CallbackForward(x7)); | |
| 1671 } | |
| 1672 }; | |
| 1673 | |
| 1674 // Arity 7 -> 2. | |
| 1675 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1676 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1677 struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1678 typedef R(RunType)(BindStateBase*, | |
| 1679 typename CallbackParamTraits<X6>::ForwardType, | |
| 1680 typename CallbackParamTraits<X7>::ForwardType); | |
| 1681 | |
| 1682 typedef R(UnboundRunType)(X6, X7); | |
| 1683 | |
| 1684 static R Run(BindStateBase* base, | |
| 1685 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1686 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1687 StorageType* storage = static_cast<StorageType*>(base); | |
| 1688 | |
| 1689 // Local references to make debugger stepping easier. If in a debugger, | |
| 1690 // you really want to warp ahead and step through the | |
| 1691 // InvokeHelper<>::MakeItSo() call below. | |
| 1692 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1693 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1694 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1695 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1696 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1697 | |
| 1698 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1699 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1700 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1701 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1702 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1703 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1704 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1705 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1706 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1707 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1708 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1709 typename StorageType::RunnableType, | |
| 1710 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1711 typename Bound2UnwrapTraits::ForwardType, | |
| 1712 typename Bound3UnwrapTraits::ForwardType, | |
| 1713 typename Bound4UnwrapTraits::ForwardType, | |
| 1714 typename Bound5UnwrapTraits::ForwardType, | |
| 1715 typename CallbackParamTraits<X6>::ForwardType x6, | |
| 1716 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1717 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1718 CallbackForward(x2), CallbackForward(x3), | |
| 1719 CallbackForward(x4), CallbackForward(x5), | |
| 1720 CallbackForward(x6), CallbackForward(x7)); | |
| 1721 } | |
| 1722 }; | |
| 1723 | |
| 1724 // Arity 7 -> 1. | |
| 1725 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1726 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1727 struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1728 typedef R(RunType)(BindStateBase*, | |
| 1729 typename CallbackParamTraits<X7>::ForwardType); | |
| 1730 | |
| 1731 typedef R(UnboundRunType)(X7); | |
| 1732 | |
| 1733 static R Run(BindStateBase* base, | |
| 1734 typename CallbackParamTraits<X7>::ForwardType x7) { | |
| 1735 StorageType* storage = static_cast<StorageType*>(base); | |
| 1736 | |
| 1737 // Local references to make debugger stepping easier. If in a debugger, | |
| 1738 // you really want to warp ahead and step through the | |
| 1739 // InvokeHelper<>::MakeItSo() call below. | |
| 1740 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1741 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1742 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1743 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1744 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1745 typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; | |
| 1746 | |
| 1747 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1748 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1749 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1750 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1751 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1752 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1753 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1754 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1755 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1756 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1757 typename Bound6UnwrapTraits::ForwardType x6 = | |
| 1758 Bound6UnwrapTraits::Unwrap(storage->p6_); | |
| 1759 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1760 typename StorageType::RunnableType, | |
| 1761 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1762 typename Bound2UnwrapTraits::ForwardType, | |
| 1763 typename Bound3UnwrapTraits::ForwardType, | |
| 1764 typename Bound4UnwrapTraits::ForwardType, | |
| 1765 typename Bound5UnwrapTraits::ForwardType, | |
| 1766 typename Bound6UnwrapTraits::ForwardType, | |
| 1767 typename CallbackParamTraits<X7>::ForwardType x7)> | |
| 1768 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1769 CallbackForward(x2), CallbackForward(x3), | |
| 1770 CallbackForward(x4), CallbackForward(x5), | |
| 1771 CallbackForward(x6), CallbackForward(x7)); | |
| 1772 } | |
| 1773 }; | |
| 1774 | |
| 1775 // Arity 7 -> 0. | |
| 1776 template <typename StorageType, typename R,typename X1, typename X2, | |
| 1777 typename X3, typename X4, typename X5, typename X6, typename X7> | |
| 1778 struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { | |
| 1779 typedef R(RunType)(BindStateBase*); | |
| 1780 | |
| 1781 typedef R(UnboundRunType)(); | |
| 1782 | |
| 1783 static R Run(BindStateBase* base) { | |
| 1784 StorageType* storage = static_cast<StorageType*>(base); | |
| 1785 | |
| 1786 // Local references to make debugger stepping easier. If in a debugger, | |
| 1787 // you really want to warp ahead and step through the | |
| 1788 // InvokeHelper<>::MakeItSo() call below. | |
| 1789 typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; | |
| 1790 typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; | |
| 1791 typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; | |
| 1792 typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; | |
| 1793 typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; | |
| 1794 typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; | |
| 1795 typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; | |
| 1796 | |
| 1797 typename Bound1UnwrapTraits::ForwardType x1 = | |
| 1798 Bound1UnwrapTraits::Unwrap(storage->p1_); | |
| 1799 typename Bound2UnwrapTraits::ForwardType x2 = | |
| 1800 Bound2UnwrapTraits::Unwrap(storage->p2_); | |
| 1801 typename Bound3UnwrapTraits::ForwardType x3 = | |
| 1802 Bound3UnwrapTraits::Unwrap(storage->p3_); | |
| 1803 typename Bound4UnwrapTraits::ForwardType x4 = | |
| 1804 Bound4UnwrapTraits::Unwrap(storage->p4_); | |
| 1805 typename Bound5UnwrapTraits::ForwardType x5 = | |
| 1806 Bound5UnwrapTraits::Unwrap(storage->p5_); | |
| 1807 typename Bound6UnwrapTraits::ForwardType x6 = | |
| 1808 Bound6UnwrapTraits::Unwrap(storage->p6_); | |
| 1809 typename Bound7UnwrapTraits::ForwardType x7 = | |
| 1810 Bound7UnwrapTraits::Unwrap(storage->p7_); | |
| 1811 return InvokeHelper<StorageType::IsWeakCall::value, R, | |
| 1812 typename StorageType::RunnableType, | |
| 1813 void(typename Bound1UnwrapTraits::ForwardType, | |
| 1814 typename Bound2UnwrapTraits::ForwardType, | |
| 1815 typename Bound3UnwrapTraits::ForwardType, | |
| 1816 typename Bound4UnwrapTraits::ForwardType, | |
| 1817 typename Bound5UnwrapTraits::ForwardType, | |
| 1818 typename Bound6UnwrapTraits::ForwardType, | |
| 1819 typename Bound7UnwrapTraits::ForwardType)> | |
| 1820 ::MakeItSo(storage->runnable_, CallbackForward(x1), | |
| 1821 CallbackForward(x2), CallbackForward(x3), | |
| 1822 CallbackForward(x4), CallbackForward(x5), | |
| 1823 CallbackForward(x6), CallbackForward(x7)); | |
| 1824 } | |
| 1825 }; | |
| 1826 | |
| 1827 | 349 |
| 1828 // BindState<> | 350 // BindState<> |
| 1829 // | 351 // |
| 1830 // This stores all the state passed into Bind() and is also where most | 352 // This stores all the state passed into Bind() and is also where most |
| 1831 // of the template resolution magic occurs. | 353 // of the template resolution magic occurs. |
| 1832 // | 354 // |
| 1833 // Runnable is the functor we are binding arguments to. | 355 // Runnable is the functor we are binding arguments to. |
| 1834 // RunType is type of the Run() function that the Invoker<> should use. | 356 // RunType is type of the Run() function that the Invoker<> should use. |
| 1835 // Normally, this is the same as the RunType of the Runnable, but it can | 357 // Normally, this is the same as the RunType of the Runnable, but it can |
| 1836 // be different if an adapter like IgnoreResult() has been used. | 358 // be different if an adapter like IgnoreResult() has been used. |
| 1837 // | 359 // |
| 1838 // BoundArgsType contains the storage type for all the bound arguments by | 360 // BoundArgsType contains the storage type for all the bound arguments by |
| 1839 // (ab)using a function type. | 361 // (ab)using a function type. |
| 1840 template <typename Runnable, typename RunType, typename BoundArgsType> | 362 template <typename Runnable, typename RunType, typename BoundArgList> |
| 1841 struct BindState; | 363 struct BindState; |
| 1842 | 364 |
| 1843 template <typename Runnable, typename RunType> | 365 template <typename Runnable, |
| 1844 struct BindState<Runnable, RunType, void()> : public BindStateBase { | 366 typename R, typename... Args, |
| 1845 typedef Runnable RunnableType; | 367 typename... BoundArgs> |
| 1846 typedef false_type IsWeakCall; | 368 struct BindState<Runnable, R(Args...), TypeList<BoundArgs...>> |
| 1847 typedef Invoker<0, BindState, RunType> InvokerType; | 369 : public BindStateBase { |
| 1848 typedef typename InvokerType::UnboundRunType UnboundRunType; | 370 using StorageType = BindState<Runnable, R(Args...), TypeList<BoundArgs...>>; |
| 1849 explicit BindState(const Runnable& runnable) | 371 using RunnableType = Runnable; |
| 1850 : runnable_(runnable) { | |
| 1851 } | |
| 1852 | 372 |
| 1853 virtual ~BindState() { } | 373 // true_type if Runnable is a method invocation and the first bound argument |
| 374 // is a WeakPtr. | |
| 375 using IsWeakCall = | |
| 376 IsWeakMethod<HasIsMethodTag<Runnable>::value, BoundArgs...>; | |
| 377 | |
| 378 using BoundIndexes = MakeIndexSequence<sizeof...(BoundArgs)>; | |
| 379 using Unwrappers = TypeList<UnwrapTraits<BoundArgs>...>; | |
| 380 using UnboundForwardArgs = DropTypeListItem< | |
| 381 sizeof...(BoundArgs), | |
| 382 TypeList<typename CallbackParamTraits<Args>::ForwardType...>>; | |
| 383 using UnboundForwardRunType = MakeFunctionType<R, UnboundForwardArgs>; | |
| 384 | |
| 385 using InvokeHelperArgs = ConcatTypeLists< | |
| 386 TypeList<typename UnwrapTraits<BoundArgs>::ForwardType...>, | |
| 387 UnboundForwardArgs>; | |
| 388 using InvokeHelperType = | |
| 389 InvokeHelper<IsWeakCall::value, R, Runnable, InvokeHelperArgs>; | |
| 390 | |
| 391 using InvokerType = Invoker<BoundIndexes, StorageType, Unwrappers, | |
| 392 InvokeHelperType, UnboundForwardRunType>; | |
| 393 | |
| 394 using UnboundArgs = DropTypeListItem<sizeof...(BoundArgs), TypeList<Args...>>; | |
| 395 using UnboundRunType = MakeFunctionType<R, UnboundArgs>; | |
| 396 | |
| 397 BindState(const Runnable& runnable, const BoundArgs&... bound_args) | |
| 398 : runnable_(runnable), ref_(bound_args...), bound_args_(bound_args...) {} | |
| 399 virtual ~BindState() {} | |
| 1854 | 400 |
| 1855 RunnableType runnable_; | 401 RunnableType runnable_; |
| 1856 }; | 402 MaybeScopedRefPtr<HasIsMethodTag<Runnable>::value, BoundArgs...> ref_; |
| 1857 | 403 Tuple<BoundArgs...> bound_args_; |
| 1858 template <typename Runnable, typename RunType, typename P1> | |
| 1859 struct BindState<Runnable, RunType, void(P1)> : public BindStateBase { | |
| 1860 typedef Runnable RunnableType; | |
| 1861 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 1862 typedef Invoker<1, BindState, RunType> InvokerType; | |
| 1863 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 1864 | |
| 1865 // Convenience typedefs for bound argument types. | |
| 1866 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 1867 | |
| 1868 BindState(const Runnable& runnable, const P1& p1) | |
| 1869 : runnable_(runnable), | |
| 1870 p1_(p1) { | |
| 1871 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 1872 } | |
| 1873 | |
| 1874 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 1875 P1>::Release(p1_); } | |
| 1876 | |
| 1877 RunnableType runnable_; | |
| 1878 P1 p1_; | |
| 1879 }; | |
| 1880 | |
| 1881 template <typename Runnable, typename RunType, typename P1, typename P2> | |
| 1882 struct BindState<Runnable, RunType, void(P1, P2)> : public BindStateBase { | |
| 1883 typedef Runnable RunnableType; | |
| 1884 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 1885 typedef Invoker<2, BindState, RunType> InvokerType; | |
| 1886 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 1887 | |
| 1888 // Convenience typedefs for bound argument types. | |
| 1889 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 1890 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 1891 | |
| 1892 BindState(const Runnable& runnable, const P1& p1, const P2& p2) | |
| 1893 : runnable_(runnable), | |
| 1894 p1_(p1), | |
| 1895 p2_(p2) { | |
| 1896 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 1897 } | |
| 1898 | |
| 1899 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 1900 P1>::Release(p1_); } | |
| 1901 | |
| 1902 RunnableType runnable_; | |
| 1903 P1 p1_; | |
| 1904 P2 p2_; | |
| 1905 }; | |
| 1906 | |
| 1907 template <typename Runnable, typename RunType, typename P1, typename P2, | |
| 1908 typename P3> | |
| 1909 struct BindState<Runnable, RunType, void(P1, P2, P3)> : public BindStateBase { | |
| 1910 typedef Runnable RunnableType; | |
| 1911 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 1912 typedef Invoker<3, BindState, RunType> InvokerType; | |
| 1913 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 1914 | |
| 1915 // Convenience typedefs for bound argument types. | |
| 1916 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 1917 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 1918 typedef UnwrapTraits<P3> Bound3UnwrapTraits; | |
| 1919 | |
| 1920 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3) | |
| 1921 : runnable_(runnable), | |
| 1922 p1_(p1), | |
| 1923 p2_(p2), | |
| 1924 p3_(p3) { | |
| 1925 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 1926 } | |
| 1927 | |
| 1928 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 1929 P1>::Release(p1_); } | |
| 1930 | |
| 1931 RunnableType runnable_; | |
| 1932 P1 p1_; | |
| 1933 P2 p2_; | |
| 1934 P3 p3_; | |
| 1935 }; | |
| 1936 | |
| 1937 template <typename Runnable, typename RunType, typename P1, typename P2, | |
| 1938 typename P3, typename P4> | |
| 1939 struct BindState<Runnable, RunType, void(P1, P2, P3, | |
| 1940 P4)> : public BindStateBase { | |
| 1941 typedef Runnable RunnableType; | |
| 1942 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 1943 typedef Invoker<4, BindState, RunType> InvokerType; | |
| 1944 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 1945 | |
| 1946 // Convenience typedefs for bound argument types. | |
| 1947 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 1948 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 1949 typedef UnwrapTraits<P3> Bound3UnwrapTraits; | |
| 1950 typedef UnwrapTraits<P4> Bound4UnwrapTraits; | |
| 1951 | |
| 1952 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, | |
| 1953 const P4& p4) | |
| 1954 : runnable_(runnable), | |
| 1955 p1_(p1), | |
| 1956 p2_(p2), | |
| 1957 p3_(p3), | |
| 1958 p4_(p4) { | |
| 1959 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 1960 } | |
| 1961 | |
| 1962 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 1963 P1>::Release(p1_); } | |
| 1964 | |
| 1965 RunnableType runnable_; | |
| 1966 P1 p1_; | |
| 1967 P2 p2_; | |
| 1968 P3 p3_; | |
| 1969 P4 p4_; | |
| 1970 }; | |
| 1971 | |
| 1972 template <typename Runnable, typename RunType, typename P1, typename P2, | |
| 1973 typename P3, typename P4, typename P5> | |
| 1974 struct BindState<Runnable, RunType, void(P1, P2, P3, P4, | |
| 1975 P5)> : public BindStateBase { | |
| 1976 typedef Runnable RunnableType; | |
| 1977 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 1978 typedef Invoker<5, BindState, RunType> InvokerType; | |
| 1979 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 1980 | |
| 1981 // Convenience typedefs for bound argument types. | |
| 1982 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 1983 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 1984 typedef UnwrapTraits<P3> Bound3UnwrapTraits; | |
| 1985 typedef UnwrapTraits<P4> Bound4UnwrapTraits; | |
| 1986 typedef UnwrapTraits<P5> Bound5UnwrapTraits; | |
| 1987 | |
| 1988 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, | |
| 1989 const P4& p4, const P5& p5) | |
| 1990 : runnable_(runnable), | |
| 1991 p1_(p1), | |
| 1992 p2_(p2), | |
| 1993 p3_(p3), | |
| 1994 p4_(p4), | |
| 1995 p5_(p5) { | |
| 1996 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 1997 } | |
| 1998 | |
| 1999 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 2000 P1>::Release(p1_); } | |
| 2001 | |
| 2002 RunnableType runnable_; | |
| 2003 P1 p1_; | |
| 2004 P2 p2_; | |
| 2005 P3 p3_; | |
| 2006 P4 p4_; | |
| 2007 P5 p5_; | |
| 2008 }; | |
| 2009 | |
| 2010 template <typename Runnable, typename RunType, typename P1, typename P2, | |
| 2011 typename P3, typename P4, typename P5, typename P6> | |
| 2012 struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, | |
| 2013 P6)> : public BindStateBase { | |
| 2014 typedef Runnable RunnableType; | |
| 2015 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 2016 typedef Invoker<6, BindState, RunType> InvokerType; | |
| 2017 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 2018 | |
| 2019 // Convenience typedefs for bound argument types. | |
| 2020 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 2021 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 2022 typedef UnwrapTraits<P3> Bound3UnwrapTraits; | |
| 2023 typedef UnwrapTraits<P4> Bound4UnwrapTraits; | |
| 2024 typedef UnwrapTraits<P5> Bound5UnwrapTraits; | |
| 2025 typedef UnwrapTraits<P6> Bound6UnwrapTraits; | |
| 2026 | |
| 2027 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, | |
| 2028 const P4& p4, const P5& p5, const P6& p6) | |
| 2029 : runnable_(runnable), | |
| 2030 p1_(p1), | |
| 2031 p2_(p2), | |
| 2032 p3_(p3), | |
| 2033 p4_(p4), | |
| 2034 p5_(p5), | |
| 2035 p6_(p6) { | |
| 2036 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 2037 } | |
| 2038 | |
| 2039 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 2040 P1>::Release(p1_); } | |
| 2041 | |
| 2042 RunnableType runnable_; | |
| 2043 P1 p1_; | |
| 2044 P2 p2_; | |
| 2045 P3 p3_; | |
| 2046 P4 p4_; | |
| 2047 P5 p5_; | |
| 2048 P6 p6_; | |
| 2049 }; | |
| 2050 | |
| 2051 template <typename Runnable, typename RunType, typename P1, typename P2, | |
| 2052 typename P3, typename P4, typename P5, typename P6, typename P7> | |
| 2053 struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, | |
| 2054 P7)> : public BindStateBase { | |
| 2055 typedef Runnable RunnableType; | |
| 2056 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; | |
| 2057 typedef Invoker<7, BindState, RunType> InvokerType; | |
| 2058 typedef typename InvokerType::UnboundRunType UnboundRunType; | |
| 2059 | |
| 2060 // Convenience typedefs for bound argument types. | |
| 2061 typedef UnwrapTraits<P1> Bound1UnwrapTraits; | |
| 2062 typedef UnwrapTraits<P2> Bound2UnwrapTraits; | |
| 2063 typedef UnwrapTraits<P3> Bound3UnwrapTraits; | |
| 2064 typedef UnwrapTraits<P4> Bound4UnwrapTraits; | |
| 2065 typedef UnwrapTraits<P5> Bound5UnwrapTraits; | |
| 2066 typedef UnwrapTraits<P6> Bound6UnwrapTraits; | |
| 2067 typedef UnwrapTraits<P7> Bound7UnwrapTraits; | |
| 2068 | |
| 2069 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, | |
| 2070 const P4& p4, const P5& p5, const P6& p6, const P7& p7) | |
| 2071 : runnable_(runnable), | |
| 2072 p1_(p1), | |
| 2073 p2_(p2), | |
| 2074 p3_(p3), | |
| 2075 p4_(p4), | |
| 2076 p5_(p5), | |
| 2077 p6_(p6), | |
| 2078 p7_(p7) { | |
| 2079 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); | |
| 2080 } | |
| 2081 | |
| 2082 virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, | |
| 2083 P1>::Release(p1_); } | |
| 2084 | |
| 2085 RunnableType runnable_; | |
| 2086 P1 p1_; | |
| 2087 P2 p2_; | |
| 2088 P3 p3_; | |
| 2089 P4 p4_; | |
| 2090 P5 p5_; | |
| 2091 P6 p6_; | |
| 2092 P7 p7_; | |
| 2093 }; | 404 }; |
| 2094 | 405 |
| 2095 } // namespace internal | 406 } // namespace internal |
| 2096 } // namespace base | 407 } // namespace base |
| 2097 | 408 |
| 2098 #endif // BASE_BIND_INTERNAL_H_ | 409 #endif // BASE_BIND_INTERNAL_H_ |
| OLD | NEW |