DGtal  0.9.4beta
Public Types | Public Member Functions | Data Fields
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > Struct Template Reference

#include <DGtal/base/BasicFunctors.h>

Inheritance diagram for DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >:
[legend]
Collaboration diagram for DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >:
[legend]

Public Types

typedef TPredicate1 Predicate1
 
typedef TPredicate2 Predicate2
 

Public Member Functions

 PredicateCombiner (const Predicate1 &pred1, const Predicate2 &pred2, const TBinaryFunctor &boolFunctor)
 
 PredicateCombiner (const PredicateCombiner &other)
 
PredicateCombineroperator= (const PredicateCombiner &other)
 
 ~PredicateCombiner ()
 
template<typename T >
bool operator() (const T &t) const
 

Data Fields

const Predicate1myPred1
 
const Predicate2myPred2
 
const TBinaryFunctor * myBoolFunctor
 

Detailed Description

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
struct DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >

Aim: The predicate returns true when the given binary functor returns true for the two Predicates given at construction.

Description of template class 'PredicateCombiner'

Template Parameters
TPredicate1the left predicate type.
TPredicate2the right predicate type.
TBinaryFunctorbinary functor used for comparison

Definition at line 490 of file BasicFunctors.h.

Member Typedef Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
typedef TPredicate1 DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::Predicate1

Definition at line 492 of file BasicFunctors.h.

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
typedef TPredicate2 DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::Predicate2

Definition at line 493 of file BasicFunctors.h.

Constructor & Destructor Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::PredicateCombiner ( const Predicate1 pred1,
const Predicate2 pred2,
const TBinaryFunctor &  boolFunctor 
)
inline

Constructor from predicates and bool Functor.

Parameters
pred1the left predicate.
pred2the right predicate.
boolFunctorthe binary function used to combine pred1 and pred2.

Definition at line 502 of file BasicFunctors.h.

505  : myPred1( &pred1 ), myPred2( &pred2 ), myBoolFunctor( &boolFunctor )
506  {
507  }
const Predicate2 * myPred2
aliasing pointer to the right predicate.
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
const Predicate1 * myPred1
aliasing pointer to the left predicate.
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::PredicateCombiner ( const PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > &  other)
inline

Copy constructor.

Parameters
otherthe object to copy

Definition at line 513 of file BasicFunctors.h.

514  : myPred1( other.pred1 ), myPred2( other.pred2 ), myBoolFunctor( other.boolFunctor )
515  {
516  }
const Predicate2 * myPred2
aliasing pointer to the right predicate.
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
const Predicate1 * myPred1
aliasing pointer to the left predicate.
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::~PredicateCombiner ( )
inline

Destructor

Definition at line 537 of file BasicFunctors.h.

537 {}

Member Function Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
template<typename T >
bool DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::operator() ( const T &  t) const
inline
Parameters
tany object of type T.
Template Parameters
Tany input type supported by the two predicates to combine
Returns
the value of the predicate.

Definition at line 546 of file BasicFunctors.h.

547  {
548  return myBoolFunctor->operator()( myPred1->operator()( t ),
549  myPred2->operator()( t ) );
550  }
const Predicate2 * myPred2
aliasing pointer to the right predicate.
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
const Predicate1 * myPred1
aliasing pointer to the left predicate.
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
PredicateCombiner& DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::operator= ( const PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > &  other)
inline

Assignement

Parameters
otherthe object to copy
Returns
reference to the current object

Definition at line 523 of file BasicFunctors.h.

524  {
525  if (this != &other)
526  {
527  myPred1 = other.myPred1;
528  myPred2 = other.myPred2;
529  myBoolFunctor = other.myBoolFunctor;
530  }
531  return *this;
532  }
const Predicate2 * myPred2
aliasing pointer to the right predicate.
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
const Predicate1 * myPred1
aliasing pointer to the left predicate.

Field Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
const TBinaryFunctor* DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myBoolFunctor
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
const Predicate1* DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred1
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunctor2>
const Predicate2* DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred2

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