DGtal 0.3.0

BasicBoolFunctions.h

Go to the documentation of this file.
00001 
00017 #pragma once
00018 
00031 #if defined(BasicBoolFunctions_RECURSES)
00032 #error Recursive header files inclusion detected in BasicBoolFunctions.h
00033 #else // defined(BasicBoolFunctions_RECURSES)
00034 
00035 #define BasicBoolFunctions_RECURSES
00036 
00037 #if !defined BasicBoolFunctions_h
00038 
00039 #define BasicBoolFunctions_h
00040 
00042 // Inclusions
00043 #include <iostream>
00044 #include <boost/function.hpp>
00045 #include "DGtal/base/Common.h"
00047 
00048 namespace DGtal
00049 {
00053   typedef boost::function0< bool > BoolFunction0;
00054 
00058   typedef boost::function1< bool, bool > BoolFunction1;
00059 
00063   typedef boost::function2< bool, bool, bool > BoolFunction2;
00064 
00068   typedef boost::function3< bool, bool, bool, bool > BoolFunction3;
00069 
00073   struct TrueBoolFct0 {
00074     bool operator()() const;
00075   };
00076 
00080   struct FalseBoolFct0 {
00081     bool operator()() const;
00082   };
00083 
00087   static const BoolFunction0 trueBF0 = TrueBoolFct0();
00088 
00092   static const BoolFunction0 falseBF0 = FalseBoolFct0();
00093 
00097   struct IdentityBoolFct1 {
00098     bool operator()( bool b ) const;
00099   };
00100 
00104   struct NotBoolFct1 {
00105     bool operator()( bool b ) const;
00106   };
00107 
00111   static const BoolFunction1 identityBF1 = IdentityBoolFct1();
00112 
00116   static const BoolFunction1 notBF1 = NotBoolFct1();
00117 
00121   struct AndBoolFct2 {
00122     bool operator()( bool b1, bool b2 ) const;
00123   };
00124 
00128   struct OrBoolFct2 {
00129     bool operator()( bool b1, bool b2 ) const;
00130   };
00131 
00135   struct XorBoolFct2 {
00136     bool operator()( bool b1, bool b2 ) const;
00137   };
00138 
00142   struct ImpliesBoolFct2 {
00143     bool operator()( bool b1, bool b2 ) const;
00144   };
00145 
00149   static const BoolFunction2 andBF2 = AndBoolFct2();
00150 
00154   static const BoolFunction2 orBF2 = OrBoolFct2();
00155 
00159   static const BoolFunction2 xorBF2 = XorBoolFct2();
00160 
00164   static const BoolFunction2 impliesBF2 = ImpliesBoolFct2();
00165 
00166 } // namespace DGtal
00167 
00168 
00170 // Includes inline functions.
00171 #include "DGtal/base/BasicBoolFunctions.ih"
00172 
00173 //                                                                           //
00175 
00176 #endif // !defined BasicBoolFunctions_h
00177 
00178 #undef BasicBoolFunctions_RECURSES
00179 #endif // else defined(BasicBoolFunctions_RECURSES)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines