Electroneum
testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >:
Collaboration diagram for testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >:

Public Types

typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView
 
typedef ContainerView::type::size_type SizeType
 

Public Member Functions

 Impl (const SizeMatcher &size_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 ()
 

Detailed Description

template<typename SizeMatcher>
template<typename Container>
class testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >

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

Member Typedef Documentation

◆ ContainerView

template<typename SizeMatcher >
template<typename Container >
typedef internal::StlContainerView< GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >::ContainerView

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

◆ SizeType

template<typename SizeMatcher >
template<typename Container >
typedef ContainerView::type::size_type testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >::SizeType

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

Constructor & Destructor Documentation

◆ Impl()

template<typename SizeMatcher >
template<typename Container >
testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >::Impl ( const SizeMatcher &  size_matcher)
inlineexplicit

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

2417  : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}

Member Function Documentation

◆ DescribeNegationTo()

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

Reimplemented from testing::MatcherDescriberInterface.

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

2423  {
2424  *os << "size ";
2425  size_matcher_.DescribeNegationTo(os);
2426  }
void DescribeNegationTo(::std::ostream *os) const
Here is the call graph for this function:

◆ DescribeTo()

template<typename SizeMatcher >
template<typename Container >
virtual void testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >::DescribeTo ( ::std::ostream *  os) const
inlinevirtual

Implements testing::MatcherDescriberInterface.

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

2419  {
2420  *os << "size ";
2421  size_matcher_.DescribeTo(os);
2422  }
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ MatchAndExplain()

template<typename SizeMatcher >
template<typename Container >
virtual bool testing::internal::SizeIsMatcher< SizeMatcher >::Impl< Container >::MatchAndExplain ( Container  container,
MatchResultListener listener 
) const
inlinevirtual

Implements testing::MatcherInterface< Container >.

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

2429  {
2430  SizeType size = container.size();
2431  StringMatchResultListener size_listener;
2432  const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
2433  *listener
2434  << "whose size " << size << (result ? " matches" : " doesn't match");
2435  PrintIfNotEmpty(size_listener.str(), listener->stream());
2436  return result;
2437  }
bool MatchAndExplain(T x, MatchResultListener *listener) const
ContainerView::type::size_type SizeType
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Here is the call graph for this function:

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