DGtal  0.9.2
SetPredicate.h
1 
17 #pragma once
18 
31 #if defined(SetPredicate_RECURSES)
32 #error Recursive header files inclusion detected in SetPredicate.h
33 #else // defined(SetPredicate_RECURSES)
34 
35 #define SetPredicate_RECURSES
36 
37 #if !defined SetPredicate_h
38 
39 #define SetPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/kernel/BasicPointPredicates.h"
48 
49 namespace DGtal
50 {
51  // 2013/02/02: JOL: Since 0.6, models of CDigitalSet are also models
52  // of concepts::CPointPredicate. Therefore, this facade to models of
53  // CDigitalSet is no longer useful.
54  namespace deprecated {
55 
57  // template class SetPredicate
72  template <typename TDigitalSet>
73  struct SetPredicate
74  {
75  // ----------------------- Standard services ------------------------------
76  public:
77  typedef TDigitalSet DigitalSet;
78  typedef typename DigitalSet::Domain Domain;
79  typedef typename Domain::Point Point;
80 
86 
91  SetPredicate ( const SetPredicate & other );
92 
98  SetPredicate & operator= ( const SetPredicate & other );
99 
104  bool operator()( const Point & p ) const;
105 
106  // ------------------------- Hidden services ------------------------------
107  protected:
108 
113  SetPredicate();
114 
115  // ------------------------- Internals ------------------------------------
116  private:
120  const DigitalSet* mySet;
121 
122  }; // end of struct SetPredicate
123 
124  } // namespace deprecated
125 
126 } // namespace DGtal
127 
128 
130 // Includes inline functions.
131 #include "DGtal/kernel/sets/SetPredicate.ih"
132 
133 // //
135 
136 #endif // !defined SetPredicate_h
137 
138 #undef SetPredicate_RECURSES
139 #endif // else defined(SetPredicate_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
bool operator()(const Point &p) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The predicate returning true iff the point is in the set given at construction. The set given at construction is aliased in the predicate and not cloned, which means that the lifetime of the set should exceed the lifetime of the predicate.
Definition: SetPredicate.h:73
SetPredicate & operator=(const SetPredicate &other)