DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CPredicate.h
1 
17 #pragma once
18 
31 #if defined(CPredicate_RECURSES)
32 #error Recursive header files inclusion detected in CPredicate.h
33 #else // defined(CPredicate_RECURSES)
34 
35 #define CPredicate_RECURSES
36 
37 #if !defined CPredicate_h
38 
39 #define CPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
46 
47 namespace DGtal
48 {
49 
51  // class CPredicate
106  template <typename T, typename TElement>
107  struct CPredicate : boost::Assignable<T>
108  {
109  // ----------------------- Concept checks ------------------------------
110  public:
111  typedef TElement Element;
112 
114  {
116  }
117 
119  {
120  // x( p ) returns bool.
121  ConceptUtils::sameType( myBool, myPred.operator() ( myElement ) );
122  }
123  // ------------------------- Private Datas --------------------------------
124  private:
127  bool myBool;
128  // ------------------------- Internals ------------------------------------
129  private:
130 
131  }; // end of concept CPredicate
132 
133 } // namespace DGtal
134 
135 // //
137 
138 #endif // !defined CPredicate_h
139 
140 #undef CPredicate_RECURSES
141 #endif // else defined(CPredicate_RECURSES)