DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
DGtal::SetPredicate< TDigitalSet > Struct Template Reference

#include <SetPredicate.h>

Inheritance diagram for DGtal::SetPredicate< TDigitalSet >:
Inheritance graph
[legend]

Public Types

typedef TDigitalSet DigitalSet
typedef DigitalSet::Domain Domain
typedef Domain::Point Point

Public Member Functions

 SetPredicate (const DigitalSet &aSet)
 SetPredicate (const SetPredicate &other)
SetPredicateoperator= (const SetPredicate &other)
bool operator() (const Point &p) const

Protected Member Functions

 SetPredicate ()

Private Attributes

const DigitalSetmySet

Detailed Description

template<typename TDigitalSet>
struct DGtal::SetPredicate< TDigitalSet >

Aim: The predicate returning true iff the point is in the domain given at construction.

Description of template class 'SetPredicate'

Model of CPointPredicate

Examples:
topology/ctopo-2-3d.cpp, and topology/ctopo-2.cpp.

Definition at line 61 of file SetPredicate.h.


Member Typedef Documentation

template<typename TDigitalSet>
typedef TDigitalSet DGtal::SetPredicate< TDigitalSet >::DigitalSet

Definition at line 65 of file SetPredicate.h.

template<typename TDigitalSet>
typedef DigitalSet::Domain DGtal::SetPredicate< TDigitalSet >::Domain

Definition at line 66 of file SetPredicate.h.

template<typename TDigitalSet>
typedef Domain::Point DGtal::SetPredicate< TDigitalSet >::Point

Definition at line 67 of file SetPredicate.h.


Constructor & Destructor Documentation

template<typename TDigitalSet >
DGtal::SetPredicate< TDigitalSet >::SetPredicate ( const DigitalSet aSet)
inline

Constructor.

Parameters:
aSetany set.

Definition at line 45 of file SetPredicate.ih.

: mySet( &aSet )
{
}
template<typename TDigitalSet >
DGtal::SetPredicate< TDigitalSet >::SetPredicate ( const SetPredicate< TDigitalSet > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 53 of file SetPredicate.ih.

: mySet( other.mySet )
{
}
template<typename TDigitalSet>
DGtal::SetPredicate< TDigitalSet >::SetPredicate ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).


Member Function Documentation

template<typename TDigitalSet >
bool DGtal::SetPredicate< TDigitalSet >::operator() ( const Point p) const
inline
Parameters:
pany point.
Returns:
true iff p is in the domain.

Definition at line 75 of file SetPredicate.ih.

{
return mySet->find( p ) != mySet->end();
}
template<typename TDigitalSet >
DGtal::SetPredicate< TDigitalSet > & DGtal::SetPredicate< TDigitalSet >::operator= ( const SetPredicate< TDigitalSet > &  other)
inline

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.

Definition at line 62 of file SetPredicate.ih.

References DGtal::SetPredicate< TDigitalSet >::mySet.

{
if (this != &other)
{
mySet = other.mySet;
}
return *this;
}

Field Documentation

template<typename TDigitalSet>
const DigitalSet* DGtal::SetPredicate< TDigitalSet >::mySet
private

Aliasing pointer on the underlying set

Definition at line 108 of file SetPredicate.h.

Referenced by DGtal::SetPredicate< TDigitalSet >::operator=().


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