proxygen
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >:
testing::MatcherInterface< Container > testing::MatcherInterface< Container > testing::MatcherInterface< Container > 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_(Container)> ContainerView
 
typedef std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
 
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
 
typedef std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
 
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
 
typedef std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
 

Public Member Functions

 Impl (const DistanceMatcher &distance_matcher)
 
virtual void DescribeTo (::std::ostream *os) const
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual bool MatchAndExplain (Container container, MatchResultListener *listener) const
 
 Impl (const DistanceMatcher &distance_matcher)
 
virtual void DescribeTo (::std::ostream *os) const
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual bool MatchAndExplain (Container container, MatchResultListener *listener) const
 
 Impl (const DistanceMatcher &distance_matcher)
 
virtual void DescribeTo (::std::ostream *os) const
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual bool MatchAndExplain (Container container, 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< DistanceTypedistance_matcher_
 

Detailed Description

template<typename DistanceMatcher>
template<typename Container>
class testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >

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

Member Typedef Documentation

template<typename DistanceMatcher >
template<typename Container >
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::ContainerView

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

template<typename DistanceMatcher >
template<typename Container >
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::ContainerView

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

template<typename DistanceMatcher >
template<typename Container >
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::ContainerView

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

template<typename DistanceMatcher >
template<typename Container >
typedef std::iterator_traits< typename ContainerView::type::const_iterator>::difference_type testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DistanceType

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

template<typename DistanceMatcher >
template<typename Container >
typedef std::iterator_traits< typename ContainerView::type::const_iterator>::difference_type testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DistanceType

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

template<typename DistanceMatcher >
template<typename Container >
typedef std::iterator_traits< typename ContainerView::type::const_iterator>::difference_type testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DistanceType

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

Constructor & Destructor Documentation

template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::Impl ( const DistanceMatcher &  distance_matcher)
inlineexplicit

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

2471  : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::Impl ( const DistanceMatcher &  distance_matcher)
inlineexplicit

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

2471  : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::Impl ( const DistanceMatcher &  distance_matcher)
inlineexplicit

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

2471  : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}

Member Function Documentation

template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeNegationTo ( ::std::ostream *  os) const
inlinevirtual

Reimplemented from testing::MatcherDescriberInterface.

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

2477  {
2478  *os << "distance between begin() and end() ";
2480  }
void DescribeNegationTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeNegationTo ( ::std::ostream *  os) const
inlinevirtual

Reimplemented from testing::MatcherDescriberInterface.

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

2477  {
2478  *os << "distance between begin() and end() ";
2480  }
void DescribeNegationTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeNegationTo ( ::std::ostream *  os) const
inlinevirtual

Reimplemented from testing::MatcherDescriberInterface.

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

2477  {
2478  *os << "distance between begin() and end() ";
2480  }
void DescribeNegationTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeTo ( ::std::ostream *  os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

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

2473  {
2474  *os << "distance between begin() and end() ";
2476  }
void DescribeTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeTo ( ::std::ostream *  os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

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

2473  {
2474  *os << "distance between begin() and end() ";
2476  }
void DescribeTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
virtual void testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::DescribeTo ( ::std::ostream *  os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

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

2473  {
2474  *os << "distance between begin() and end() ";
2476  }
void DescribeTo(::std::ostream *os) const
template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::GTEST_DISALLOW_ASSIGN_ ( Impl< Container >  )
private
template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::GTEST_DISALLOW_ASSIGN_ ( Impl< Container >  )
private
template<typename DistanceMatcher >
template<typename Container >
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::GTEST_DISALLOW_ASSIGN_ ( Impl< Container >  )
private
template<typename DistanceMatcher >
template<typename Container >
virtual bool testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::MatchAndExplain ( Container  container,
MatchResultListener listener 
) const
inlinevirtual

Implements testing::MatcherInterface< Container >.

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

References folly::test::begin(), folly::test::end(), testing::internal::PrintIfNotEmpty(), and testing::MatchResultListener::stream().

2483  {
2484 #if GTEST_HAS_STD_BEGIN_AND_END_
2485  using std::begin;
2486  using std::end;
2487  DistanceType distance = std::distance(begin(container), end(container));
2488 #else
2489  DistanceType distance = std::distance(container.begin(), container.end());
2490 #endif
2491  StringMatchResultListener distance_listener;
2492  const bool result =
2493  distance_matcher_.MatchAndExplain(distance, &distance_listener);
2494  *listener << "whose distance between begin() and end() " << distance
2495  << (result ? " matches" : " doesn't match");
2496  PrintIfNotEmpty(distance_listener.str(), listener->stream());
2497  return result;
2498  }
std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
bool MatchAndExplain(T x, MatchResultListener *listener) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
template<typename DistanceMatcher >
template<typename Container >
virtual bool testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::MatchAndExplain ( Container  container,
MatchResultListener listener 
) const
inlinevirtual

Implements testing::MatcherInterface< Container >.

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

References folly::test::begin(), folly::test::end(), GTEST_DISALLOW_ASSIGN_, and testing::internal::PrintIfNotEmpty().

2483  {
2484 #if GTEST_HAS_STD_BEGIN_AND_END_
2485  using std::begin;
2486  using std::end;
2487  DistanceType distance = std::distance(begin(container), end(container));
2488 #else
2489  DistanceType distance = std::distance(container.begin(), container.end());
2490 #endif
2491  StringMatchResultListener distance_listener;
2492  const bool result =
2493  distance_matcher_.MatchAndExplain(distance, &distance_listener);
2494  *listener << "whose distance between begin() and end() " << distance
2495  << (result ? " matches" : " doesn't match");
2496  PrintIfNotEmpty(distance_listener.str(), listener->stream());
2497  return result;
2498  }
std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
bool MatchAndExplain(T x, MatchResultListener *listener) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
template<typename DistanceMatcher >
template<typename Container >
virtual bool testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::MatchAndExplain ( Container  container,
MatchResultListener listener 
) const
inlinevirtual

Implements testing::MatcherInterface< Container >.

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

References folly::test::begin(), folly::test::end(), GTEST_DISALLOW_ASSIGN_, and testing::internal::PrintIfNotEmpty().

2483  {
2484 #if GTEST_HAS_STD_BEGIN_AND_END_
2485  using std::begin;
2486  using std::end;
2487  DistanceType distance = std::distance(begin(container), end(container));
2488 #else
2489  DistanceType distance = std::distance(container.begin(), container.end());
2490 #endif
2491  StringMatchResultListener distance_listener;
2492  const bool result =
2493  distance_matcher_.MatchAndExplain(distance, &distance_listener);
2494  *listener << "whose distance between begin() and end() " << distance
2495  << (result ? " matches" : " doesn't match");
2496  PrintIfNotEmpty(distance_listener.str(), listener->stream());
2497  return result;
2498  }
std::iterator_traits< typename ContainerView::type::const_iterator >::difference_type DistanceType
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
bool MatchAndExplain(T x, MatchResultListener *listener) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62

Member Data Documentation

template<typename DistanceMatcher >
template<typename Container >
const Matcher< DistanceType > testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >::distance_matcher_
private

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


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