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

#include <gmock-matchers.h>

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

Public Types

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

Public Member Functions

typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (Container) RawContainer
 
template<typename InputIter >
 UnorderedElementsAreMatcherImpl (UnorderedMatcherRequire::Flags matcher_flags, InputIter first, InputIter last)
 
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 ()
 

Additional Inherited Members

- Protected Types inherited from testing::internal::UnorderedElementsAreMatcherImplBase
typedef ::std::vector< const MatcherDescriberInterface * > MatcherDescriberVec
 
- Protected Member Functions inherited from testing::internal::UnorderedElementsAreMatcherImplBase
 UnorderedElementsAreMatcherImplBase (UnorderedMatcherRequire::Flags matcher_flags)
 
void DescribeToImpl (::std::ostream *os) const
 
void DescribeNegationToImpl (::std::ostream *os) const
 
bool VerifyMatchMatrix (const ::std::vector< std::string > &element_printouts, const MatchMatrix &matrix, MatchResultListener *listener) const
 
bool FindPairing (const MatchMatrix &matrix, MatchResultListener *listener) const
 
MatcherDescriberVecmatcher_describers ()
 
UnorderedMatcherRequire::Flags match_flags () const
 
- Static Protected Member Functions inherited from testing::internal::UnorderedElementsAreMatcherImplBase
static Message Elements (size_t n)
 

Detailed Description

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

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

Member Typedef Documentation

◆ Element

template<typename Container >
StlContainer::value_type testing::internal::UnorderedElementsAreMatcherImpl< Container >::Element

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

◆ StlContainer

template<typename Container >
View::type testing::internal::UnorderedElementsAreMatcherImpl< Container >::StlContainer

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

◆ StlContainerConstIterator

template<typename Container >
StlContainer::const_iterator testing::internal::UnorderedElementsAreMatcherImpl< Container >::StlContainerConstIterator

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

◆ StlContainerReference

template<typename Container >
View::const_reference testing::internal::UnorderedElementsAreMatcherImpl< Container >::StlContainerReference

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

◆ View

template<typename Container >
internal::StlContainerView<RawContainer> testing::internal::UnorderedElementsAreMatcherImpl< Container >::View

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

Constructor & Destructor Documentation

◆ UnorderedElementsAreMatcherImpl()

template<typename Container >
template<typename InputIter >
testing::internal::UnorderedElementsAreMatcherImpl< Container >::UnorderedElementsAreMatcherImpl ( UnorderedMatcherRequire::Flags matcher_flags,
InputIter first,
InputIter last )
inline

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

3726 : UnorderedElementsAreMatcherImplBase(matcher_flags) {
3727 for (; first != last; ++first) {
3728 matchers_.push_back(MatcherCast<const Element&>(*first));
3729 matcher_describers().push_back(matchers_.back().GetDescriber());
3730 }
3731 }
UnorderedElementsAreMatcherImplBase(UnorderedMatcherRequire::Flags matcher_flags)
Here is the call graph for this function:

Member Function Documentation

◆ DescribeNegationTo()

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

Reimplemented from testing::MatcherDescriberInterface.

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

Here is the call graph for this function:

◆ DescribeTo()

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

Implements testing::MatcherDescriberInterface.

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

Here is the call graph for this function:

◆ GTEST_REMOVE_REFERENCE_AND_CONST_()

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

◆ MatchAndExplain()

template<typename Container >
virtual bool testing::internal::UnorderedElementsAreMatcherImpl< Container >::MatchAndExplain ( Container container,
MatchResultListener * listener ) const
inlinevirtual

Implements testing::MatcherInterface< Container >.

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

3744 {
3745 StlContainerReference stl_container = View::ConstReference(container);
3746 ::std::vector<std::string> element_printouts;
3747 MatchMatrix matrix =
3748 AnalyzeElements(stl_container.begin(), stl_container.end(),
3749 &element_printouts, listener);
3750
3751 if (matrix.LhsSize() == 0 && matrix.RhsSize() == 0) {
3752 return true;
3753 }
3754
3756 if (matrix.LhsSize() != matrix.RhsSize()) {
3757 // The element count doesn't match. If the container is empty,
3758 // there's no need to explain anything as Google Mock already
3759 // prints the empty container. Otherwise we just need to show
3760 // how many elements there actually are.
3761 if (matrix.LhsSize() != 0 && listener->IsInterested()) {
3762 *listener << "which has " << Elements(matrix.LhsSize());
3763 }
3764 return false;
3765 }
3766 }
3767
3768 return VerifyMatchMatrix(element_printouts, matrix, listener) &&
3769 FindPairing(matrix, listener);
3770 }
static const_reference ConstReference(const RawContainer &container)
bool FindPairing(const MatchMatrix &matrix, MatchResultListener *listener) const
bool VerifyMatchMatrix(const ::std::vector< std::string > &element_printouts, const MatchMatrix &matrix, MatchResultListener *listener) const
UnorderedMatcherRequire::Flags match_flags() const
Here is the call graph for this function:

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