Electroneum
testing::internal::QuantifierMatcherImpl< Container > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::QuantifierMatcherImpl< Container >:
Collaboration diagram for testing::internal::QuantifierMatcherImpl< Container >:

Public Types

typedef StlContainerView< RawContainer > View
 
typedef View::type StlContainer
 
typedef View::const_reference StlContainerReference
 
typedef StlContainer::value_type Element
 

Public Member Functions

typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (Container) RawContainer
 
template<typename InnerMatcher >
 QuantifierMatcherImpl (InnerMatcher inner_matcher)
 
bool MatchAndExplainImpl (bool all_elements_should_match, Container container, MatchResultListener *listener) const
 
- Public Member Functions inherited from testing::MatcherInterface< Container >
virtual bool MatchAndExplain (Container x, MatchResultListener *listener) const=0
 
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 
virtual void DescribeTo (::std::ostream *os) const =0
 
virtual void DescribeNegationTo (::std::ostream *os) const
 

Protected Member Functions

 GTEST_DISALLOW_ASSIGN_ (QuantifierMatcherImpl)
 

Protected Attributes

const Matcher< const Element & > inner_matcher_
 

Detailed Description

template<typename Container>
class testing::internal::QuantifierMatcherImpl< Container >

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

Member Typedef Documentation

◆ Element

template<typename Container >
typedef StlContainer::value_type testing::internal::QuantifierMatcherImpl< Container >::Element

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

◆ StlContainer

template<typename Container >
typedef View::type testing::internal::QuantifierMatcherImpl< Container >::StlContainer

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

◆ StlContainerReference

template<typename Container >
typedef View::const_reference testing::internal::QuantifierMatcherImpl< Container >::StlContainerReference

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

◆ View

template<typename Container >
typedef StlContainerView<RawContainer> testing::internal::QuantifierMatcherImpl< Container >::View

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

Constructor & Destructor Documentation

◆ QuantifierMatcherImpl()

template<typename Container >
template<typename InnerMatcher >
testing::internal::QuantifierMatcherImpl< Container >::QuantifierMatcherImpl ( InnerMatcher  inner_matcher)
inlineexplicit

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

2810  : inner_matcher_(
2811  testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
const Matcher< const Element & > inner_matcher_

Member Function Documentation

◆ GTEST_DISALLOW_ASSIGN_()

template<typename Container >
testing::internal::QuantifierMatcherImpl< Container >::GTEST_DISALLOW_ASSIGN_ ( QuantifierMatcherImpl< Container >  )
protected

◆ GTEST_REMOVE_REFERENCE_AND_CONST_()

template<typename Container >
typedef testing::internal::QuantifierMatcherImpl< Container >::GTEST_REMOVE_REFERENCE_AND_CONST_ ( Container  )

◆ MatchAndExplainImpl()

template<typename Container >
bool testing::internal::QuantifierMatcherImpl< Container >::MatchAndExplainImpl ( bool  all_elements_should_match,
Container  container,
MatchResultListener listener 
) const
inline

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

2818  {
2819  StlContainerReference stl_container = View::ConstReference(container);
2820  size_t i = 0;
2821  for (typename StlContainer::const_iterator it = stl_container.begin();
2822  it != stl_container.end(); ++it, ++i) {
2823  StringMatchResultListener inner_listener;
2824  const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
2825 
2826  if (matches != all_elements_should_match) {
2827  *listener << "whose element #" << i
2828  << (matches ? " matches" : " doesn't match");
2829  PrintIfNotEmpty(inner_listener.str(), listener->stream());
2830  return !all_elements_should_match;
2831  }
2832  }
2833  return all_elements_should_match;
2834  }
bool MatchAndExplain(T x, MatchResultListener *listener) const
const Matcher< const Element & > inner_matcher_
static const_reference ConstReference(const RawContainer &container)
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ inner_matcher_

template<typename Container >
const Matcher<const Element&> testing::internal::QuantifierMatcherImpl< Container >::inner_matcher_
protected

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


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