DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Data Fields
DGtal::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > Struct Template Reference

#include <BasicFunctors.h>

Inheritance diagram for DGtal::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >:
Inheritance graph
[legend]
Collaboration diagram for DGtal::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >:
Collaboration graph
[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 = BoolFunction2>
struct DGtal::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:
Predicate1the left predicate type.
Predicate2the right predicate type.
TBinaryFunctorbinary functor used for comparison

Definition at line 400 of file BasicFunctors.h.


Member Typedef Documentation

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

Definition at line 402 of file BasicFunctors.h.

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

Definition at line 403 of file BasicFunctors.h.


Constructor & Destructor Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunction2>
DGtal::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 412 of file BasicFunctors.h.

: myPred1( &pred1 ), myPred2( &pred2 ), myBoolFunctor( &boolFunctor )
{
}
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunction2>
DGtal::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::PredicateCombiner ( const PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor > &  other)
inline

Copy constructor.

Parameters:
otherthe object to copy

Definition at line 423 of file BasicFunctors.h.

: myPred1( other.pred1 ), myPred2( other.pred2 ), myBoolFunctor( other.boolFunctor )
{
}
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunction2>
DGtal::PredicateCombiner< TPredicate1, TPredicate2, TBinaryFunctor >::~PredicateCombiner ( )
inline

Destructor

Definition at line 447 of file BasicFunctors.h.

{}

Member Function Documentation

template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunction2>
template<typename T >
bool DGtal::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 456 of file BasicFunctors.h.

{
return myBoolFunctor->operator()( myPred1->operator()( t ),
myPred2->operator()( t ) );
}
template<typename TPredicate1, typename TPredicate2, typename TBinaryFunctor = BoolFunction2>
PredicateCombiner& DGtal::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 433 of file BasicFunctors.h.

{
if (this != &other)
{
myPred1 = other.myPred1;
myPred2 = other.myPred2;
myBoolFunctor = other.myBoolFunctor;
}
return *this;
}

Field Documentation

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

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