DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CVertexMap.h
1 
17 #pragma once
18 
32 #if defined(CVertexMap_RECURSES)
33 #error Recursive header files inclusion detected in CVertexMap.h
34 #else // defined(CVertexMap_RECURSES)
35 
36 #define CVertexMap_RECURSES
37 
38 #if !defined CVertexMap_h
39 
40 #define CVertexMap_h
41 
43 // Inclusions
44 #include <iostream>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/CPredicate.h"
47 #include "boost/concept_check.hpp"
49 
50 namespace DGtal
51 {
52 
54  // class CVertexMap
99  template <typename T>
100  struct CVertexMap:
101  boost::Assignable<T>
102  {
103  // ----------------------- Concept checks ------------------------------
104  public:
105  // 1. define first provided types (i.e. inner types), like
106  typedef typename T::Vertex Vertex;
107  typedef typename T::Value Value;
108 
109  // 2. then check the presence of data members, operators and methods with
111  {
112  ConceptUtils::sameType( myValue, myX.operator()(myVertex) );
113  myX.setValue(myVertex, myValue);
114  }
115 
116  // ------------------------- Private Datas --------------------------------
117  private:
118  T myX;
121 
122  }; // end of concept CVertexMap
123 
124 } // namespace DGtal
125 
126 // //
128 
129 #endif // !defined CVertexMap_h
130 
131 #undef CVertexMap_RECURSES
132 #endif // else defined(CVertexMap_RECURSES)