DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CDomain.h
1 
17 #pragma once
18 
31 #if defined(CDomain_RECURSES)
32 #error Recursive header files inclusion detected in CDomain.h
33 #else // defined(CDomain_RECURSES)
34 
35 #define CDomain_RECURSES
36 
37 #if !defined CDomain_h
38 
39 #define CDomain_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "boost/concept_check.hpp"
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/ConceptUtils.h"
47 #include "DGtal/base/CConstSinglePassRange.h"
49 
50 namespace DGtal
51 {
52 
54  // class CDomain
127  template <typename T>
128  struct CDomain : public CConstSinglePassRange<T>
129  {
130  // ----------------------- Concept checks ------------------------------
131  public:
132  typedef typename T::Domain Domain;
133  typedef typename T::Space Space;
134  typedef typename T::Point Point;
135  typedef typename T::Vector Vector;
136  typedef typename T::Integer Integer;
137  typedef typename T::Size Size;
138  typedef typename T::Dimension Dimension;
139  typedef typename T::Predicate Predicate;
140  typedef typename T::ConstIterator ConstIterator;
141 
143  {
144  // Domain should have a lowerBound() returning a Point.
145  ConceptUtils::sameType( myP, myT.lowerBound() );
146  // Domain should have an upperBound() returning a Point.
147  ConceptUtils::sameType( myP, myT.upperBound() );
148  // Domain should have a size() returning a Size.
149  ConceptUtils::sameType( mySize, myT.size() );
150  // Domain should have a isInside(p) returning a bool.
151  ConceptUtils::sameType( myBool, myT.isInside( myP ) );
152  // Domain should have a predicate() returning a Predicate.
153  ConceptUtils::sameType( myPred, myT.predicate() );
154  // Domain should have a begin(Point) method returning an
155  // ConstIterator starting from Point
156  ConceptUtils::sameType( myIt, myT.begin(myP) );
157 
158 
159  }
160 
161  // ------------------------- Private Datas --------------------------------
162  private:
163  T myT;
166  bool myBool;
169  // ------------------------- Internals ------------------------------------
170  private:
171 
172  }; // end of concept CDomain
173 
174 } // namespace DGtal
175 
176 // //
178 
179 #endif // !defined CDomain_h
180 
181 #undef CDomain_RECURSES
182 #endif // else defined(CDomain_RECURSES)