DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > Struct Template Reference

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

#include <DGtal/base/BasicFunctors.h>

Inheritance 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
 aliasing pointer to the left predicate.
 
const Predicate2myPred2
 aliasing pointer to the right predicate.
 
const TBinaryFunctor * myBoolFunctor
 aliasing pointer to the binary functor.
 

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 622 of file BasicFunctors.h.

Member Typedef Documentation

◆ Predicate1

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

Definition at line 624 of file BasicFunctors.h.

◆ Predicate2

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

Definition at line 625 of file BasicFunctors.h.

Constructor & Destructor Documentation

◆ PredicateCombiner() [1/2]

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 634 of file BasicFunctors.h.

637 : myPred1( &pred1 ), myPred2( &pred2 ), myBoolFunctor( &boolFunctor )
638 {
639 }
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
const Predicate2 * myPred2
aliasing pointer to the right predicate.
const Predicate1 * myPred1
aliasing pointer to the left predicate.

◆ PredicateCombiner() [2/2]

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 645 of file BasicFunctors.h.

646 : myPred1( other.myPred1 ), myPred2( other.myPred2 ), myBoolFunctor( other.myBoolFunctor )
647 {
648 }

◆ ~PredicateCombiner()

template<typename TPredicate1 , typename TPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::~PredicateCombiner ( )
inline

Destructor

Definition at line 669 of file BasicFunctors.h.

669{}

Member Function Documentation

◆ operator()()

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 678 of file BasicFunctors.h.

679 {
680 return myBoolFunctor->operator()( myPred1->operator()( t ),
681 myPred2->operator()( t ) );
682 }

References DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myBoolFunctor, DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred1, and DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred2.

◆ operator=()

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 655 of file BasicFunctors.h.

656 {
657 if (this != &other)
658 {
659 myPred1 = other.myPred1;
660 myPred2 = other.myPred2;
661 myBoolFunctor = other.myBoolFunctor;
662 }
663 return *this;
664 }

References DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myBoolFunctor, DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred1, and DGtal::functors::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::myPred2.

Field Documentation

◆ myBoolFunctor

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

◆ myPred1

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

◆ myPred2

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: