DGtal 0.3.0

CDomain.h

Go to the documentation of this file.
00001 
00017 #pragma once
00018 
00031 #if defined(CDomain_RECURSES)
00032 #error Recursive header files inclusion detected in CDomain.h
00033 #else // defined(CDomain_RECURSES)
00034 
00035 #define CDomain_RECURSES
00036 
00037 #if !defined CDomain_h
00038 
00039 #define CDomain_h
00040 
00042 // Inclusions
00043 #include <iostream>
00044 #include "boost/concept_check.hpp"
00045 #include "DGtal/base/Common.h"
00046 #include "DGtal/utils/ConceptUtils.h"
00048 
00049 namespace DGtal
00050 {
00051 
00053   // class CDomain
00126   template <typename T>
00127   struct CDomain
00128   {
00129     // ----------------------- Concept checks ------------------------------
00130   public:
00131     typedef typename T::Domain Domain;
00132     typedef typename T::Space Space;
00133     typedef typename T::Point Point;
00134     typedef typename T::Vector Vector;
00135     typedef typename T::Integer Integer;
00136     typedef typename T::Size Size;
00137     typedef typename T::Dimension Dimension;
00138     // typedef typename T::ConstRange ConstRange;
00139     typedef typename T::ConstIterator ConstIterator;
00140     typedef typename T::Predicate Predicate;
00141     typedef typename T::IsBounded IsBounded;
00142 
00143     BOOST_CONCEPT_USAGE( CDomain )
00144     {
00145       // Domain should have a lowerBound() returning a Point.
00146       ConceptUtils::sameType( myP, myT.lowerBound() );
00147       // Domain should have an upperBound() returning a Point.
00148       ConceptUtils::sameType( myP, myT.upperBound() );
00149       // Domain should have a isInside(p) returning a bool.
00150       ConceptUtils::sameType( myBool, myT.isInside( myP ) );
00151       // Domain should have a predicate() returning a Predicate.
00152       ConceptUtils::sameType( myPred, myT.predicate() );
00153       // Domain should have a range() returning an range.
00154       //      ConceptUtils::sameType( myRange, myT.range() );
00155       // Range should have a begin() returning an iterator.
00156       // ConceptUtils::sameType( myIt, myT.range().begin() );
00157       // Domain should have a end() returning an iterator.
00158       // ConceptUtils::sameType( myIt, myT.range().end() );
00159     }
00160 
00161     // ------------------------- Private Datas --------------------------------
00162   private:
00163     T myT;
00164     Point myP;
00165     Predicate myPred;
00166     bool myBool;
00167     // ConstRange myRange;
00168     ConstIterator myIt;
00169 
00170     // ------------------------- Internals ------------------------------------
00171   private:
00172     
00173   }; // end of concept CDomain
00174   
00175 } // namespace DGtal
00176 
00177 //                                                                           //
00179 
00180 #endif // !defined CDomain_h
00181 
00182 #undef CDomain_RECURSES
00183 #endif // else defined(CDomain_RECURSES)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines