DGtal  1.4.2
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor > Struct Template Reference

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

#include <DGtal/kernel/BasicPointPredicates.h>

Public Types

typedef TPointPredicate1 PointPredicate1
 
typedef TPointPredicate2 PointPredicate2
 
typedef PointPredicate1::Point Point
 
typedef PointPredicate2::Point Point2
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CPointPredicate< PointPredicate1 >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CPointPredicate< PointPredicate2 >))
 
 BOOST_CONCEPT_ASSERT ((boost::BinaryFunction< TBinaryFunctor, bool, bool, bool >))
 
 BOOST_STATIC_ASSERT ((boost::is_same< Point, Point2 >::value))
 
 BinaryPointPredicate (ConstAlias< PointPredicate1 > pred1, ConstAlias< PointPredicate2 > pred2, ConstAlias< TBinaryFunctor > boolFunctor)
 
bool operator() (const Point &p) const
 

Data Fields

const PointPredicate1myPred1
 aliasing pointer to the left predicate. More...
 
const PointPredicate2myPred2
 aliasing pointer to the right predicate. More...
 
const TBinaryFunctor * myBoolFunctor
 aliasing pointer to the binary functor. More...
 

Detailed Description

template<typename TPointPredicate1, typename TPointPredicate2, typename TBinaryFunctor = BoolFunctor2>
struct DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >

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

Description of template class 'BinaryPointPredicate'

Note that this class is specialized for DGtal::AndBoolFct2 and DGtal::OrBoolFct2 in order to guarantee that the second computation is not performed when the first point predicate return false (resp. true) with DGtal::AndBoolFct2 (resp. DGtal::OrBoolFct2).

Template Parameters
TPointPredicate1the left predicate type.
TPointPredicate2the right predicate type.
TBinaryFunctorbinary functor used for comparison

Definition at line 275 of file BasicPointPredicates.h.

Member Typedef Documentation

◆ Point

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
typedef PointPredicate1::Point DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::Point

Definition at line 279 of file BasicPointPredicates.h.

◆ Point2

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
typedef PointPredicate2::Point DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::Point2

Definition at line 280 of file BasicPointPredicates.h.

◆ PointPredicate1

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
typedef TPointPredicate1 DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::PointPredicate1

Definition at line 277 of file BasicPointPredicates.h.

◆ PointPredicate2

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
typedef TPointPredicate2 DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::PointPredicate2

Definition at line 278 of file BasicPointPredicates.h.

Constructor & Destructor Documentation

◆ BinaryPointPredicate()

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::BinaryPointPredicate ( ConstAlias< PointPredicate1 pred1,
ConstAlias< PointPredicate2 pred2,
ConstAlias< TBinaryFunctor >  boolFunctor 
)

Constructor from predicates and bool Functor.

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

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/3]

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::BOOST_CONCEPT_ASSERT ( (boost::BinaryFunction< TBinaryFunctor, bool, bool, bool >)  )

◆ BOOST_CONCEPT_ASSERT() [2/3]

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CPointPredicate< PointPredicate1 >)  )

◆ BOOST_CONCEPT_ASSERT() [3/3]

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CPointPredicate< PointPredicate2 >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::BOOST_STATIC_ASSERT ( (boost::is_same< Point, Point2 >::value)  )

◆ operator()()

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
bool DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::operator() ( const Point p) const
Parameters
pany point.
Returns
the value of the predicate at this point.

Field Documentation

◆ myBoolFunctor

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
const TBinaryFunctor* DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::myBoolFunctor

aliasing pointer to the binary functor.

Definition at line 307 of file BasicPointPredicates.h.

◆ myPred1

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
const PointPredicate1* DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::myPred1

aliasing pointer to the left predicate.

Definition at line 303 of file BasicPointPredicates.h.

◆ myPred2

template<typename TPointPredicate1 , typename TPointPredicate2 , typename TBinaryFunctor = BoolFunctor2>
const PointPredicate2* DGtal::functors::BinaryPointPredicate< TPointPredicate1, TPointPredicate2, TBinaryFunctor >::myPred2

aliasing pointer to the right predicate.

Definition at line 305 of file BasicPointPredicates.h.


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