Electroneum
testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >:
Collaboration diagram for testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >:

Public Types

typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView
 
typedef LhsView::type LhsStlContainer
 
typedef LhsView::const_reference LhsStlContainerReference
 
typedef LhsStlContainer::value_type LhsValue
 
typedef ::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
 

Public Member Functions

 Impl (const TupleMatcher &tuple_matcher, const RhsStlContainer &rhs)
 
virtual void DescribeTo (::std::ostream *os) const
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual bool MatchAndExplain (LhsContainer lhs, MatchResultListener *listener) const
 
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 

Detailed Description

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer>
class testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >

Definition at line 2715 of file gmock-matchers.h.

Member Typedef Documentation

◆ InnerMatcherArg

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
typedef ::testing::tuple<const LhsValue&, const RhsValue&> testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::InnerMatcherArg

Definition at line 2726 of file gmock-matchers.h.

◆ LhsStlContainer

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
typedef LhsView::type testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::LhsStlContainer

Definition at line 2719 of file gmock-matchers.h.

◆ LhsStlContainerReference

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
typedef LhsView::const_reference testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::LhsStlContainerReference

Definition at line 2720 of file gmock-matchers.h.

◆ LhsValue

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
typedef LhsStlContainer::value_type testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::LhsValue

Definition at line 2721 of file gmock-matchers.h.

◆ LhsView

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::LhsView

Definition at line 2718 of file gmock-matchers.h.

Constructor & Destructor Documentation

◆ Impl()

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::Impl ( const TupleMatcher &  tuple_matcher,
const RhsStlContainer rhs 
)
inline

Definition at line 2728 of file gmock-matchers.h.

2730  : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
2731  rhs_(rhs) {}

Member Function Documentation

◆ DescribeNegationTo()

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
virtual void testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::DescribeNegationTo ( ::std::ostream *  os) const
inlinevirtual

Reimplemented from testing::MatcherDescriberInterface.

Definition at line 2740 of file gmock-matchers.h.

2740  {
2741  *os << "doesn't contain exactly " << rhs_.size()
2742  << " values, or contains a value x at some index i"
2743  << " where x and the i-th value of ";
2744  UniversalPrint(rhs_, os);
2745  *os << " ";
2746  mono_tuple_matcher_.DescribeNegationTo(os);
2747  }
void DescribeNegationTo(::std::ostream *os) const
void UniversalPrint(const T &value, ::std::ostream *os)
Here is the call graph for this function:

◆ DescribeTo()

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
virtual void testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::DescribeTo ( ::std::ostream *  os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

Definition at line 2733 of file gmock-matchers.h.

2733  {
2734  *os << "contains " << rhs_.size()
2735  << " values, where each value and its corresponding value in ";
2737  *os << " ";
2738  mono_tuple_matcher_.DescribeTo(os);
2739  }
static void Print(const T &value, ::std::ostream *os)
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ MatchAndExplain()

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
virtual bool testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::MatchAndExplain ( LhsContainer  lhs,
MatchResultListener listener 
) const
inlinevirtual

Implements testing::MatcherInterface< LhsContainer >.

Definition at line 2749 of file gmock-matchers.h.

2750  {
2751  LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
2752  const size_t actual_size = lhs_stl_container.size();
2753  if (actual_size != rhs_.size()) {
2754  *listener << "which contains " << actual_size << " values";
2755  return false;
2756  }
2757 
2758  typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
2759  typename RhsStlContainer::const_iterator right = rhs_.begin();
2760  for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {
2761  const InnerMatcherArg value_pair(*left, *right);
2762 
2763  if (listener->IsInterested()) {
2764  StringMatchResultListener inner_listener;
2765  if (!mono_tuple_matcher_.MatchAndExplain(
2766  value_pair, &inner_listener)) {
2767  *listener << "where the value pair (";
2768  UniversalPrint(*left, listener->stream());
2769  *listener << ", ";
2770  UniversalPrint(*right, listener->stream());
2771  *listener << ") at index #" << i << " don't match";
2772  PrintIfNotEmpty(inner_listener.str(), listener->stream());
2773  return false;
2774  }
2775  } else {
2776  if (!mono_tuple_matcher_.Matches(value_pair))
2777  return false;
2778  }
2779  }
2780 
2781  return true;
2782  }
bool MatchAndExplain(T x, MatchResultListener *listener) const
LhsView::const_reference LhsStlContainerReference
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
static const_reference ConstReference(const RawContainer &container)
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
void UniversalPrint(const T &value, ::std::ostream *os)
Here is the call graph for this function:

The documentation for this class was generated from the following file: