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

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::PairMatcherImpl< PairType >:
Collaboration diagram for testing::internal::PairMatcherImpl< PairType >:

Public Types

typedef RawPairType::first_type FirstType
 
typedef RawPairType::second_type SecondType
 

Public Member Functions

typedef GTEST_REMOVE_REFERENCE_AND_CONST_ (PairType) RawPairType
 
template<typename FirstMatcher , typename SecondMatcher >
 PairMatcherImpl (FirstMatcher first_matcher, SecondMatcher second_matcher)
 
virtual void DescribeTo (::std::ostream *os) const
 
virtual void DescribeNegationTo (::std::ostream *os) const
 
virtual bool MatchAndExplain (PairType a_pair, MatchResultListener *listener) const
 
- Public Member Functions inherited from testing::MatcherInterface< PairType >
- Public Member Functions inherited from testing::MatcherDescriberInterface
virtual ~MatcherDescriberInterface ()
 

Detailed Description

template<typename PairType>
class testing::internal::PairMatcherImpl< PairType >

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

Member Typedef Documentation

◆ FirstType

template<typename PairType >
RawPairType::first_type testing::internal::PairMatcherImpl< PairType >::FirstType

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

◆ SecondType

template<typename PairType >
RawPairType::second_type testing::internal::PairMatcherImpl< PairType >::SecondType

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

Constructor & Destructor Documentation

◆ PairMatcherImpl()

template<typename PairType >
template<typename FirstMatcher , typename SecondMatcher >
testing::internal::PairMatcherImpl< PairType >::PairMatcherImpl ( FirstMatcher first_matcher,
SecondMatcher second_matcher )
inline

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

3361 : first_matcher_(
3363 second_matcher_(
3365 }
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)

Member Function Documentation

◆ DescribeNegationTo()

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

Reimplemented from testing::MatcherDescriberInterface.

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

3376 {
3377 *os << "has a first field that ";
3378 first_matcher_.DescribeNegationTo(os);
3379 *os << ", or has a second field that ";
3380 second_matcher_.DescribeNegationTo(os);
3381 }
void DescribeNegationTo(::std::ostream *os) const
os_t os
Here is the call graph for this function:

◆ DescribeTo()

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

Implements testing::MatcherDescriberInterface.

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

3368 {
3369 *os << "has a first field that ";
3370 first_matcher_.DescribeTo(os);
3371 *os << ", and has a second field that ";
3372 second_matcher_.DescribeTo(os);
3373 }
void DescribeTo(::std::ostream *os) const
Here is the call graph for this function:

◆ GTEST_REMOVE_REFERENCE_AND_CONST_()

template<typename PairType >
typedef testing::internal::PairMatcherImpl< PairType >::GTEST_REMOVE_REFERENCE_AND_CONST_ ( PairType )

◆ MatchAndExplain()

template<typename PairType >
virtual bool testing::internal::PairMatcherImpl< PairType >::MatchAndExplain ( PairType a_pair,
MatchResultListener * listener ) const
inlinevirtual

Implements testing::MatcherInterface< PairType >.

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

3386 {
3387 if (!listener->IsInterested()) {
3388 // If the listener is not interested, we don't need to construct the
3389 // explanation.
3390 return first_matcher_.Matches(pair_getters::First(a_pair, Rank0())) &&
3391 second_matcher_.Matches(pair_getters::Second(a_pair, Rank0()));
3392 }
3393 StringMatchResultListener first_inner_listener;
3394 if (!first_matcher_.MatchAndExplain(pair_getters::First(a_pair, Rank0()),
3395 &first_inner_listener)) {
3396 *listener << "whose first field does not match";
3397 PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
3398 return false;
3399 }
3400 StringMatchResultListener second_inner_listener;
3401 if (!second_matcher_.MatchAndExplain(pair_getters::Second(a_pair, Rank0()),
3402 &second_inner_listener)) {
3403 *listener << "whose second field does not match";
3404 PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
3405 return false;
3406 }
3407 ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),
3408 listener);
3409 return true;
3410 }
bool MatchAndExplain(GTEST_REFERENCE_TO_CONST_(T) x, MatchResultListener *listener) const
bool Matches(GTEST_REFERENCE_TO_CONST_(T) x) const
T::second_type & Second(T &x, Rank0)
T::first_type & First(T &x, Rank0)
void PrintIfNotEmpty(const std::string &explanation, ::std::ostream *os)
Here is the call graph for this function:

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