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

#include <gmock-matchers.h>

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

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
 
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
 
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
 
 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
 
 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 ()
 
virtual ~MatcherDescriberInterface ()
 
virtual ~MatcherDescriberInterface ()
 

Private Member Functions

 GTEST_DISALLOW_ASSIGN_ (Impl)
 
 GTEST_DISALLOW_ASSIGN_ (Impl)
 
 GTEST_DISALLOW_ASSIGN_ (Impl)
 

Private Attributes

const Matcher< InnerMatcherArgmono_tuple_matcher_
 
const RhsStlContainer rhs_
 

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

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) {}
const Matcher< InnerMatcherArg > mono_tuple_matcher_
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
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) {}
const Matcher< InnerMatcherArg > mono_tuple_matcher_
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
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) {}
const Matcher< InnerMatcherArg > mono_tuple_matcher_
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649

Member Function Documentation

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.

References testing::internal::UniversalPrint().

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 << " ";
2747  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void UniversalPrint(const T &value,::std::ostream *os)
void DescribeNegationTo(::std::ostream *os) const
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.

References testing::internal::UniversalPrint().

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 << " ";
2747  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void UniversalPrint(const T &value,::std::ostream *os)
void DescribeNegationTo(::std::ostream *os) const
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.

References testing::internal::UniversalPrint().

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 << " ";
2747  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void UniversalPrint(const T &value,::std::ostream *os)
void DescribeNegationTo(::std::ostream *os) const
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.

References testing::gtest_printers_test::Print().

2733  {
2734  *os << "contains " << rhs_.size()
2735  << " values, where each value and its corresponding value in ";
2737  *os << " ";
2739  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void DescribeTo(::std::ostream *os) const
static void Print(const T &value,::std::ostream *os)
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.

References testing::gtest_printers_test::Print().

2733  {
2734  *os << "contains " << rhs_.size()
2735  << " values, where each value and its corresponding value in ";
2737  *os << " ";
2739  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void DescribeTo(::std::ostream *os) const
static void Print(const T &value,::std::ostream *os)
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.

References testing::gtest_printers_test::Print().

2733  {
2734  *os << "contains " << rhs_.size()
2735  << " values, where each value and its corresponding value in ";
2737  *os << " ";
2739  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
void DescribeTo(::std::ostream *os) const
static void Print(const T &value,::std::ostream *os)
template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::GTEST_DISALLOW_ASSIGN_ ( Impl< LhsContainer >  )
private
template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::GTEST_DISALLOW_ASSIGN_ ( Impl< LhsContainer >  )
private
template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::GTEST_DISALLOW_ASSIGN_ ( Impl< LhsContainer >  )
private
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.

References i, testing::MatchResultListener::IsInterested(), testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), testing::MatchResultListener::stream(), and testing::internal::UniversalPrint().

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;
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  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
static const_reference ConstReference(const RawContainer &container)
bool MatchAndExplain(T x, MatchResultListener *listener) const
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void UniversalPrint(const T &value,::std::ostream *os)
LhsView::const_reference LhsStlContainerReference
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.

References GTEST_DISALLOW_ASSIGN_, GTEST_REMOVE_REFERENCE_AND_CONST_, i, testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), and testing::internal::UniversalPrint().

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;
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  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
static const_reference ConstReference(const RawContainer &container)
bool MatchAndExplain(T x, MatchResultListener *listener) const
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void UniversalPrint(const T &value,::std::ostream *os)
LhsView::const_reference LhsStlContainerReference
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.

References GTEST_DISALLOW_ASSIGN_, GTEST_REMOVE_REFERENCE_AND_CONST_, i, testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), and testing::internal::UniversalPrint().

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;
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  }
const Matcher< InnerMatcherArg > mono_tuple_matcher_
static const_reference ConstReference(const RawContainer &container)
bool MatchAndExplain(T x, MatchResultListener *listener) const
::testing::tuple< const LhsValue &, const RhsValue & > InnerMatcherArg
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void UniversalPrint(const T &value,::std::ostream *os)
LhsView::const_reference LhsStlContainerReference

Member Data Documentation

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
const Matcher< InnerMatcherArg > testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::mono_tuple_matcher_
private

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

template<typename TupleMatcher, typename RhsContainer>
template<typename LhsContainer >
const RhsStlContainer testing::internal::PointwiseMatcher< TupleMatcher, RhsContainer >::Impl< LhsContainer >::rhs_
private

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


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