DGtal  0.9.4beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::Thresholder< T, isLower, isEqual > Class Template Reference

#include <DGtal/base/BasicFunctors.h>

Inheritance diagram for DGtal::functors::Thresholder< T, isLower, isEqual >:
[legend]
Collaboration diagram for DGtal::functors::Thresholder< T, isLower, isEqual >:
[legend]

Public Types

typedef T Input
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((boost::EqualityComparable< T >))
 
 BOOST_CONCEPT_ASSERT ((boost::LessThanComparable< T >))
 
 Thresholder (const Input &aT=0)
 
bool operator() (const Input &aI) const
 

Private Attributes

Input myT
 

Detailed Description

template<typename T, bool isLower = true, bool isEqual = true>
class DGtal::functors::Thresholder< T, isLower, isEqual >

Aim: A small functor with an operator () that compares one value to a threshold value according to two bool template parameters.

// template class Thresholder

Template Parameters
Ttype for a value that must be equally and less-than comparable
isLowera bool for the comparison sign : 'true' for < (default), 'false' for <
isEquala bool for the equality : 'true' for a large inequality (default), 'false' for a strict one
Examples:
geometry/volumes/distance/exampleFMM3D.cpp, and images/exampleConstImageAdapter.cpp.

Definition at line 368 of file BasicFunctors.h.

Member Typedef Documentation

template<typename T, bool isLower = true, bool isEqual = true>
typedef T DGtal::functors::Thresholder< T, isLower, isEqual >::Input

Definition at line 375 of file BasicFunctors.h.

Constructor & Destructor Documentation

template<typename T, bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::Thresholder ( const Input aT = 0)
inline

Constructor.

Parameters
aTthe threshold value (default 0).

Definition at line 381 of file BasicFunctors.h.

381 :myT(aT) {}

Member Function Documentation

template<typename T, bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::BOOST_CONCEPT_ASSERT ( (boost::EqualityComparable< T >)  )
template<typename T, bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::BOOST_CONCEPT_ASSERT ( (boost::LessThanComparable< T >)  )
template<typename T, bool isLower = true, bool isEqual = true>
bool DGtal::functors::Thresholder< T, isLower, isEqual >::operator() ( const Input aI) const
inline

Compares aI to @ myT.

Parameters
aIany input value
Returns
'true' or 'false' according to isLower and isEqual

Definition at line 387 of file BasicFunctors.h.

387  {
388  std::less_equal<Input> c;
389  return c(aI,myT);
390  }

Field Documentation

template<typename T, bool isLower = true, bool isEqual = true>
Input DGtal::functors::Thresholder< T, isLower, isEqual >::myT
private

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