Mechanical rename of tracing includes for /chrome
[chromium-blink-merge.git] / base / bind_internal.h
blobb568c162f5864114997d31afaa778def135157fd
1 // This file was GENERATED by command:
2 // pump.py bind_internal.h.pump
3 // DO NOT EDIT BY HAND!!!
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file.
10 #ifndef BASE_BIND_INTERNAL_H_
11 #define BASE_BIND_INTERNAL_H_
13 #include "base/bind_helpers.h"
14 #include "base/callback_internal.h"
15 #include "base/memory/raw_scoped_refptr_mismatch_checker.h"
16 #include "base/memory/weak_ptr.h"
17 #include "base/template_util.h"
18 #include "build/build_config.h"
20 #if defined(OS_WIN)
21 #include "base/bind_internal_win.h"
22 #endif
24 namespace base {
25 namespace internal {
27 // See base/callback.h for user documentation.
30 // CONCEPTS:
31 // Runnable -- A type (really a type class) that has a single Run() method
32 // and a RunType typedef that corresponds to the type of Run().
33 // A Runnable can declare that it should treated like a method
34 // call by including a typedef named IsMethod. The value of
35 // this typedef is NOT inspected, only the existence. When a
36 // Runnable declares itself a method, Bind() will enforce special
37 // refcounting + WeakPtr handling semantics for the first
38 // parameter which is expected to be an object.
39 // Functor -- A copyable type representing something that should be called.
40 // All function pointers, Callback<>, and Runnables are functors
41 // even if the invocation syntax differs.
42 // RunType -- A function type (as opposed to function _pointer_ type) for
43 // a Run() function. Usually just a convenience typedef.
44 // (Bound)ArgsType -- A function type that is being (ab)used to store the
45 // types of set of arguments. The "return" type is always
46 // void here. We use this hack so that we do not need
47 // a new type name for each arity of type. (eg.,
48 // BindState1, BindState2). This makes forward
49 // declarations and friending much much easier.
51 // Types:
52 // RunnableAdapter<> -- Wraps the various "function" pointer types into an
53 // 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
59 // equivalent forms with a "void" return type.
60 // FunctorTraits<> -- Type traits used determine the correct RunType and
61 // RunnableType for a Functor. This is where function
62 // signature adapters are applied.
63 // MakeRunnable<> -- Takes a Functor and returns an object in the Runnable
64 // type class that represents the underlying Functor.
65 // There are |O(1)| MakeRunnable types.
66 // InvokeHelper<> -- Take a Runnable + arguments and actully invokes it.
67 // Handle the differing syntaxes needed for WeakPtr<> support,
68 // and for ignoring return values. This is separate from
69 // Invoker to avoid creating multiple version of Invoker<>
70 // which grows at O(n^2) with the arity.
71 // Invoker<> -- Unwraps the curried parameters and executes the Runnable.
72 // There are |(ARITY^2 + ARITY)/2| Invoketypes.
73 // BindState<> -- Stores the curried parameters, and is the main entry point
74 // into the Bind() system, doing most of the type resolution.
75 // There are ARITY BindState types.
77 // HasNonConstReferenceParam selects true_type when any of the parameters in
78 // |Sig| is a non-const reference.
79 // Implementation note: This non-specialized case handles zero-arity case only.
80 // Non-zero-arity cases should be handled by the specialization below.
81 template <typename Sig>
82 struct HasNonConstReferenceParam : false_type {};
84 // Implementation note: Select true_type if the first parameter is a non-const
85 // reference. Otherwise, skip the first parameter and check rest of parameters
86 // recursively.
87 template <typename R, typename T, typename... Args>
88 struct HasNonConstReferenceParam<R(T, Args...)>
89 : SelectType<is_non_const_reference<T>::value,
90 true_type,
91 HasNonConstReferenceParam<R(Args...)>>::Type {};
93 // HasRefCountedTypeAsRawPtr selects true_type when any of the |Args| is a raw
94 // pointer to a RefCounted type.
95 // Implementation note: This non-specialized case handles zero-arity case only.
96 // Non-zero-arity cases should be handled by the specialization below.
97 template <typename... Args>
98 struct HasRefCountedTypeAsRawPtr : false_type {};
100 // Implementation note: Select true_type if the first parameter is a raw pointer
101 // to a RefCounted type. Otherwise, skip the first parameter and check rest of
102 // parameters recursively.
103 template <typename T, typename... Args>
104 struct HasRefCountedTypeAsRawPtr<T, Args...>
105 : SelectType<NeedsScopedRefptrButGetsRawPtr<T>::value,
106 true_type,
107 HasRefCountedTypeAsRawPtr<Args...>>::Type {};
109 // BindsArrayToFirstArg selects true_type when |is_method| is true and the first
110 // item of |Args| is an array type.
111 // Implementation note: This non-specialized case handles !is_method case and
112 // zero-arity case only. Other cases should be handled by the specialization
113 // below.
114 template <bool is_method, typename... Args>
115 struct BindsArrayToFirstArg : false_type {};
117 template <typename T, typename... Args>
118 struct BindsArrayToFirstArg<true, T, Args...> : is_array<T> {};
120 // HasRefCountedParamAsRawPtr is the same to HasRefCountedTypeAsRawPtr except
121 // when |is_method| is true HasRefCountedParamAsRawPtr skips the first argument.
122 // Implementation note: This non-specialized case handles !is_method case and
123 // zero-arity case only. Other cases should be handled by the specialization
124 // below.
125 template <bool is_method, typename... Args>
126 struct HasRefCountedParamAsRawPtr : HasRefCountedTypeAsRawPtr<Args...> {};
128 template <typename T, typename... Args>
129 struct HasRefCountedParamAsRawPtr<true, T, Args...>
130 : HasRefCountedTypeAsRawPtr<Args...> {};
132 // RunnableAdapter<>
134 // The RunnableAdapter<> templates provide a uniform interface for invoking
135 // a function pointer, method pointer, or const method pointer. The adapter
136 // exposes a Run() method with an appropriate signature. Using this wrapper
137 // allows for writing code that supports all three pointer types without
138 // undue repetition. Without it, a lot of code would need to be repeated 3
139 // times.
141 // For method pointers and const method pointers the first argument to Run()
142 // is considered to be the received of the method. This is similar to STL's
143 // mem_fun().
145 // This class also exposes a RunType typedef that is the function type of the
146 // Run() function.
148 // If and only if the wrapper contains a method or const method pointer, an
149 // IsMethod typedef is exposed. The existence of this typedef (NOT the value)
150 // marks that the wrapper should be considered a method wrapper.
152 template <typename Functor>
153 class RunnableAdapter;
155 // Function.
156 template <typename R, typename... Args>
157 class RunnableAdapter<R(*)(Args...)> {
158 public:
159 typedef R (RunType)(Args...);
161 explicit RunnableAdapter(R(*function)(Args...))
162 : function_(function) {
165 R Run(typename CallbackParamTraits<Args>::ForwardType... args) {
166 return function_(CallbackForward(args)...);
169 private:
170 R (*function_)(Args...);
173 // Method.
174 template <typename R, typename T, typename... Args>
175 class RunnableAdapter<R(T::*)(Args...)> {
176 public:
177 typedef R (RunType)(T*, Args...);
178 typedef true_type IsMethod;
180 explicit RunnableAdapter(R(T::*method)(Args...))
181 : method_(method) {
184 R Run(T* object, typename CallbackParamTraits<Args>::ForwardType... args) {
185 return (object->*method_)(CallbackForward(args)...);
188 private:
189 R (T::*method_)(Args...);
192 // Const Method.
193 template <typename R, typename T, typename... Args>
194 class RunnableAdapter<R(T::*)(Args...) const> {
195 public:
196 typedef R (RunType)(const T*, Args...);
197 typedef true_type IsMethod;
199 explicit RunnableAdapter(R(T::*method)(Args...) const)
200 : method_(method) {
203 R Run(const T* object,
204 typename CallbackParamTraits<Args>::ForwardType... args) {
205 return (object->*method_)(CallbackForward(args)...);
208 private:
209 R (T::*method_)(Args...) const;
212 // TODO(tzik): Remove FunctionTraits after we finish removing bind.pump.
213 // FunctionTraits<>
215 // Breaks a function signature apart into typedefs for easier introspection.
216 template <typename Sig>
217 struct FunctionTraits;
219 template <typename R>
220 struct FunctionTraits<R()> {
221 typedef R ReturnType;
224 template <typename R, typename A1>
225 struct FunctionTraits<R(A1)> {
226 typedef R ReturnType;
227 typedef A1 A1Type;
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;
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;
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;
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;
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;
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;
291 // ForceVoidReturn<>
293 // Set of templates that support forcing the function return type to void.
294 template <typename Sig>
295 struct ForceVoidReturn;
297 template <typename R, typename... Args>
298 struct ForceVoidReturn<R(Args...)> {
299 typedef void(RunType)(Args...);
303 // FunctorTraits<>
305 // See description at top of file.
306 template <typename T>
307 struct FunctorTraits {
308 typedef RunnableAdapter<T> RunnableType;
309 typedef typename RunnableType::RunType RunType;
312 template <typename T>
313 struct FunctorTraits<IgnoreResultHelper<T> > {
314 typedef typename FunctorTraits<T>::RunnableType RunnableType;
315 typedef typename ForceVoidReturn<
316 typename RunnableType::RunType>::RunType RunType;
319 template <typename T>
320 struct FunctorTraits<Callback<T> > {
321 typedef Callback<T> RunnableType;
322 typedef typename Callback<T>::RunType RunType;
326 // MakeRunnable<>
328 // Converts a passed in functor to a RunnableType using type inference.
330 template <typename T>
331 typename FunctorTraits<T>::RunnableType MakeRunnable(const T& t) {
332 return RunnableAdapter<T>(t);
335 template <typename T>
336 typename FunctorTraits<T>::RunnableType
337 MakeRunnable(const IgnoreResultHelper<T>& t) {
338 return MakeRunnable(t.functor_);
341 template <typename T>
342 const typename FunctorTraits<Callback<T> >::RunnableType&
343 MakeRunnable(const Callback<T>& t) {
344 DCHECK(!t.is_null());
345 return t;
349 // InvokeHelper<>
351 // There are 3 logical InvokeHelper<> specializations: normal, void-return,
352 // WeakCalls.
354 // The normal type just calls the underlying runnable.
356 // We need a InvokeHelper to handle void return types in order to support
357 // IgnoreResult(). Normally, if the Runnable's RunType had a void return,
358 // the template system would just accept "return functor.Run()" ignoring
359 // the fact that a void function is being used with return. This piece of
360 // sugar breaks though when the Runnable's RunType is not void. Thus, we
361 // need a partial specialization to change the syntax to drop the "return"
362 // from the invocation call.
364 // WeakCalls similarly need special syntax that is applied to the first
365 // argument to check if they should no-op themselves.
366 template <bool IsWeakCall, typename ReturnType, typename Runnable,
367 typename ArgsType>
368 struct InvokeHelper;
370 template <typename ReturnType, typename Runnable, typename... Args>
371 struct InvokeHelper<false, ReturnType, Runnable,
372 void(Args...)> {
373 static ReturnType MakeItSo(Runnable runnable, Args... args) {
374 return runnable.Run(CallbackForward(args)...);
378 template <typename Runnable, typename... Args>
379 struct InvokeHelper<false, void, Runnable, void(Args...)> {
380 static void MakeItSo(Runnable runnable, Args... args) {
381 runnable.Run(CallbackForward(args)...);
385 template <typename Runnable, typename BoundWeakPtr, typename... Args>
386 struct InvokeHelper<true, void, Runnable, void(BoundWeakPtr, Args...)> {
387 static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, Args... args) {
388 if (!weak_ptr.get()) {
389 return;
391 runnable.Run(weak_ptr.get(), CallbackForward(args)...);
395 #if !defined(_MSC_VER)
397 template <typename ReturnType, typename Runnable, typename ArgsType>
398 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> {
399 // WeakCalls are only supported for functions with a void return type.
400 // Otherwise, the function result would be undefined if the the WeakPtr<>
401 // is invalidated.
402 COMPILE_ASSERT(is_void<ReturnType>::value,
403 weak_ptrs_can_only_bind_to_methods_without_return_values);
406 #endif
408 // Invoker<>
410 // See description at the top of the file.
411 template <int NumBound, typename Storage, typename RunType>
412 struct Invoker;
414 // Arity 0 -> 0.
415 template <typename StorageType, typename R>
416 struct Invoker<0, StorageType, R()> {
417 typedef R(RunType)(BindStateBase*);
419 typedef R(UnboundRunType)();
421 static R Run(BindStateBase* base) {
422 StorageType* storage = static_cast<StorageType*>(base);
424 // Local references to make debugger stepping easier. If in a debugger,
425 // you really want to warp ahead and step through the
426 // InvokeHelper<>::MakeItSo() call below.
428 return InvokeHelper<StorageType::IsWeakCall::value, R,
429 typename StorageType::RunnableType,
430 void()>
431 ::MakeItSo(storage->runnable_);
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);
441 typedef R(UnboundRunType)(X1);
443 static R Run(BindStateBase* base,
444 typename CallbackParamTraits<X1>::ForwardType x1) {
445 StorageType* storage = static_cast<StorageType*>(base);
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.
451 return InvokeHelper<StorageType::IsWeakCall::value, R,
452 typename StorageType::RunnableType,
453 void(typename CallbackParamTraits<X1>::ForwardType x1)>
454 ::MakeItSo(storage->runnable_, CallbackForward(x1));
458 // Arity 1 -> 0.
459 template <typename StorageType, typename R,typename X1>
460 struct Invoker<1, StorageType, R(X1)> {
461 typedef R(RunType)(BindStateBase*);
463 typedef R(UnboundRunType)();
465 static R Run(BindStateBase* base) {
466 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
489 typedef R(UnboundRunType)(X1, X2);
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);
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.
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));
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);
515 typedef R(UnboundRunType)(X2);
517 static R Run(BindStateBase* base,
518 typename CallbackParamTraits<X2>::ForwardType x2) {
519 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
542 typedef R(UnboundRunType)();
544 static R Run(BindStateBase* base) {
545 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
575 typedef R(UnboundRunType)(X1, X2, X3);
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);
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.
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));
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);
605 typedef R(UnboundRunType)(X2, X3);
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);
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;
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));
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);
636 typedef R(UnboundRunType)(X3);
638 static R Run(BindStateBase* base,
639 typename CallbackParamTraits<X3>::ForwardType x3) {
640 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
668 typedef R(UnboundRunType)();
670 static R Run(BindStateBase* base) {
671 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
706 typedef R(UnboundRunType)(X1, X2, X3, X4);
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);
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.
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));
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);
740 typedef R(UnboundRunType)(X2, X3, X4);
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);
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;
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));
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);
775 typedef R(UnboundRunType)(X3, X4);
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);
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;
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));
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);
811 typedef R(UnboundRunType)(X4);
813 static R Run(BindStateBase* base,
814 typename CallbackParamTraits<X4>::ForwardType x4) {
815 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
848 typedef R(UnboundRunType)();
850 static R Run(BindStateBase* base) {
851 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
892 typedef R(UnboundRunType)(X1, X2, X3, X4, X5);
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);
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.
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));
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);
929 typedef R(UnboundRunType)(X2, X3, X4, X5);
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);
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;
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));
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);
967 typedef R(UnboundRunType)(X3, X4, X5);
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);
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;
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));
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);
1006 typedef R(UnboundRunType)(X4, X5);
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);
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;
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));
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);
1046 typedef R(UnboundRunType)(X5);
1048 static R Run(BindStateBase* base,
1049 typename CallbackParamTraits<X5>::ForwardType x5) {
1050 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
1087 typedef R(UnboundRunType)();
1089 static R Run(BindStateBase* base) {
1090 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
1136 typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6);
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);
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.
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));
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);
1177 typedef R(UnboundRunType)(X2, X3, X4, X5, X6);
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);
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;
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));
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);
1219 typedef R(UnboundRunType)(X3, X4, X5, X6);
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);
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;
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));
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);
1262 typedef R(UnboundRunType)(X4, X5, X6);
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);
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;
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));
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);
1306 typedef R(UnboundRunType)(X5, X6);
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);
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;
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));
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);
1351 typedef R(UnboundRunType)(X6);
1353 static R Run(BindStateBase* base,
1354 typename CallbackParamTraits<X6>::ForwardType x6) {
1355 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
1397 typedef R(UnboundRunType)();
1399 static R Run(BindStateBase* base) {
1400 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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);
1452 typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7);
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);
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.
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));
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);
1496 typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7);
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);
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;
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));
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);
1541 typedef R(UnboundRunType)(X3, X4, X5, X6, X7);
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);
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;
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));
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);
1587 typedef R(UnboundRunType)(X4, X5, X6, X7);
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);
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;
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));
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);
1634 typedef R(UnboundRunType)(X5, X6, X7);
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);
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;
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));
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);
1682 typedef R(UnboundRunType)(X6, X7);
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);
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;
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));
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);
1731 typedef R(UnboundRunType)(X7);
1733 static R Run(BindStateBase* base,
1734 typename CallbackParamTraits<X7>::ForwardType x7) {
1735 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
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*);
1781 typedef R(UnboundRunType)();
1783 static R Run(BindStateBase* base) {
1784 StorageType* storage = static_cast<StorageType*>(base);
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;
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));
1828 // BindState<>
1830 // This stores all the state passed into Bind() and is also where most
1831 // of the template resolution magic occurs.
1833 // Runnable is the functor we are binding arguments to.
1834 // 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
1836 // be different if an adapter like IgnoreResult() has been used.
1838 // BoundArgsType contains the storage type for all the bound arguments by
1839 // (ab)using a function type.
1840 template <typename Runnable, typename RunType, typename BoundArgsType>
1841 struct BindState;
1843 template <typename Runnable, typename RunType>
1844 struct BindState<Runnable, RunType, void()> : public BindStateBase {
1845 typedef Runnable RunnableType;
1846 typedef false_type IsWeakCall;
1847 typedef Invoker<0, BindState, RunType> InvokerType;
1848 typedef typename InvokerType::UnboundRunType UnboundRunType;
1849 explicit BindState(const Runnable& runnable)
1850 : runnable_(runnable) {
1853 RunnableType runnable_;
1855 private:
1856 ~BindState() override { }
1860 template <typename Runnable, typename RunType, typename P1>
1861 struct BindState<Runnable, RunType, void(P1)> : public BindStateBase {
1862 typedef Runnable RunnableType;
1863 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
1864 typedef Invoker<1, BindState, RunType> InvokerType;
1865 typedef typename InvokerType::UnboundRunType UnboundRunType;
1867 // Convenience typedefs for bound argument types.
1868 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
1870 BindState(const Runnable& runnable, const P1& p1)
1871 : runnable_(runnable),
1872 p1_(p1) {
1873 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
1876 RunnableType runnable_;
1877 P1 p1_;
1879 private:
1880 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
1881 P1>::Release(p1_); }
1885 template <typename Runnable, typename RunType, typename P1, typename P2>
1886 struct BindState<Runnable, RunType, void(P1, P2)> : public BindStateBase {
1887 typedef Runnable RunnableType;
1888 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
1889 typedef Invoker<2, BindState, RunType> InvokerType;
1890 typedef typename InvokerType::UnboundRunType UnboundRunType;
1892 // Convenience typedefs for bound argument types.
1893 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
1894 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
1896 BindState(const Runnable& runnable, const P1& p1, const P2& p2)
1897 : runnable_(runnable),
1898 p1_(p1),
1899 p2_(p2) {
1900 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
1903 RunnableType runnable_;
1904 P1 p1_;
1905 P2 p2_;
1907 private:
1908 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
1909 P1>::Release(p1_); }
1913 template <typename Runnable, typename RunType, typename P1, typename P2,
1914 typename P3>
1915 struct BindState<Runnable, RunType, void(P1, P2, P3)> : public BindStateBase {
1916 typedef Runnable RunnableType;
1917 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
1918 typedef Invoker<3, BindState, RunType> InvokerType;
1919 typedef typename InvokerType::UnboundRunType UnboundRunType;
1921 // Convenience typedefs for bound argument types.
1922 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
1923 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
1924 typedef UnwrapTraits<P3> Bound3UnwrapTraits;
1926 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3)
1927 : runnable_(runnable),
1928 p1_(p1),
1929 p2_(p2),
1930 p3_(p3) {
1931 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
1934 RunnableType runnable_;
1935 P1 p1_;
1936 P2 p2_;
1937 P3 p3_;
1939 private:
1940 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
1941 P1>::Release(p1_); }
1945 template <typename Runnable, typename RunType, typename P1, typename P2,
1946 typename P3, typename P4>
1947 struct BindState<Runnable, RunType, void(P1, P2, P3,
1948 P4)> : public BindStateBase {
1949 typedef Runnable RunnableType;
1950 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
1951 typedef Invoker<4, BindState, RunType> InvokerType;
1952 typedef typename InvokerType::UnboundRunType UnboundRunType;
1954 // Convenience typedefs for bound argument types.
1955 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
1956 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
1957 typedef UnwrapTraits<P3> Bound3UnwrapTraits;
1958 typedef UnwrapTraits<P4> Bound4UnwrapTraits;
1960 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
1961 const P4& p4)
1962 : runnable_(runnable),
1963 p1_(p1),
1964 p2_(p2),
1965 p3_(p3),
1966 p4_(p4) {
1967 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
1970 RunnableType runnable_;
1971 P1 p1_;
1972 P2 p2_;
1973 P3 p3_;
1974 P4 p4_;
1976 private:
1977 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
1978 P1>::Release(p1_); }
1982 template <typename Runnable, typename RunType, typename P1, typename P2,
1983 typename P3, typename P4, typename P5>
1984 struct BindState<Runnable, RunType, void(P1, P2, P3, P4,
1985 P5)> : public BindStateBase {
1986 typedef Runnable RunnableType;
1987 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
1988 typedef Invoker<5, BindState, RunType> InvokerType;
1989 typedef typename InvokerType::UnboundRunType UnboundRunType;
1991 // Convenience typedefs for bound argument types.
1992 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
1993 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
1994 typedef UnwrapTraits<P3> Bound3UnwrapTraits;
1995 typedef UnwrapTraits<P4> Bound4UnwrapTraits;
1996 typedef UnwrapTraits<P5> Bound5UnwrapTraits;
1998 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
1999 const P4& p4, const P5& p5)
2000 : runnable_(runnable),
2001 p1_(p1),
2002 p2_(p2),
2003 p3_(p3),
2004 p4_(p4),
2005 p5_(p5) {
2006 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
2009 RunnableType runnable_;
2010 P1 p1_;
2011 P2 p2_;
2012 P3 p3_;
2013 P4 p4_;
2014 P5 p5_;
2016 private:
2017 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
2018 P1>::Release(p1_); }
2022 template <typename Runnable, typename RunType, typename P1, typename P2,
2023 typename P3, typename P4, typename P5, typename P6>
2024 struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,
2025 P6)> : public BindStateBase {
2026 typedef Runnable RunnableType;
2027 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
2028 typedef Invoker<6, BindState, RunType> InvokerType;
2029 typedef typename InvokerType::UnboundRunType UnboundRunType;
2031 // Convenience typedefs for bound argument types.
2032 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
2033 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
2034 typedef UnwrapTraits<P3> Bound3UnwrapTraits;
2035 typedef UnwrapTraits<P4> Bound4UnwrapTraits;
2036 typedef UnwrapTraits<P5> Bound5UnwrapTraits;
2037 typedef UnwrapTraits<P6> Bound6UnwrapTraits;
2039 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
2040 const P4& p4, const P5& p5, const P6& p6)
2041 : runnable_(runnable),
2042 p1_(p1),
2043 p2_(p2),
2044 p3_(p3),
2045 p4_(p4),
2046 p5_(p5),
2047 p6_(p6) {
2048 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
2051 RunnableType runnable_;
2052 P1 p1_;
2053 P2 p2_;
2054 P3 p3_;
2055 P4 p4_;
2056 P5 p5_;
2057 P6 p6_;
2059 private:
2060 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
2061 P1>::Release(p1_); }
2065 template <typename Runnable, typename RunType, typename P1, typename P2,
2066 typename P3, typename P4, typename P5, typename P6, typename P7>
2067 struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6,
2068 P7)> : public BindStateBase {
2069 typedef Runnable RunnableType;
2070 typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
2071 typedef Invoker<7, BindState, RunType> InvokerType;
2072 typedef typename InvokerType::UnboundRunType UnboundRunType;
2074 // Convenience typedefs for bound argument types.
2075 typedef UnwrapTraits<P1> Bound1UnwrapTraits;
2076 typedef UnwrapTraits<P2> Bound2UnwrapTraits;
2077 typedef UnwrapTraits<P3> Bound3UnwrapTraits;
2078 typedef UnwrapTraits<P4> Bound4UnwrapTraits;
2079 typedef UnwrapTraits<P5> Bound5UnwrapTraits;
2080 typedef UnwrapTraits<P6> Bound6UnwrapTraits;
2081 typedef UnwrapTraits<P7> Bound7UnwrapTraits;
2083 BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
2084 const P4& p4, const P5& p5, const P6& p6, const P7& p7)
2085 : runnable_(runnable),
2086 p1_(p1),
2087 p2_(p2),
2088 p3_(p3),
2089 p4_(p4),
2090 p5_(p5),
2091 p6_(p6),
2092 p7_(p7) {
2093 MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
2096 RunnableType runnable_;
2097 P1 p1_;
2098 P2 p2_;
2099 P3 p3_;
2100 P4 p4_;
2101 P5 p5_;
2102 P6 p6_;
2103 P7 p7_;
2105 private:
2106 ~BindState() override { MaybeRefcount<HasIsMethodTag<Runnable>::value,
2107 P1>::Release(p1_); }
2111 } // namespace internal
2112 } // namespace base
2114 #endif // BASE_BIND_INTERNAL_H_