DGtal  0.9.2
CConstSinglePassRangeFromPoint.h
1 
17 #pragma once
18 
31 #if defined(CConstSinglePassRangeFromPoint_RECURSES)
32 #error Recursive header files inclusion detected in CConstSinglePassRangeFromPoint.h
33 #else // defined(CConstSinglePassRangeFromPoint_RECURSES)
34 
35 #define CConstSinglePassRangeFromPoint_RECURSES
36 
37 #if !defined CConstSinglePassRangeFromPoint_h
38 
39 #define CConstSinglePassRangeFromPoint_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CConstSinglePassRange.h"
47 
48 namespace DGtal
49 {
50 
51  namespace concepts
52  {
53 
55  // class CConstSinglePassRangeFromPoint
85  template <typename T>
87  {
88  // ----------------------- Concept checks ------------------------------
89  public:
90  // 1. define first provided types (i.e. inner types), like
91  typedef typename T::Point Point;
92 
93  // 2. then check the presence of data members, operators and methods with
95  {
97  }
98  void checkConstConstraints() const
99  {
100  // const method dummyConst should take parameter myA of type A and return
101  // something of type B
102  ConceptUtils::sameType( myB, myX.begin( myPoint ) );
103  }
104  // ------------------------- Private Datas --------------------------------
105  private:
106  T myX; // do not require T to be default constructible.
107  Point myPoint;
108  ConstIterartor myB;
109 
110  // ------------------------- Internals ------------------------------------
111  private:
112 
113  }; // end of concept CConstSinglePassRangeFromPoint
114 
115  } // namespace concepts
116 
117 } // namespace DGtal
118 
119 // //
121 
122 #endif // !defined CConstSinglePassRangeFromPoint_h
123 
124 #undef CConstSinglePassRangeFromPoint_RECURSES
125 #endif // else defined(CConstSinglePassRangeFromPoint_RECURSES)
Aim: Defines the concept describing a const single pass range.
void sameType(const T &t1, const T &t2)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: refined concept of const single pass range with a begin() method from a point.