Lines Matching refs:Tuple
242 // tr1/tuple. gmock-port.h does this via gtest-port.h, which is
243 // guaranteed to pull in the tuple header.
292 // MatcherTuple<T>::type is a tuple type where each field is a Matcher
293 // for the corresponding field in tuple type T.
294 template <typename Tuple>
298 struct MatcherTuple< ::std::tr1::tuple<> > {
299 typedef ::std::tr1::tuple< > type;
303 struct MatcherTuple< ::std::tr1::tuple<A1> > {
304 typedef ::std::tr1::tuple<Matcher<A1> > type;
308 struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {
309 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2> > type;
313 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {
314 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
318 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {
319 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
324 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
325 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
331 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
332 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
338 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
339 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
345 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
346 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
352 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
353 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
359 struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
361 typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
371 // ArgumentTuple: the tuple type consisting of all parameters of F.
372 // ArgumentMatcherTuple: the tuple type consisting of Matchers for all
385 typedef ::std::tr1::tuple<> ArgumentTuple;
395 typedef ::std::tr1::tuple<A1> ArgumentTuple;
405 typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;
415 typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;
425 typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;
436 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
447 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
458 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
469 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
480 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
493 typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
910 // represented as a (pointer, size) tuple.
912 class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
920 const ::std::tr1::tuple<ElementPointer, Size>& array) {
924 static type Copy(const ::std::tr1::tuple<ElementPointer, Size>& array) {
1251 // // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
2177 // InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
2184 class InvokeHelper<R, ::std::tr1::tuple<> > {
2187 static R Invoke(Function function, const ::std::tr1::tuple<>&) {
2194 const ::std::tr1::tuple<>&) {
2200 class InvokeHelper<R, ::std::tr1::tuple<A1> > {
2203 static R Invoke(Function function, const ::std::tr1::tuple<A1>& args) {
2211 const ::std::tr1::tuple<A1>& args) {
2218 class InvokeHelper<R, ::std::tr1::tuple<A1, A2> > {
2221 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2>& args) {
2229 const ::std::tr1::tuple<A1, A2>& args) {
2236 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3> > {
2239 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2,
2248 const ::std::tr1::tuple<A1, A2, A3>& args) {
2255 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4> > {
2258 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3,
2267 const ::std::tr1::tuple<A1, A2, A3, A4>& args) {
2276 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
2279 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2289 const ::std::tr1::tuple<A1, A2, A3, A4, A5>& args) {
2298 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
2301 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2311 const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6>& args) {
2320 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
2323 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2333 const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6,
2343 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
2346 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2356 const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7,
2366 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
2369 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2379 const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
2391 class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
2395 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2406 const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
2516 // An INTERNAL macro for extracting the type of a tuple field. It's
2518 #define GMOCK_FIELD_(Tuple, N) \
2519 typename ::std::tr1::tuple_element<N, Tuple>::type
2523 // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
2525 // SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type
2529 // returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
2531 // SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(
2533 // returns ::std::tr1::tuple (2.5, true).
2771 static Result Perform(Impl* impl, const ::std::tr1::tuple<>& args) {
2780 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0>& args) {
2789 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1>& args) {
2798 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2>& args) {
2807 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2,
2817 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3,
2828 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
2839 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
2850 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
2861 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
2872 static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
3072 // You can also refer to the entire argument tuple and its type by
5354 // An internal helper class for doing compile-time loop on a tuple's
5457 // TransformTupleValues uses to implement a tuple traversal.
5458 template <typename Tuple, typename Func, typename OutIter>
5461 typedef typename ::std::tr1::tuple_size<Tuple> TupleSize;
5464 // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
5466 static OutIter Run(Func f, const Tuple& t, OutIter out) {
5467 return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
5486 // Successively invokes 'f(element)' on each element of the tuple 't',
5489 template <typename Tuple, typename Func, typename OutIter>
5490 OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
5491 return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out);
5966 // Implements a matcher that compares the two fields of a 2-tuple
5971 // used to match a tuple<int, short>, a tuple<const long&, double>,
5981 operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \
5982 return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \
5985 operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \
5986 return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \
5989 template <typename Tuple> \
5990 class Impl : public MatcherInterface<Tuple> { \
5993 Tuple args, \
7104 // must be able to be safely cast to Matcher<tuple<const T1&, const
7138 // reference, as they may be expensive to copy. We must use tuple
7141 typedef ::std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
7144 // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
8406 // Creates a polymorphic matcher that matches a 2-tuple where the
8410 // Creates a polymorphic matcher that matches a 2-tuple where the
8414 // Creates a polymorphic matcher that matches a 2-tuple where the
8418 // Creates a polymorphic matcher that matches a 2-tuple where the
8422 // Creates a polymorphic matcher that matches a 2-tuple where the
8426 // Creates a polymorphic matcher that matches a 2-tuple where the
8496 // TupleMatcher must be able to be safely cast to Matcher<tuple<const
11747 // The type of the i-th (0-based) field of Tuple.
11748 #define GMOCK_FIELD_TYPE_(Tuple, i) \
11749 typename ::std::tr1::tuple_element<i, Tuple>::type
11751 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
11752 // tuple of type Tuple. It has two members:
11754 // type: a tuple type whose i-th field is the ki-th field of Tuple.
11755 // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
11757 // For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
11759 // type is tuple<int, bool>, and
11762 template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
11768 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
11772 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11773 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11774 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
11775 GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
11776 GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
11777 GMOCK_FIELD_TYPE_(Tuple, k9)> type;
11778 static type GetSelectedFields(const Tuple& t) {
11787 template <class Tuple>
11788 class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
11790 typedef ::std::tr1::tuple<> type;
11791 static type GetSelectedFields(const Tuple& /* t */) {
11797 template <class Tuple, int k0>
11798 class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
11800 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
11801 static type GetSelectedFields(const Tuple& t) {
11807 template <class Tuple, int k0, int k1>
11808 class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
11810 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11811 GMOCK_FIELD_TYPE_(Tuple, k1)> type;
11812 static type GetSelectedFields(const Tuple& t) {
11818 template <class Tuple, int k0, int k1, int k2>
11819 class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
11821 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11822 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
11823 static type GetSelectedFields(const Tuple& t) {
11829 template <class Tuple, int k0, int k1, int k2, int k3>
11830 class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
11832 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11833 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11834 GMOCK_FIELD_TYPE_(Tuple, k3)> type;
11835 static type GetSelectedFields(const Tuple& t) {
11841 template <class Tuple, int k0, int k1, int k2, int k3, int k4>
11842 class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
11844 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11845 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11846 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
11847 static type GetSelectedFields(const Tuple& t) {
11853 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
11854 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
11856 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11857 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11858 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
11859 GMOCK_FIELD_TYPE_(Tuple, k5)> type;
11860 static type GetSelectedFields(const Tuple& t) {
11867 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
11868 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
11870 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11871 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11872 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
11873 GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
11874 static type GetSelectedFields(const Tuple& t) {
11881 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
11883 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
11885 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11886 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11887 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
11888 GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
11889 GMOCK_FIELD_TYPE_(Tuple, k7)> type;
11890 static type GetSelectedFields(const Tuple& t) {
11897 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
11899 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
11901 typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
11902 GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
11903 GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
11904 GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
11905 GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
11906 static type GetSelectedFields(const Tuple& t) {
11948 *os << "are a tuple ";
11954 *os << "are a tuple ";
12184 // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
12277 std::tr1::tuple<> >
12279 typedef std::tr1::tuple<> Args;
12285 std::tr1::tuple<
12288 typedef std::tr1::tuple<
12295 std::tr1::tuple<
12299 typedef std::tr1::tuple<
12307 std::tr1::tuple<
12312 typedef std::tr1::tuple<
12321 std::tr1::tuple<
12327 typedef std::tr1::tuple<
12337 std::tr1::tuple<
12345 typedef std::tr1::tuple<
12357 std::tr1::tuple<
12366 typedef std::tr1::tuple<
12379 std::tr1::tuple<
12389 typedef std::tr1::tuple<
12403 std::tr1::tuple<
12414 typedef std::tr1::tuple<
12430 std::tr1::tuple<
12442 typedef std::tr1::tuple<
12459 std::tr1::tuple<
12473 typedef std::tr1::tuple<
12492 std::tr1::tuple<> >
12494 typedef std::tr1::tuple<> Args;
12500 std::tr1::tuple<
12503 typedef std::tr1::tuple<
12510 std::tr1::tuple<
12514 typedef std::tr1::tuple<
12522 std::tr1::tuple<
12527 typedef std::tr1::tuple<
12536 std::tr1::tuple<
12542 typedef std::tr1::tuple<
12552 std::tr1::tuple<
12560 typedef std::tr1::tuple<
12572 std::tr1::tuple<
12581 typedef std::tr1::tuple<
12595 std::tr1::tuple<
12605 typedef std::tr1::tuple<
12620 std::tr1::tuple<
12631 typedef std::tr1::tuple<
12647 std::tr1::tuple<
12659 typedef std::tr1::tuple<
12676 std::tr1::tuple<
12690 typedef std::tr1::tuple<
12995 // parameter values printed as a tuple. For example,
13113 ::std::tr1::tuple<>()));\
13162 ::std::tr1::tuple<p0##_type>(p0)));\
13215 ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\
13273 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
13336 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \
13407 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
13481 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
13559 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
13644 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
13735 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
13831 ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \