Electroneum
testing::internal::WhenDynamicCastToMatcher< To & > Class Template Reference

#include <gmock-matchers.h>

Inheritance diagram for testing::internal::WhenDynamicCastToMatcher< To & >:
Collaboration diagram for testing::internal::WhenDynamicCastToMatcher< To & >:

Public Member Functions

 WhenDynamicCastToMatcher (const Matcher< To &> &matcher)
 
template<typename From >
bool MatchAndExplain (From &from, MatchResultListener *listener) const
 
- Public Member Functions inherited from testing::internal::WhenDynamicCastToMatcherBase< To &>
 WhenDynamicCastToMatcherBase (const Matcher< To & > &matcher)
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from testing::internal::WhenDynamicCastToMatcherBase< To &>
static string GetToName ()
 
- Protected Attributes inherited from testing::internal::WhenDynamicCastToMatcherBase< To &>
const Matcher< To & > matcher_
 

Detailed Description

template<typename To>
class testing::internal::WhenDynamicCastToMatcher< To & >

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

Constructor & Destructor Documentation

◆ WhenDynamicCastToMatcher()

template<typename To >
testing::internal::WhenDynamicCastToMatcher< To & >::WhenDynamicCastToMatcher ( const Matcher< To &> &  matcher)
inlineexplicit

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

2164  : WhenDynamicCastToMatcherBase<To&>(matcher) {}

Member Function Documentation

◆ MatchAndExplain()

template<typename To >
template<typename From >
bool testing::internal::WhenDynamicCastToMatcher< To & >::MatchAndExplain ( From &  from,
MatchResultListener listener 
) const
inline

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

2167  {
2168  // We don't want an std::bad_cast here, so do the cast with pointers.
2169  To* to = dynamic_cast<To*>(&from);
2170  if (to == NULL) {
2171  *listener << "which cannot be dynamic_cast to " << this->GetToName();
2172  return false;
2173  }
2174  return MatchPrintAndExplain(*to, this->matcher_, listener);
2175  }
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
Here is the call graph for this function:

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