DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BasicBoolFunctions.h
1 
17 #pragma once
18 
31 #if defined(BasicBoolFunctions_RECURSES)
32 #error Recursive header files inclusion detected in BasicBoolFunctions.h
33 #else // defined(BasicBoolFunctions_RECURSES)
34 
35 #define BasicBoolFunctions_RECURSES
36 
37 #if !defined BasicBoolFunctions_h
38 
39 #define BasicBoolFunctions_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <boost/function.hpp>
45 #include "DGtal/base/Common.h"
47 
48 namespace DGtal
49 {
53  typedef boost::function0< bool > BoolFunction0;
54 
58  typedef boost::function1< bool, bool > BoolFunction1;
59 
63  typedef boost::function2< bool, bool, bool > BoolFunction2;
64 
68  typedef boost::function3< bool, bool, bool, bool > BoolFunction3;
69 
73  struct TrueBoolFct0 {
74  bool operator()() const;
75  };
76 
80  struct FalseBoolFct0 {
81  bool operator()() const;
82  };
83 
88 
93 
98  bool operator()( bool b ) const;
99  };
100 
104  struct NotBoolFct1 {
105  bool operator()( bool b ) const;
106  };
107 
112 
116  static const BoolFunction1 notBF1 = NotBoolFct1();
117 
121  struct AndBoolFct2 {
122  bool operator()( bool b1, bool b2 ) const;
123  };
124 
128  struct OrBoolFct2 {
129  bool operator()( bool b1, bool b2 ) const;
130  };
131 
135  struct XorBoolFct2 {
136  bool operator()( bool b1, bool b2 ) const;
137  };
138 
143  bool operator()( bool b1, bool b2 ) const;
144  };
145 
149  static const BoolFunction2 andBF2 = AndBoolFct2();
150 
154  static const BoolFunction2 orBF2 = OrBoolFct2();
155 
159  static const BoolFunction2 xorBF2 = XorBoolFct2();
160 
165 
166 } // namespace DGtal
167 
168 
170 // Includes inline functions.
171 #include "DGtal/base/BasicBoolFunctions.ih"
172 
173 // //
175 
176 #endif // !defined BasicBoolFunctions_h
177 
178 #undef BasicBoolFunctions_RECURSES
179 #endif // else defined(BasicBoolFunctions_RECURSES)