ManaPlus
Public Member Functions | Private Attributes
Catch::Matchers::Impl::Generic::AllOf< ExpressionT > Class Template Reference

#include <catch.hpp>

Inheritance diagram for Catch::Matchers::Impl::Generic::AllOf< ExpressionT >:
Catch::Matchers::Impl::MatcherImpl< AllOf< ExpressionT >, ExpressionT > Catch::Matchers::Impl::Matcher< ExpressionT > Catch::SharedImpl< IShared > Catch::IShared Catch::NonCopyable

Public Member Functions

 AllOf ()
 
 AllOf (AllOf const &other)
 
AllOfadd (Matcher< ExpressionT > const &matcher)
 
virtual bool match (ExpressionT const &expr) const
 
virtual std::string toString () const
 
AllOf operator&& (Matcher< ExpressionT > const &other) const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherImpl< AllOf< ExpressionT >, ExpressionT >
virtual Ptr< Matcher< ExpressionT > > clone () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::Matcher< ExpressionT >
virtual ~Matcher ()
 
Generic::AllOf< ExpressionT > operator&& (Matcher< ExpressionT > const &other) const
 
Generic::AnyOf< ExpressionT > operator|| (Matcher< ExpressionT > const &other) const
 
Generic::Not< ExpressionT > operator! () const
 
- Public Member Functions inherited from Catch::SharedImpl< IShared >
 SharedImpl ()
 
virtual void addRef () const
 
virtual void release () const
 
- Public Member Functions inherited from Catch::IShared
virtual ~IShared ()
 

Private Attributes

std::vector< Ptr< Matcher< ExpressionT > > > m_matchers
 

Additional Inherited Members

- Public Types inherited from Catch::Matchers::Impl::Matcher< ExpressionT >
typedef ExpressionT ExpressionType
 
- Data Fields inherited from Catch::SharedImpl< IShared >
unsigned int m_rc
 
- Protected Member Functions inherited from Catch::NonCopyable
 NonCopyable ()
 
virtual ~NonCopyable ()
 

Detailed Description

template<typename ExpressionT>
class Catch::Matchers::Impl::Generic::AllOf< ExpressionT >

Definition at line 943 of file catch.hpp.

Constructor & Destructor Documentation

◆ AllOf() [1/2]

template<typename ExpressionT >
Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::AllOf ( )
inline

Definition at line 946 of file catch.hpp.

946 {}

◆ AllOf() [2/2]

template<typename ExpressionT >
Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::AllOf ( AllOf< ExpressionT > const &  other)
inline

Definition at line 947 of file catch.hpp.

947 : m_matchers( other.m_matchers ) {}
std::vector< Ptr< Matcher< ExpressionT > > > m_matchers
Definition: catch.hpp:979

Member Function Documentation

◆ add()

template<typename ExpressionT >
AllOf& Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::add ( Matcher< ExpressionT > const &  matcher)
inline

◆ match()

template<typename ExpressionT >
virtual bool Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::match ( ExpressionT const &  expr) const
inlinevirtual

Implements Catch::Matchers::Impl::Matcher< ExpressionT >.

Definition at line 953 of file catch.hpp.

954  {
955  for( std::size_t i = 0; i < m_matchers.size(); ++i )
956  if( !m_matchers[i]->match( expr ) )
957  return false;
958  return true;
959  }
virtual bool match(ExpressionT const &expr) const
Definition: catch.hpp:953

◆ operator&&()

template<typename ExpressionT >
AllOf Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::operator&& ( Matcher< ExpressionT > const &  other) const
inline

Definition at line 972 of file catch.hpp.

972  {
973  AllOf allOfExpr( *this );
974  allOfExpr.add( other );
975  return allOfExpr;
976  }

References Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::add().

◆ toString()

template<typename ExpressionT >
virtual std::string Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::toString ( ) const
inlinevirtual

Implements Catch::Matchers::Impl::Matcher< ExpressionT >.

Definition at line 960 of file catch.hpp.

960  {
961  std::ostringstream oss;
962  oss << "( ";
963  for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
964  if( i != 0 )
965  oss << " and ";
966  oss << m_matchers[i]->toString();
967  }
968  oss << " )";
969  return oss.str();
970  }

Field Documentation

◆ m_matchers

template<typename ExpressionT >
std::vector<Ptr<Matcher<ExpressionT> > > Catch::Matchers::Impl::Generic::AllOf< ExpressionT >::m_matchers
private

Definition at line 979 of file catch.hpp.


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