proxygen
testing::internal::PropertyMatcher< Class, PropertyType > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

typedef GTEST_REFERENCE_TO_CONST_ (PropertyType) RefToConstProperty
 
 PropertyMatcher (PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 
template<typename T >
bool MatchAndExplain (const T &value, MatchResultListener *listener) const
 
typedef GTEST_REFERENCE_TO_CONST_ (PropertyType) RefToConstProperty
 
 PropertyMatcher (PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 
template<typename T >
bool MatchAndExplain (const T &value, MatchResultListener *listener) const
 
typedef GTEST_REFERENCE_TO_CONST_ (PropertyType) RefToConstProperty
 
 PropertyMatcher (PropertyType(Class::*property)() const, const Matcher< RefToConstProperty > &matcher)
 
void DescribeTo (::std::ostream *os) const
 
void DescribeNegationTo (::std::ostream *os) const
 
template<typename T >
bool MatchAndExplain (const T &value, MatchResultListener *listener) const
 

Private Member Functions

bool MatchAndExplainImpl (false_type, const Class &obj, MatchResultListener *listener) const
 
bool MatchAndExplainImpl (true_type, const Class *p, MatchResultListener *listener) const
 
 GTEST_DISALLOW_ASSIGN_ (PropertyMatcher)
 
bool MatchAndExplainImpl (false_type, const Class &obj, MatchResultListener *listener) const
 
bool MatchAndExplainImpl (true_type, const Class *p, MatchResultListener *listener) const
 
 GTEST_DISALLOW_ASSIGN_ (PropertyMatcher)
 
bool MatchAndExplainImpl (false_type, const Class &obj, MatchResultListener *listener) const
 
bool MatchAndExplainImpl (true_type, const Class *p, MatchResultListener *listener) const
 
 GTEST_DISALLOW_ASSIGN_ (PropertyMatcher)
 

Private Attributes

PropertyType(Class::* property_ )() const
 
const Matcher< RefToConstProperty > matcher_
 

Detailed Description

template<typename Class, typename PropertyType>
class testing::internal::PropertyMatcher< Class, PropertyType >

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

Constructor & Destructor Documentation

template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::PropertyMatcher ( PropertyType(Class::*)() const  property,
const Matcher< RefToConstProperty > &  matcher 
)
inline

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

2246  : property_(property), matcher_(matcher) {}
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const
template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::PropertyMatcher ( PropertyType(Class::*)() const  property,
const Matcher< RefToConstProperty > &  matcher 
)
inline

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

2246  : property_(property), matcher_(matcher) {}
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const
template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::PropertyMatcher ( PropertyType(Class::*)() const  property,
const Matcher< RefToConstProperty > &  matcher 
)
inline

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

2246  : property_(property), matcher_(matcher) {}
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const

Member Function Documentation

template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeNegationTo ( ::std::ostream *  os) const
inline

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

2253  {
2254  *os << "is an object whose given property ";
2256  }
const Matcher< RefToConstProperty > matcher_
void DescribeNegationTo(::std::ostream *os) const
template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeNegationTo ( ::std::ostream *  os) const
inline

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

2253  {
2254  *os << "is an object whose given property ";
2256  }
const Matcher< RefToConstProperty > matcher_
void DescribeNegationTo(::std::ostream *os) const
template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeNegationTo ( ::std::ostream *  os) const
inline

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

2253  {
2254  *os << "is an object whose given property ";
2256  }
const Matcher< RefToConstProperty > matcher_
void DescribeNegationTo(::std::ostream *os) const
template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeTo ( ::std::ostream *  os) const
inline

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

2248  {
2249  *os << "is an object whose given property ";
2250  matcher_.DescribeTo(os);
2251  }
void DescribeTo(::std::ostream *os) const
const Matcher< RefToConstProperty > matcher_
template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeTo ( ::std::ostream *  os) const
inline

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

2248  {
2249  *os << "is an object whose given property ";
2250  matcher_.DescribeTo(os);
2251  }
void DescribeTo(::std::ostream *os) const
const Matcher< RefToConstProperty > matcher_
template<typename Class , typename PropertyType >
void testing::internal::PropertyMatcher< Class, PropertyType >::DescribeTo ( ::std::ostream *  os) const
inline

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

2248  {
2249  *os << "is an object whose given property ";
2250  matcher_.DescribeTo(os);
2251  }
void DescribeTo(::std::ostream *os) const
const Matcher< RefToConstProperty > matcher_
template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_DISALLOW_ASSIGN_ ( PropertyMatcher< Class, PropertyType >  )
private
template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_DISALLOW_ASSIGN_ ( PropertyMatcher< Class, PropertyType >  )
private
template<typename Class , typename PropertyType >
testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_DISALLOW_ASSIGN_ ( PropertyMatcher< Class, PropertyType >  )
private
template<typename Class , typename PropertyType >
typedef testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_REFERENCE_TO_CONST_ ( PropertyType  )
template<typename Class , typename PropertyType >
typedef testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_REFERENCE_TO_CONST_ ( PropertyType  )
template<typename Class , typename PropertyType >
typedef testing::internal::PropertyMatcher< Class, PropertyType >::GTEST_REFERENCE_TO_CONST_ ( PropertyType  )
template<typename Class , typename PropertyType >
template<typename T >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplain ( const T value,
MatchResultListener listener 
) const
inline

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

References GTEST_REMOVE_CONST_, T, and type.

2259  {
2260  return MatchAndExplainImpl(
2261  typename ::testing::internal::
2262  is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
2263  value, listener);
2264  }
#define T(v)
Definition: http_parser.c:233
PskType type
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
#define GTEST_REMOVE_CONST_(T)
static const char *const value
Definition: Conv.cpp:50
template<typename Class , typename PropertyType >
template<typename T >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplain ( const T value,
MatchResultListener listener 
) const
inline

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

References GTEST_REMOVE_CONST_, and type.

2259  {
2260  return MatchAndExplainImpl(
2261  typename ::testing::internal::
2262  is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
2263  value, listener);
2264  }
#define T(v)
Definition: http_parser.c:233
PskType type
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
#define GTEST_REMOVE_CONST_(T)
static const char *const value
Definition: Conv.cpp:50
template<typename Class , typename PropertyType >
template<typename T >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplain ( const T value,
MatchResultListener listener 
) const
inline

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

References GTEST_REMOVE_CONST_, and type.

2259  {
2260  return MatchAndExplainImpl(
2261  typename ::testing::internal::
2262  is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
2263  value, listener);
2264  }
#define T(v)
Definition: http_parser.c:233
PskType type
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
#define GTEST_REMOVE_CONST_(T)
static const char *const value
Definition: Conv.cpp:50
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( false_type  ,
const Class &  obj,
MatchResultListener listener 
) const
inlineprivate

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

References testing::internal::posix::Abort(), and testing::internal::MatchPrintAndExplain().

2271  {
2272  *listener << "whose given property is ";
2273  // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
2274  // which takes a non-const reference as argument.
2275 #if defined(_PREFAST_ ) && _MSC_VER == 1800
2276  // Workaround bug in VC++ 2013's /analyze parser.
2277  // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
2278  posix::Abort(); // To make sure it is never run.
2279  return false;
2280 #else
2281  RefToConstProperty result = (obj.*property_)();
2282  return MatchPrintAndExplain(result, matcher_, listener);
2283 #endif
2284  }
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( false_type  ,
const Class &  obj,
MatchResultListener listener 
) const
inlineprivate

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

References testing::internal::posix::Abort(), and testing::internal::MatchPrintAndExplain().

2271  {
2272  *listener << "whose given property is ";
2273  // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
2274  // which takes a non-const reference as argument.
2275 #if defined(_PREFAST_ ) && _MSC_VER == 1800
2276  // Workaround bug in VC++ 2013's /analyze parser.
2277  // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
2278  posix::Abort(); // To make sure it is never run.
2279  return false;
2280 #else
2281  RefToConstProperty result = (obj.*property_)();
2282  return MatchPrintAndExplain(result, matcher_, listener);
2283 #endif
2284  }
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( false_type  ,
const Class &  obj,
MatchResultListener listener 
) const
inlineprivate

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

References testing::internal::posix::Abort(), and testing::internal::MatchPrintAndExplain().

2271  {
2272  *listener << "whose given property is ";
2273  // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
2274  // which takes a non-const reference as argument.
2275 #if defined(_PREFAST_ ) && _MSC_VER == 1800
2276  // Workaround bug in VC++ 2013's /analyze parser.
2277  // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
2278  posix::Abort(); // To make sure it is never run.
2279  return false;
2280 #else
2281  RefToConstProperty result = (obj.*property_)();
2282  return MatchPrintAndExplain(result, matcher_, listener);
2283 #endif
2284  }
bool MatchPrintAndExplain(Value &value, const Matcher< T > &matcher, MatchResultListener *listener)
const Matcher< RefToConstProperty > matcher_
PropertyType(Class::* property_)() const
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( true_type  ,
const Class *  p,
MatchResultListener listener 
) const
inlineprivate

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

2287  {
2288  if (p == NULL)
2289  return false;
2290 
2291  *listener << "which points to an object ";
2292  // Since *p has a property method, it must be a class/struct/union
2293  // type and thus cannot be a pointer. Therefore we pass
2294  // false_type() as the first argument.
2295  return MatchAndExplainImpl(false_type(), *p, listener);
2296  }
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
bool_constant< false > false_type
Definition: gtest-port.h:2209
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( true_type  ,
const Class *  p,
MatchResultListener listener 
) const
inlineprivate

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

References GTEST_DISALLOW_ASSIGN_.

2287  {
2288  if (p == NULL)
2289  return false;
2290 
2291  *listener << "which points to an object ";
2292  // Since *p has a property method, it must be a class/struct/union
2293  // type and thus cannot be a pointer. Therefore we pass
2294  // false_type() as the first argument.
2295  return MatchAndExplainImpl(false_type(), *p, listener);
2296  }
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
bool_constant< false > false_type
Definition: gtest-port.h:2209
template<typename Class , typename PropertyType >
bool testing::internal::PropertyMatcher< Class, PropertyType >::MatchAndExplainImpl ( true_type  ,
const Class *  p,
MatchResultListener listener 
) const
inlineprivate

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

References GTEST_DISALLOW_ASSIGN_.

2287  {
2288  if (p == NULL)
2289  return false;
2290 
2291  *listener << "which points to an object ";
2292  // Since *p has a property method, it must be a class/struct/union
2293  // type and thus cannot be a pointer. Therefore we pass
2294  // false_type() as the first argument.
2295  return MatchAndExplainImpl(false_type(), *p, listener);
2296  }
bool MatchAndExplainImpl(false_type, const Class &obj, MatchResultListener *listener) const
bool_constant< false > false_type
Definition: gtest-port.h:2209

Member Data Documentation

template<typename Class , typename PropertyType >
const Matcher< RefToConstProperty > testing::internal::PropertyMatcher< Class, PropertyType >::matcher_
private

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

template<typename Class , typename PropertyType >
PropertyType(Class::* testing::internal::PropertyMatcher< Class, PropertyType >::property_)() const
private

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


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