Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >:
Collaboration diagram for testing::internal::BeginEndDistanceIsMatcher< DistanceMatcher >::Impl< Container >:

Public Types

typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
 
typedef std::iterator_traits< typenameContainerView::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
 
- Public Member Functions inherited from testing::MatcherInterface< Container >
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 

Detailed Description

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

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

Member Typedef Documentation

◆ ContainerView

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

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

◆ DistanceType

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

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

Constructor & Destructor Documentation

◆ Impl()

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

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

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

Member Function Documentation

◆ DescribeNegationTo()

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 2772 of file gmock-matchers.h.

2772 {
2773 *os << "distance between begin() and end() ";
2774 distance_matcher_.DescribeNegationTo(os);
2775 }
void DescribeNegationTo(::std::ostream *os) const
os_t os
Here is the call graph for this function:

◆ DescribeTo()

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 2768 of file gmock-matchers.h.

2768 {
2769 *os << "distance between begin() and end() ";
2770 distance_matcher_.DescribeTo(os);
2771 }
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ MatchAndExplain()

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 2777 of file gmock-matchers.h.

2778 {
2779#if GTEST_HAS_STD_BEGIN_AND_END_
2780 using std::begin;
2781 using std::end;
2782 DistanceType distance = std::distance(begin(container), end(container));
2783#else
2784 DistanceType distance = std::distance(container.begin(), container.end());
2785#endif
2786 StringMatchResultListener distance_listener;
2787 const bool result =
2788 distance_matcher_.MatchAndExplain(distance, &distance_listener);
2789 *listener << "whose distance between begin() and end() " << distance
2790 << (result ? " matches" : " doesn't match");
2791 PrintIfNotEmpty(distance_listener.str(), listener->stream());
2792 return result;
2793 }
std::iterator_traits< typenameContainerView::type::const_iterator >::difference_type DistanceType
bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, MatchResultListener *listener) const
void PrintIfNotEmpty(const std::string &explanation, ::std::ostream *os)
std::iterator_traits< octet_iterator >::difference_type distance(octet_iterator first, octet_iterator last)
Definition checked.h:198
Here is the call graph for this function:

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