Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: base/tuple.h

Issue 17911007: Have DispatchToMethod use base::internal::UnwrapTraits when dispatching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // 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
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A Tuple is a generic templatized container, similar in concept to std::pair. 5 // A Tuple is a generic templatized container, similar in concept to std::pair.
6 // There are classes Tuple0 to Tuple6, cooresponding to the number of elements 6 // There are classes Tuple0 to Tuple6, cooresponding to the number of elements
7 // it contains. The convenient MakeTuple() function takes 0 to 6 arguments, 7 // it contains. The convenient MakeTuple() function takes 0 to 6 arguments,
8 // and will construct and return the appropriate Tuple object. The functions 8 // and will construct and return the appropriate Tuple object. The functions
9 // DispatchToMethod and DispatchToFunction take a function pointer or instance 9 // DispatchToMethod and DispatchToFunction take a function pointer or instance
10 // and method pointer, and unpack a tuple into arguments to the call. 10 // and method pointer, and unpack a tuple into arguments to the call.
(...skipping 11 matching lines...) Expand all
22 // DispatchToFunction( 22 // DispatchToFunction(
23 // &SomeFunc, MakeTuple(10, "foo")); // SomeFunc(10, "foo") 23 // &SomeFunc, MakeTuple(10, "foo")); // SomeFunc(10, "foo")
24 // 24 //
25 // struct { void SomeMeth(int a, int b, int c) { } } foo; 25 // struct { void SomeMeth(int a, int b, int c) { } } foo;
26 // DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3)); 26 // DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3));
27 // // foo->SomeMeth(1, 2, 3); 27 // // foo->SomeMeth(1, 2, 3);
28 28
29 #ifndef BASE_TUPLE_H__ 29 #ifndef BASE_TUPLE_H__
30 #define BASE_TUPLE_H__ 30 #define BASE_TUPLE_H__
31 31
32 #include "base/bind_helpers.h"
33
32 // Traits ---------------------------------------------------------------------- 34 // Traits ----------------------------------------------------------------------
33 // 35 //
34 // A simple traits class for tuple arguments. 36 // A simple traits class for tuple arguments.
35 // 37 //
36 // ValueType: the bare, nonref version of a type (same as the type for nonrefs). 38 // ValueType: the bare, nonref version of a type (same as the type for nonrefs).
37 // RefType: the ref version of a type (same as the type for refs). 39 // RefType: the ref version of a type (same as the type for refs).
38 // ParamType: what type to pass to functions (refs should not be constified). 40 // ParamType: what type to pass to functions (refs should not be constified).
39 41
40 template <class P> 42 template <class P>
41 struct TupleTraits { 43 struct TupleTraits {
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 533
532 // Non-Static Dispatchers with no out params. 534 // Non-Static Dispatchers with no out params.
533 535
534 template <class ObjT, class Method> 536 template <class ObjT, class Method>
535 inline void DispatchToMethod(ObjT* obj, Method method, const Tuple0& arg) { 537 inline void DispatchToMethod(ObjT* obj, Method method, const Tuple0& arg) {
536 (obj->*method)(); 538 (obj->*method)();
537 } 539 }
538 540
539 template <class ObjT, class Method, class A> 541 template <class ObjT, class Method, class A>
540 inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) { 542 inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) {
541 (obj->*method)(arg); 543 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg));
542 } 544 }
543 545
544 template <class ObjT, class Method, class A> 546 template <class ObjT, class Method, class A>
545 inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1<A>& arg) { 547 inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1<A>& arg) {
546 (obj->*method)(arg.a); 548 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a));
547 } 549 }
548 550
549 template<class ObjT, class Method, class A, class B> 551 template<class ObjT, class Method, class A, class B>
550 inline void DispatchToMethod(ObjT* obj, 552 inline void DispatchToMethod(ObjT* obj,
551 Method method, 553 Method method,
552 const Tuple2<A, B>& arg) { 554 const Tuple2<A, B>& arg) {
553 (obj->*method)(arg.a, arg.b); 555 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
556 base::internal::UnwrapTraits<B>::Unwrap(arg.b));
554 } 557 }
555 558
556 template<class ObjT, class Method, class A, class B, class C> 559 template<class ObjT, class Method, class A, class B, class C>
557 inline void DispatchToMethod(ObjT* obj, Method method, 560 inline void DispatchToMethod(ObjT* obj, Method method,
558 const Tuple3<A, B, C>& arg) { 561 const Tuple3<A, B, C>& arg) {
559 (obj->*method)(arg.a, arg.b, arg.c); 562 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
563 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
564 base::internal::UnwrapTraits<C>::Unwrap(arg.c));
560 } 565 }
561 566
562 template<class ObjT, class Method, class A, class B, class C, class D> 567 template<class ObjT, class Method, class A, class B, class C, class D>
563 inline void DispatchToMethod(ObjT* obj, Method method, 568 inline void DispatchToMethod(ObjT* obj, Method method,
564 const Tuple4<A, B, C, D>& arg) { 569 const Tuple4<A, B, C, D>& arg) {
565 (obj->*method)(arg.a, arg.b, arg.c, arg.d); 570 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
571 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
572 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
573 base::internal::UnwrapTraits<D>::Unwrap(arg.d));
566 } 574 }
567 575
568 template<class ObjT, class Method, class A, class B, class C, class D, class E> 576 template<class ObjT, class Method, class A, class B, class C, class D, class E>
569 inline void DispatchToMethod(ObjT* obj, Method method, 577 inline void DispatchToMethod(ObjT* obj, Method method,
570 const Tuple5<A, B, C, D, E>& arg) { 578 const Tuple5<A, B, C, D, E>& arg) {
571 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e); 579 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
580 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
581 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
582 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
583 base::internal::UnwrapTraits<E>::Unwrap(arg.e));
572 } 584 }
573 585
574 template<class ObjT, class Method, class A, class B, class C, class D, class E, 586 template<class ObjT, class Method, class A, class B, class C, class D, class E,
575 class F> 587 class F>
576 inline void DispatchToMethod(ObjT* obj, Method method, 588 inline void DispatchToMethod(ObjT* obj, Method method,
577 const Tuple6<A, B, C, D, E, F>& arg) { 589 const Tuple6<A, B, C, D, E, F>& arg) {
578 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f); 590 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
591 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
592 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
593 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
594 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
595 base::internal::UnwrapTraits<F>::Unwrap(arg.f));
579 } 596 }
580 597
581 template<class ObjT, class Method, class A, class B, class C, class D, class E, 598 template<class ObjT, class Method, class A, class B, class C, class D, class E,
582 class F, class G> 599 class F, class G>
583 inline void DispatchToMethod(ObjT* obj, Method method, 600 inline void DispatchToMethod(ObjT* obj, Method method,
584 const Tuple7<A, B, C, D, E, F, G>& arg) { 601 const Tuple7<A, B, C, D, E, F, G>& arg) {
585 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f, arg.g); 602 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
603 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
604 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
605 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
606 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
607 base::internal::UnwrapTraits<F>::Unwrap(arg.f),
608 base::internal::UnwrapTraits<G>::Unwrap(arg.g));
586 } 609 }
587 610
588 template<class ObjT, class Method, class A, class B, class C, class D, class E, 611 template<class ObjT, class Method, class A, class B, class C, class D, class E,
589 class F, class G, class H> 612 class F, class G, class H>
590 inline void DispatchToMethod(ObjT* obj, Method method, 613 inline void DispatchToMethod(ObjT* obj, Method method,
591 const Tuple8<A, B, C, D, E, F, G, H>& arg) { 614 const Tuple8<A, B, C, D, E, F, G, H>& arg) {
592 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f, arg.g, arg.h); 615 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
616 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
617 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
618 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
619 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
620 base::internal::UnwrapTraits<F>::Unwrap(arg.f),
621 base::internal::UnwrapTraits<G>::Unwrap(arg.g),
622 base::internal::UnwrapTraits<H>::Unwrap(arg.h));
593 } 623 }
594 624
595 // Static Dispatchers with no out params. 625 // Static Dispatchers with no out params.
596 626
597 template <class Function> 627 template <class Function>
598 inline void DispatchToFunction(Function function, const Tuple0& arg) { 628 inline void DispatchToFunction(Function function, const Tuple0& arg) {
599 (*function)(); 629 (*function)();
600 } 630 }
601 631
602 template <class Function, class A> 632 template <class Function, class A>
603 inline void DispatchToFunction(Function function, const A& arg) { 633 inline void DispatchToFunction(Function function, const A& arg) {
604 (*function)(arg); 634 (*function)(arg);
605 } 635 }
606 636
607 template <class Function, class A> 637 template <class Function, class A>
608 inline void DispatchToFunction(Function function, const Tuple1<A>& arg) { 638 inline void DispatchToFunction(Function function, const Tuple1<A>& arg) {
609 (*function)(arg.a); 639 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a));
610 } 640 }
611 641
612 template<class Function, class A, class B> 642 template<class Function, class A, class B>
613 inline void DispatchToFunction(Function function, const Tuple2<A, B>& arg) { 643 inline void DispatchToFunction(Function function, const Tuple2<A, B>& arg) {
614 (*function)(arg.a, arg.b); 644 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
645 base::internal::UnwrapTraits<B>::Unwrap(arg.b));
615 } 646 }
616 647
617 template<class Function, class A, class B, class C> 648 template<class Function, class A, class B, class C>
618 inline void DispatchToFunction(Function function, const Tuple3<A, B, C>& arg) { 649 inline void DispatchToFunction(Function function, const Tuple3<A, B, C>& arg) {
619 (*function)(arg.a, arg.b, arg.c); 650 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
651 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
652 base::internal::UnwrapTraits<C>::Unwrap(arg.c));
620 } 653 }
621 654
622 template<class Function, class A, class B, class C, class D> 655 template<class Function, class A, class B, class C, class D>
623 inline void DispatchToFunction(Function function, 656 inline void DispatchToFunction(Function function,
624 const Tuple4<A, B, C, D>& arg) { 657 const Tuple4<A, B, C, D>& arg) {
625 (*function)(arg.a, arg.b, arg.c, arg.d); 658 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
659 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
660 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
661 base::internal::UnwrapTraits<D>::Unwrap(arg.d));
626 } 662 }
627 663
628 template<class Function, class A, class B, class C, class D, class E> 664 template<class Function, class A, class B, class C, class D, class E>
629 inline void DispatchToFunction(Function function, 665 inline void DispatchToFunction(Function function,
630 const Tuple5<A, B, C, D, E>& arg) { 666 const Tuple5<A, B, C, D, E>& arg) {
631 (*function)(arg.a, arg.b, arg.c, arg.d, arg.e); 667 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
668 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
669 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
670 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
671 base::internal::UnwrapTraits<E>::Unwrap(arg.e));
632 } 672 }
633 673
634 template<class Function, class A, class B, class C, class D, class E, class F> 674 template<class Function, class A, class B, class C, class D, class E, class F>
635 inline void DispatchToFunction(Function function, 675 inline void DispatchToFunction(Function function,
636 const Tuple6<A, B, C, D, E, F>& arg) { 676 const Tuple6<A, B, C, D, E, F>& arg) {
637 (*function)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f); 677 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
678 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
679 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
680 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
681 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
682 base::internal::UnwrapTraits<F>::Unwrap(arg.f));
638 } 683 }
639 684
640 template<class Function, class A, class B, class C, class D, class E, class F, 685 template<class Function, class A, class B, class C, class D, class E, class F,
641 class G> 686 class G>
642 inline void DispatchToFunction(Function function, 687 inline void DispatchToFunction(Function function,
643 const Tuple7<A, B, C, D, E, F, G>& arg) { 688 const Tuple7<A, B, C, D, E, F, G>& arg) {
644 (*function)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f, arg.g); 689 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
690 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
691 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
692 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
693 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
694 base::internal::UnwrapTraits<F>::Unwrap(arg.f),
695 base::internal::UnwrapTraits<G>::Unwrap(arg.g));
645 } 696 }
646 697
647 template<class Function, class A, class B, class C, class D, class E, class F, 698 template<class Function, class A, class B, class C, class D, class E, class F,
648 class G, class H> 699 class G, class H>
649 inline void DispatchToFunction(Function function, 700 inline void DispatchToFunction(Function function,
650 const Tuple8<A, B, C, D, E, F, G, H>& arg) { 701 const Tuple8<A, B, C, D, E, F, G, H>& arg) {
651 (*function)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f, arg.g, arg.h); 702 (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
703 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
704 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
705 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
706 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
707 base::internal::UnwrapTraits<F>::Unwrap(arg.f),
708 base::internal::UnwrapTraits<G>::Unwrap(arg.g),
709 base::internal::UnwrapTraits<H>::Unwrap(arg.h));
652 } 710 }
653 711
654 // Dispatchers with 0 out param (as a Tuple0). 712 // Dispatchers with 0 out param (as a Tuple0).
655 713
656 template <class ObjT, class Method> 714 template <class ObjT, class Method>
657 inline void DispatchToMethod(ObjT* obj, 715 inline void DispatchToMethod(ObjT* obj,
658 Method method, 716 Method method,
659 const Tuple0& arg, Tuple0*) { 717 const Tuple0& arg, Tuple0*) {
660 (obj->*method)(); 718 (obj->*method)();
661 } 719 }
662 720
663 template <class ObjT, class Method, class A> 721 template <class ObjT, class Method, class A>
664 inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) { 722 inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) {
665 (obj->*method)(arg); 723 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg));
666 } 724 }
667 725
668 template <class ObjT, class Method, class A> 726 template <class ObjT, class Method, class A>
669 inline void DispatchToMethod(ObjT* obj, 727 inline void DispatchToMethod(ObjT* obj,
670 Method method, 728 Method method,
671 const Tuple1<A>& arg, Tuple0*) { 729 const Tuple1<A>& arg, Tuple0*) {
672 (obj->*method)(arg.a); 730 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a));
673 } 731 }
674 732
675 template<class ObjT, class Method, class A, class B> 733 template<class ObjT, class Method, class A, class B>
676 inline void DispatchToMethod(ObjT* obj, 734 inline void DispatchToMethod(ObjT* obj,
677 Method method, 735 Method method,
678 const Tuple2<A, B>& arg, Tuple0*) { 736 const Tuple2<A, B>& arg, Tuple0*) {
679 (obj->*method)(arg.a, arg.b); 737 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
738 base::internal::UnwrapTraits<B>::Unwrap(arg.b));
680 } 739 }
681 740
682 template<class ObjT, class Method, class A, class B, class C> 741 template<class ObjT, class Method, class A, class B, class C>
683 inline void DispatchToMethod(ObjT* obj, Method method, 742 inline void DispatchToMethod(ObjT* obj, Method method,
684 const Tuple3<A, B, C>& arg, Tuple0*) { 743 const Tuple3<A, B, C>& arg, Tuple0*) {
685 (obj->*method)(arg.a, arg.b, arg.c); 744 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
745 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
746 base::internal::UnwrapTraits<C>::Unwrap(arg.c));
686 } 747 }
687 748
688 template<class ObjT, class Method, class A, class B, class C, class D> 749 template<class ObjT, class Method, class A, class B, class C, class D>
689 inline void DispatchToMethod(ObjT* obj, Method method, 750 inline void DispatchToMethod(ObjT* obj, Method method,
690 const Tuple4<A, B, C, D>& arg, Tuple0*) { 751 const Tuple4<A, B, C, D>& arg, Tuple0*) {
691 (obj->*method)(arg.a, arg.b, arg.c, arg.d); 752 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
753 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
754 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
755 base::internal::UnwrapTraits<D>::Unwrap(arg.d));
692 } 756 }
693 757
694 template<class ObjT, class Method, class A, class B, class C, class D, class E> 758 template<class ObjT, class Method, class A, class B, class C, class D, class E>
695 inline void DispatchToMethod(ObjT* obj, Method method, 759 inline void DispatchToMethod(ObjT* obj, Method method,
696 const Tuple5<A, B, C, D, E>& arg, Tuple0*) { 760 const Tuple5<A, B, C, D, E>& arg, Tuple0*) {
697 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e); 761 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
762 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
763 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
764 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
765 base::internal::UnwrapTraits<E>::Unwrap(arg.e));
698 } 766 }
699 767
700 template<class ObjT, class Method, class A, class B, class C, class D, class E, 768 template<class ObjT, class Method, class A, class B, class C, class D, class E,
701 class F> 769 class F>
702 inline void DispatchToMethod(ObjT* obj, Method method, 770 inline void DispatchToMethod(ObjT* obj, Method method,
703 const Tuple6<A, B, C, D, E, F>& arg, Tuple0*) { 771 const Tuple6<A, B, C, D, E, F>& arg, Tuple0*) {
704 (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f); 772 (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg.a),
773 base::internal::UnwrapTraits<B>::Unwrap(arg.b),
774 base::internal::UnwrapTraits<C>::Unwrap(arg.c),
775 base::internal::UnwrapTraits<D>::Unwrap(arg.d),
776 base::internal::UnwrapTraits<E>::Unwrap(arg.e),
777 base::internal::UnwrapTraits<F>::Unwrap(arg.f));
705 } 778 }
706 779
707 // Dispatchers with 1 out param. 780 // Dispatchers with 1 out param.
708 781
709 template<class ObjT, class Method, 782 template<class ObjT, class Method,
710 class OutA> 783 class OutA>
711 inline void DispatchToMethod(ObjT* obj, Method method, 784 inline void DispatchToMethod(ObjT* obj, Method method,
712 const Tuple0& in, 785 const Tuple0& in,
713 Tuple1<OutA>* out) { 786 Tuple1<OutA>* out) {
714 (obj->*method)(&out->a); 787 (obj->*method)(&out->a);
715 } 788 }
716 789
717 template<class ObjT, class Method, class InA, 790 template<class ObjT, class Method, class InA,
718 class OutA> 791 class OutA>
719 inline void DispatchToMethod(ObjT* obj, Method method, 792 inline void DispatchToMethod(ObjT* obj, Method method,
720 const InA& in, 793 const InA& in,
721 Tuple1<OutA>* out) { 794 Tuple1<OutA>* out) {
722 (obj->*method)(in, &out->a); 795 (obj->*method)(in, &out->a);
723 } 796 }
724 797
725 template<class ObjT, class Method, class InA, 798 template<class ObjT, class Method, class InA,
726 class OutA> 799 class OutA>
727 inline void DispatchToMethod(ObjT* obj, Method method, 800 inline void DispatchToMethod(ObjT* obj, Method method,
728 const Tuple1<InA>& in, 801 const Tuple1<InA>& in,
729 Tuple1<OutA>* out) { 802 Tuple1<OutA>* out) {
730 (obj->*method)(in.a, &out->a); 803 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a), &out->a);
731 } 804 }
732 805
733 template<class ObjT, class Method, class InA, class InB, 806 template<class ObjT, class Method, class InA, class InB,
734 class OutA> 807 class OutA>
735 inline void DispatchToMethod(ObjT* obj, Method method, 808 inline void DispatchToMethod(ObjT* obj, Method method,
736 const Tuple2<InA, InB>& in, 809 const Tuple2<InA, InB>& in,
737 Tuple1<OutA>* out) { 810 Tuple1<OutA>* out) {
738 (obj->*method)(in.a, in.b, &out->a); 811 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
812 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
813 &out->a);
739 } 814 }
740 815
741 template<class ObjT, class Method, class InA, class InB, class InC, 816 template<class ObjT, class Method, class InA, class InB, class InC,
742 class OutA> 817 class OutA>
743 inline void DispatchToMethod(ObjT* obj, Method method, 818 inline void DispatchToMethod(ObjT* obj, Method method,
744 const Tuple3<InA, InB, InC>& in, 819 const Tuple3<InA, InB, InC>& in,
745 Tuple1<OutA>* out) { 820 Tuple1<OutA>* out) {
746 (obj->*method)(in.a, in.b, in.c, &out->a); 821 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
822 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
823 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
824 &out->a);
747 } 825 }
748 826
749 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 827 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
750 class OutA> 828 class OutA>
751 inline void DispatchToMethod(ObjT* obj, Method method, 829 inline void DispatchToMethod(ObjT* obj, Method method,
752 const Tuple4<InA, InB, InC, InD>& in, 830 const Tuple4<InA, InB, InC, InD>& in,
753 Tuple1<OutA>* out) { 831 Tuple1<OutA>* out) {
754 (obj->*method)(in.a, in.b, in.c, in.d, &out->a); 832 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
833 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
834 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
835 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
836 &out->a);
755 } 837 }
756 838
757 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 839 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
758 class InE, class OutA> 840 class InE, class OutA>
759 inline void DispatchToMethod(ObjT* obj, Method method, 841 inline void DispatchToMethod(ObjT* obj, Method method,
760 const Tuple5<InA, InB, InC, InD, InE>& in, 842 const Tuple5<InA, InB, InC, InD, InE>& in,
761 Tuple1<OutA>* out) { 843 Tuple1<OutA>* out) {
762 (obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a); 844 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
845 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
846 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
847 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
848 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
849 &out->a);
763 } 850 }
764 851
765 template<class ObjT, class Method, 852 template<class ObjT, class Method,
766 class InA, class InB, class InC, class InD, class InE, class InF, 853 class InA, class InB, class InC, class InD, class InE, class InF,
767 class OutA> 854 class OutA>
768 inline void DispatchToMethod(ObjT* obj, Method method, 855 inline void DispatchToMethod(ObjT* obj, Method method,
769 const Tuple6<InA, InB, InC, InD, InE, InF>& in, 856 const Tuple6<InA, InB, InC, InD, InE, InF>& in,
770 Tuple1<OutA>* out) { 857 Tuple1<OutA>* out) {
771 (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a); 858 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
859 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
860 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
861 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
862 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
863 base::internal::UnwrapTraits<InF>::Unwrap(in.f),
864 &out->a);
772 } 865 }
773 866
774 // Dispatchers with 2 out params. 867 // Dispatchers with 2 out params.
775 868
776 template<class ObjT, class Method, 869 template<class ObjT, class Method,
777 class OutA, class OutB> 870 class OutA, class OutB>
778 inline void DispatchToMethod(ObjT* obj, Method method, 871 inline void DispatchToMethod(ObjT* obj, Method method,
779 const Tuple0& in, 872 const Tuple0& in,
780 Tuple2<OutA, OutB>* out) { 873 Tuple2<OutA, OutB>* out) {
781 (obj->*method)(&out->a, &out->b); 874 (obj->*method)(&out->a, &out->b);
782 } 875 }
783 876
784 template<class ObjT, class Method, class InA, 877 template<class ObjT, class Method, class InA,
785 class OutA, class OutB> 878 class OutA, class OutB>
786 inline void DispatchToMethod(ObjT* obj, Method method, 879 inline void DispatchToMethod(ObjT* obj, Method method,
787 const InA& in, 880 const InA& in,
788 Tuple2<OutA, OutB>* out) { 881 Tuple2<OutA, OutB>* out) {
789 (obj->*method)(in, &out->a, &out->b); 882 (obj->*method)(in, &out->a, &out->b);
790 } 883 }
791 884
792 template<class ObjT, class Method, class InA, 885 template<class ObjT, class Method, class InA,
793 class OutA, class OutB> 886 class OutA, class OutB>
794 inline void DispatchToMethod(ObjT* obj, Method method, 887 inline void DispatchToMethod(ObjT* obj, Method method,
795 const Tuple1<InA>& in, 888 const Tuple1<InA>& in,
796 Tuple2<OutA, OutB>* out) { 889 Tuple2<OutA, OutB>* out) {
797 (obj->*method)(in.a, &out->a, &out->b); 890 (obj->*method)(
891 base::internal::UnwrapTraits<InA>::Unwrap(in.a), &out->a, &out->b);
798 } 892 }
799 893
800 template<class ObjT, class Method, class InA, class InB, 894 template<class ObjT, class Method, class InA, class InB,
801 class OutA, class OutB> 895 class OutA, class OutB>
802 inline void DispatchToMethod(ObjT* obj, Method method, 896 inline void DispatchToMethod(ObjT* obj, Method method,
803 const Tuple2<InA, InB>& in, 897 const Tuple2<InA, InB>& in,
804 Tuple2<OutA, OutB>* out) { 898 Tuple2<OutA, OutB>* out) {
805 (obj->*method)(in.a, in.b, &out->a, &out->b); 899 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
900 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
901 &out->a,
902 &out->b);
806 } 903 }
807 904
808 template<class ObjT, class Method, class InA, class InB, class InC, 905 template<class ObjT, class Method, class InA, class InB, class InC,
809 class OutA, class OutB> 906 class OutA, class OutB>
810 inline void DispatchToMethod(ObjT* obj, Method method, 907 inline void DispatchToMethod(ObjT* obj, Method method,
811 const Tuple3<InA, InB, InC>& in, 908 const Tuple3<InA, InB, InC>& in,
812 Tuple2<OutA, OutB>* out) { 909 Tuple2<OutA, OutB>* out) {
813 (obj->*method)(in.a, in.b, in.c, &out->a, &out->b); 910 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
911 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
912 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
913 &out->a,
914 &out->b);
814 } 915 }
815 916
816 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 917 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
817 class OutA, class OutB> 918 class OutA, class OutB>
818 inline void DispatchToMethod(ObjT* obj, Method method, 919 inline void DispatchToMethod(ObjT* obj, Method method,
819 const Tuple4<InA, InB, InC, InD>& in, 920 const Tuple4<InA, InB, InC, InD>& in,
820 Tuple2<OutA, OutB>* out) { 921 Tuple2<OutA, OutB>* out) {
821 (obj->*method)(in.a, in.b, in.c, in.d, &out->a, &out->b); 922 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
923 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
924 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
925 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
926 &out->a,
927 &out->b);
822 } 928 }
823 929
824 template<class ObjT, class Method, 930 template<class ObjT, class Method,
825 class InA, class InB, class InC, class InD, class InE, 931 class InA, class InB, class InC, class InD, class InE,
826 class OutA, class OutB> 932 class OutA, class OutB>
827 inline void DispatchToMethod(ObjT* obj, Method method, 933 inline void DispatchToMethod(ObjT* obj, Method method,
828 const Tuple5<InA, InB, InC, InD, InE>& in, 934 const Tuple5<InA, InB, InC, InD, InE>& in,
829 Tuple2<OutA, OutB>* out) { 935 Tuple2<OutA, OutB>* out) {
830 (obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a, &out->b); 936 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
937 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
938 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
939 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
940 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
941 &out->a,
942 &out->b);
831 } 943 }
832 944
833 template<class ObjT, class Method, 945 template<class ObjT, class Method,
834 class InA, class InB, class InC, class InD, class InE, class InF, 946 class InA, class InB, class InC, class InD, class InE, class InF,
835 class OutA, class OutB> 947 class OutA, class OutB>
836 inline void DispatchToMethod(ObjT* obj, Method method, 948 inline void DispatchToMethod(ObjT* obj, Method method,
837 const Tuple6<InA, InB, InC, InD, InE, InF>& in, 949 const Tuple6<InA, InB, InC, InD, InE, InF>& in,
838 Tuple2<OutA, OutB>* out) { 950 Tuple2<OutA, OutB>* out) {
839 (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a, &out->b); 951 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
952 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
953 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
954 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
955 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
956 base::internal::UnwrapTraits<InF>::Unwrap(in.f),
957 &out->a,
958 &out->b);
840 } 959 }
841 960
842 // Dispatchers with 3 out params. 961 // Dispatchers with 3 out params.
843 962
844 template<class ObjT, class Method, 963 template<class ObjT, class Method,
845 class OutA, class OutB, class OutC> 964 class OutA, class OutB, class OutC>
846 inline void DispatchToMethod(ObjT* obj, Method method, 965 inline void DispatchToMethod(ObjT* obj, Method method,
847 const Tuple0& in, 966 const Tuple0& in,
848 Tuple3<OutA, OutB, OutC>* out) { 967 Tuple3<OutA, OutB, OutC>* out) {
849 (obj->*method)(&out->a, &out->b, &out->c); 968 (obj->*method)(&out->a, &out->b, &out->c);
850 } 969 }
851 970
852 template<class ObjT, class Method, class InA, 971 template<class ObjT, class Method, class InA,
853 class OutA, class OutB, class OutC> 972 class OutA, class OutB, class OutC>
854 inline void DispatchToMethod(ObjT* obj, Method method, 973 inline void DispatchToMethod(ObjT* obj, Method method,
855 const InA& in, 974 const InA& in,
856 Tuple3<OutA, OutB, OutC>* out) { 975 Tuple3<OutA, OutB, OutC>* out) {
857 (obj->*method)(in, &out->a, &out->b, &out->c); 976 (obj->*method)(in, &out->a, &out->b, &out->c);
858 } 977 }
859 978
860 template<class ObjT, class Method, class InA, 979 template<class ObjT, class Method, class InA,
861 class OutA, class OutB, class OutC> 980 class OutA, class OutB, class OutC>
862 inline void DispatchToMethod(ObjT* obj, Method method, 981 inline void DispatchToMethod(ObjT* obj, Method method,
863 const Tuple1<InA>& in, 982 const Tuple1<InA>& in,
864 Tuple3<OutA, OutB, OutC>* out) { 983 Tuple3<OutA, OutB, OutC>* out) {
865 (obj->*method)(in.a, &out->a, &out->b, &out->c); 984 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
985 &out->a,
986 &out->b,
987 &out->c);
866 } 988 }
867 989
868 template<class ObjT, class Method, class InA, class InB, 990 template<class ObjT, class Method, class InA, class InB,
869 class OutA, class OutB, class OutC> 991 class OutA, class OutB, class OutC>
870 inline void DispatchToMethod(ObjT* obj, Method method, 992 inline void DispatchToMethod(ObjT* obj, Method method,
871 const Tuple2<InA, InB>& in, 993 const Tuple2<InA, InB>& in,
872 Tuple3<OutA, OutB, OutC>* out) { 994 Tuple3<OutA, OutB, OutC>* out) {
873 (obj->*method)(in.a, in.b, &out->a, &out->b, &out->c); 995 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
996 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
997 &out->a,
998 &out->b,
999 &out->c);
874 } 1000 }
875 1001
876 template<class ObjT, class Method, class InA, class InB, class InC, 1002 template<class ObjT, class Method, class InA, class InB, class InC,
877 class OutA, class OutB, class OutC> 1003 class OutA, class OutB, class OutC>
878 inline void DispatchToMethod(ObjT* obj, Method method, 1004 inline void DispatchToMethod(ObjT* obj, Method method,
879 const Tuple3<InA, InB, InC>& in, 1005 const Tuple3<InA, InB, InC>& in,
880 Tuple3<OutA, OutB, OutC>* out) { 1006 Tuple3<OutA, OutB, OutC>* out) {
881 (obj->*method)(in.a, in.b, in.c, &out->a, &out->b, &out->c); 1007 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1008 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1009 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1010 &out->a,
1011 &out->b,
1012 &out->c);
882 } 1013 }
883 1014
884 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 1015 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
885 class OutA, class OutB, class OutC> 1016 class OutA, class OutB, class OutC>
886 inline void DispatchToMethod(ObjT* obj, Method method, 1017 inline void DispatchToMethod(ObjT* obj, Method method,
887 const Tuple4<InA, InB, InC, InD>& in, 1018 const Tuple4<InA, InB, InC, InD>& in,
888 Tuple3<OutA, OutB, OutC>* out) { 1019 Tuple3<OutA, OutB, OutC>* out) {
889 (obj->*method)(in.a, in.b, in.c, in.d, &out->a, &out->b, &out->c); 1020 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1021 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1022 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1023 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1024 &out->a,
1025 &out->b,
1026 &out->c);
890 } 1027 }
891 1028
892 template<class ObjT, class Method, 1029 template<class ObjT, class Method,
893 class InA, class InB, class InC, class InD, class InE, 1030 class InA, class InB, class InC, class InD, class InE,
894 class OutA, class OutB, class OutC> 1031 class OutA, class OutB, class OutC>
895 inline void DispatchToMethod(ObjT* obj, Method method, 1032 inline void DispatchToMethod(ObjT* obj, Method method,
896 const Tuple5<InA, InB, InC, InD, InE>& in, 1033 const Tuple5<InA, InB, InC, InD, InE>& in,
897 Tuple3<OutA, OutB, OutC>* out) { 1034 Tuple3<OutA, OutB, OutC>* out) {
898 (obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a, &out->b, &out->c); 1035 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1036 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1037 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1038 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1039 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1040 &out->a,
1041 &out->b,
1042 &out->c);
899 } 1043 }
900 1044
901 template<class ObjT, class Method, 1045 template<class ObjT, class Method,
902 class InA, class InB, class InC, class InD, class InE, class InF, 1046 class InA, class InB, class InC, class InD, class InE, class InF,
903 class OutA, class OutB, class OutC> 1047 class OutA, class OutB, class OutC>
904 inline void DispatchToMethod(ObjT* obj, Method method, 1048 inline void DispatchToMethod(ObjT* obj, Method method,
905 const Tuple6<InA, InB, InC, InD, InE, InF>& in, 1049 const Tuple6<InA, InB, InC, InD, InE, InF>& in,
906 Tuple3<OutA, OutB, OutC>* out) { 1050 Tuple3<OutA, OutB, OutC>* out) {
907 (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a, &out->b, &out->c); 1051 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1052 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1053 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1054 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1055 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1056 base::internal::UnwrapTraits<InF>::Unwrap(in.f),
1057 &out->a,
1058 &out->b,
1059 &out->c);
908 } 1060 }
909 1061
910 // Dispatchers with 4 out params. 1062 // Dispatchers with 4 out params.
911 1063
912 template<class ObjT, class Method, 1064 template<class ObjT, class Method,
913 class OutA, class OutB, class OutC, class OutD> 1065 class OutA, class OutB, class OutC, class OutD>
914 inline void DispatchToMethod(ObjT* obj, Method method, 1066 inline void DispatchToMethod(ObjT* obj, Method method,
915 const Tuple0& in, 1067 const Tuple0& in,
916 Tuple4<OutA, OutB, OutC, OutD>* out) { 1068 Tuple4<OutA, OutB, OutC, OutD>* out) {
917 (obj->*method)(&out->a, &out->b, &out->c, &out->d); 1069 (obj->*method)(&out->a, &out->b, &out->c, &out->d);
918 } 1070 }
919 1071
920 template<class ObjT, class Method, class InA, 1072 template<class ObjT, class Method, class InA,
921 class OutA, class OutB, class OutC, class OutD> 1073 class OutA, class OutB, class OutC, class OutD>
922 inline void DispatchToMethod(ObjT* obj, Method method, 1074 inline void DispatchToMethod(ObjT* obj, Method method,
923 const InA& in, 1075 const InA& in,
924 Tuple4<OutA, OutB, OutC, OutD>* out) { 1076 Tuple4<OutA, OutB, OutC, OutD>* out) {
925 (obj->*method)(in, &out->a, &out->b, &out->c, &out->d); 1077 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in),
1078 &out->a,
1079 &out->b,
1080 &out->c,
1081 &out->d);
926 } 1082 }
927 1083
928 template<class ObjT, class Method, class InA, 1084 template<class ObjT, class Method, class InA,
929 class OutA, class OutB, class OutC, class OutD> 1085 class OutA, class OutB, class OutC, class OutD>
930 inline void DispatchToMethod(ObjT* obj, Method method, 1086 inline void DispatchToMethod(ObjT* obj, Method method,
931 const Tuple1<InA>& in, 1087 const Tuple1<InA>& in,
932 Tuple4<OutA, OutB, OutC, OutD>* out) { 1088 Tuple4<OutA, OutB, OutC, OutD>* out) {
933 (obj->*method)(in.a, &out->a, &out->b, &out->c, &out->d); 1089 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1090 &out->a,
1091 &out->b,
1092 &out->c,
1093 &out->d);
934 } 1094 }
935 1095
936 template<class ObjT, class Method, class InA, class InB, 1096 template<class ObjT, class Method, class InA, class InB,
937 class OutA, class OutB, class OutC, class OutD> 1097 class OutA, class OutB, class OutC, class OutD>
938 inline void DispatchToMethod(ObjT* obj, Method method, 1098 inline void DispatchToMethod(ObjT* obj, Method method,
939 const Tuple2<InA, InB>& in, 1099 const Tuple2<InA, InB>& in,
940 Tuple4<OutA, OutB, OutC, OutD>* out) { 1100 Tuple4<OutA, OutB, OutC, OutD>* out) {
941 (obj->*method)(in.a, in.b, &out->a, &out->b, &out->c, &out->d); 1101 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1102 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1103 &out->a,
1104 &out->b,
1105 &out->c,
1106 &out->d);
942 } 1107 }
943 1108
944 template<class ObjT, class Method, class InA, class InB, class InC, 1109 template<class ObjT, class Method, class InA, class InB, class InC,
945 class OutA, class OutB, class OutC, class OutD> 1110 class OutA, class OutB, class OutC, class OutD>
946 inline void DispatchToMethod(ObjT* obj, Method method, 1111 inline void DispatchToMethod(ObjT* obj, Method method,
947 const Tuple3<InA, InB, InC>& in, 1112 const Tuple3<InA, InB, InC>& in,
948 Tuple4<OutA, OutB, OutC, OutD>* out) { 1113 Tuple4<OutA, OutB, OutC, OutD>* out) {
949 (obj->*method)(in.a, in.b, in.c, &out->a, &out->b, &out->c, &out->d); 1114 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1115 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1116 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1117 &out->a,
1118 &out->b,
1119 &out->c,
1120 &out->d);
950 } 1121 }
951 1122
952 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 1123 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
953 class OutA, class OutB, class OutC, class OutD> 1124 class OutA, class OutB, class OutC, class OutD>
954 inline void DispatchToMethod(ObjT* obj, Method method, 1125 inline void DispatchToMethod(ObjT* obj, Method method,
955 const Tuple4<InA, InB, InC, InD>& in, 1126 const Tuple4<InA, InB, InC, InD>& in,
956 Tuple4<OutA, OutB, OutC, OutD>* out) { 1127 Tuple4<OutA, OutB, OutC, OutD>* out) {
957 (obj->*method)(in.a, in.b, in.c, in.d, &out->a, &out->b, &out->c, &out->d); 1128 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1129 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1130 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1131 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1132 &out->a,
1133 &out->b,
1134 &out->c,
1135 &out->d);
958 } 1136 }
959 1137
960 template<class ObjT, class Method, 1138 template<class ObjT, class Method,
961 class InA, class InB, class InC, class InD, class InE, 1139 class InA, class InB, class InC, class InD, class InE,
962 class OutA, class OutB, class OutC, class OutD> 1140 class OutA, class OutB, class OutC, class OutD>
963 inline void DispatchToMethod(ObjT* obj, Method method, 1141 inline void DispatchToMethod(ObjT* obj, Method method,
964 const Tuple5<InA, InB, InC, InD, InE>& in, 1142 const Tuple5<InA, InB, InC, InD, InE>& in,
965 Tuple4<OutA, OutB, OutC, OutD>* out) { 1143 Tuple4<OutA, OutB, OutC, OutD>* out) {
966 (obj->*method)(in.a, in.b, in.c, in.d, in.e, 1144 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
967 &out->a, &out->b, &out->c, &out->d); 1145 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1146 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1147 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1148 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1149 &out->a,
1150 &out->b,
1151 &out->c,
1152 &out->d);
968 } 1153 }
969 1154
970 template<class ObjT, class Method, 1155 template<class ObjT, class Method,
971 class InA, class InB, class InC, class InD, class InE, class InF, 1156 class InA, class InB, class InC, class InD, class InE, class InF,
972 class OutA, class OutB, class OutC, class OutD> 1157 class OutA, class OutB, class OutC, class OutD>
973 inline void DispatchToMethod(ObjT* obj, Method method, 1158 inline void DispatchToMethod(ObjT* obj, Method method,
974 const Tuple6<InA, InB, InC, InD, InE, InF>& in, 1159 const Tuple6<InA, InB, InC, InD, InE, InF>& in,
975 Tuple4<OutA, OutB, OutC, OutD>* out) { 1160 Tuple4<OutA, OutB, OutC, OutD>* out) {
976 (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, 1161 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
977 &out->a, &out->b, &out->c, &out->d); 1162 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1163 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1164 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1165 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1166 base::internal::UnwrapTraits<InF>::Unwrap(in.f),
1167 &out->a,
1168 &out->b,
1169 &out->c,
1170 &out->d);
978 } 1171 }
979 1172
980 // Dispatchers with 5 out params. 1173 // Dispatchers with 5 out params.
981 1174
982 template<class ObjT, class Method, 1175 template<class ObjT, class Method,
983 class OutA, class OutB, class OutC, class OutD, class OutE> 1176 class OutA, class OutB, class OutC, class OutD, class OutE>
984 inline void DispatchToMethod(ObjT* obj, Method method, 1177 inline void DispatchToMethod(ObjT* obj, Method method,
985 const Tuple0& in, 1178 const Tuple0& in,
986 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1179 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
987 (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e); 1180 (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e);
988 } 1181 }
989 1182
990 template<class ObjT, class Method, class InA, 1183 template<class ObjT, class Method, class InA,
991 class OutA, class OutB, class OutC, class OutD, class OutE> 1184 class OutA, class OutB, class OutC, class OutD, class OutE>
992 inline void DispatchToMethod(ObjT* obj, Method method, 1185 inline void DispatchToMethod(ObjT* obj, Method method,
993 const InA& in, 1186 const InA& in,
994 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1187 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
995 (obj->*method)(in, &out->a, &out->b, &out->c, &out->d, &out->e); 1188 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in),
1189 &out->a,
1190 &out->b,
1191 &out->c,
1192 &out->d,
1193 &out->e);
996 } 1194 }
997 1195
998 template<class ObjT, class Method, class InA, 1196 template<class ObjT, class Method, class InA,
999 class OutA, class OutB, class OutC, class OutD, class OutE> 1197 class OutA, class OutB, class OutC, class OutD, class OutE>
1000 inline void DispatchToMethod(ObjT* obj, Method method, 1198 inline void DispatchToMethod(ObjT* obj, Method method,
1001 const Tuple1<InA>& in, 1199 const Tuple1<InA>& in,
1002 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1200 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1003 (obj->*method)(in.a, &out->a, &out->b, &out->c, &out->d, &out->e); 1201 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1202 &out->a,
1203 &out->b,
1204 &out->c,
1205 &out->d,
1206 &out->e);
1004 } 1207 }
1005 1208
1006 template<class ObjT, class Method, class InA, class InB, 1209 template<class ObjT, class Method, class InA, class InB,
1007 class OutA, class OutB, class OutC, class OutD, class OutE> 1210 class OutA, class OutB, class OutC, class OutD, class OutE>
1008 inline void DispatchToMethod(ObjT* obj, Method method, 1211 inline void DispatchToMethod(ObjT* obj, Method method,
1009 const Tuple2<InA, InB>& in, 1212 const Tuple2<InA, InB>& in,
1010 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1213 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1011 (obj->*method)(in.a, in.b, &out->a, &out->b, &out->c, &out->d, &out->e); 1214 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1215 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1216 &out->a,
1217 &out->b,
1218 &out->c,
1219 &out->d,
1220 &out->e);
1012 } 1221 }
1013 1222
1014 template<class ObjT, class Method, class InA, class InB, class InC, 1223 template<class ObjT, class Method, class InA, class InB, class InC,
1015 class OutA, class OutB, class OutC, class OutD, class OutE> 1224 class OutA, class OutB, class OutC, class OutD, class OutE>
1016 inline void DispatchToMethod(ObjT* obj, Method method, 1225 inline void DispatchToMethod(ObjT* obj, Method method,
1017 const Tuple3<InA, InB, InC>& in, 1226 const Tuple3<InA, InB, InC>& in,
1018 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1227 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1019 (obj->*method)(in.a, in.b, in.c, &out->a, &out->b, &out->c, &out->d, &out->e); 1228 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1229 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1230 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1231 &out->a,
1232 &out->b,
1233 &out->c,
1234 &out->d,
1235 &out->e);
1020 } 1236 }
1021 1237
1022 template<class ObjT, class Method, class InA, class InB, class InC, class InD, 1238 template<class ObjT, class Method, class InA, class InB, class InC, class InD,
1023 class OutA, class OutB, class OutC, class OutD, class OutE> 1239 class OutA, class OutB, class OutC, class OutD, class OutE>
1024 inline void DispatchToMethod(ObjT* obj, Method method, 1240 inline void DispatchToMethod(ObjT* obj, Method method,
1025 const Tuple4<InA, InB, InC, InD>& in, 1241 const Tuple4<InA, InB, InC, InD>& in,
1026 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1242 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1027 (obj->*method)(in.a, in.b, in.c, in.d, &out->a, &out->b, &out->c, &out->d, 1243 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1244 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1245 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1246 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1247 &out->a,
1248 &out->b,
1249 &out->c,
1250 &out->d,
1028 &out->e); 1251 &out->e);
1029 } 1252 }
1030 1253
1031 template<class ObjT, class Method, 1254 template<class ObjT, class Method,
1032 class InA, class InB, class InC, class InD, class InE, 1255 class InA, class InB, class InC, class InD, class InE,
1033 class OutA, class OutB, class OutC, class OutD, class OutE> 1256 class OutA, class OutB, class OutC, class OutD, class OutE>
1034 inline void DispatchToMethod(ObjT* obj, Method method, 1257 inline void DispatchToMethod(ObjT* obj, Method method,
1035 const Tuple5<InA, InB, InC, InD, InE>& in, 1258 const Tuple5<InA, InB, InC, InD, InE>& in,
1036 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1259 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1037 (obj->*method)(in.a, in.b, in.c, in.d, in.e, 1260 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1038 &out->a, &out->b, &out->c, &out->d, &out->e); 1261 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1262 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1263 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1264 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1265 &out->a,
1266 &out->b,
1267 &out->c,
1268 &out->d,
1269 &out->e);
1039 } 1270 }
1040 1271
1041 template<class ObjT, class Method, 1272 template<class ObjT, class Method,
1042 class InA, class InB, class InC, class InD, class InE, class InF, 1273 class InA, class InB, class InC, class InD, class InE, class InF,
1043 class OutA, class OutB, class OutC, class OutD, class OutE> 1274 class OutA, class OutB, class OutC, class OutD, class OutE>
1044 inline void DispatchToMethod(ObjT* obj, Method method, 1275 inline void DispatchToMethod(ObjT* obj, Method method,
1045 const Tuple6<InA, InB, InC, InD, InE, InF>& in, 1276 const Tuple6<InA, InB, InC, InD, InE, InF>& in,
1046 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) { 1277 Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
1047 (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, 1278 (obj->*method)(base::internal::UnwrapTraits<InA>::Unwrap(in.a),
1048 &out->a, &out->b, &out->c, &out->d, &out->e); 1279 base::internal::UnwrapTraits<InB>::Unwrap(in.b),
1280 base::internal::UnwrapTraits<InC>::Unwrap(in.c),
1281 base::internal::UnwrapTraits<InD>::Unwrap(in.d),
1282 base::internal::UnwrapTraits<InE>::Unwrap(in.e),
1283 base::internal::UnwrapTraits<InF>::Unwrap(in.f),
1284 &out->a,
1285 &out->b,
1286 &out->c,
1287 &out->d,
1288 &out->e);
1049 } 1289 }
1050 1290
1051 #endif // BASE_TUPLE_H__ 1291 #endif // BASE_TUPLE_H__
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698