DGtal  0.9.2
CUndirectedSimpleLocalGraph.h
1 
17 #pragma once
18 
31 #if defined(CUndirectedSimpleLocalGraph_RECURSES)
32 #error Recursive header files inclusion detected in CUndirectedSimpleLocalGraph.h
33 #else // defined(CUndirectedSimpleLocalGraph_RECURSES)
34 
35 #define CUndirectedSimpleLocalGraph_RECURSES
36 
37 #if !defined CUndirectedSimpleLocalGraph_h
38 
39 #define CUndirectedSimpleLocalGraph_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <boost/concept_archetype.hpp>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/kernel/CInteger.h"
47 #include "DGtal/graph/CVertexMap.h"
48 #include "DGtal/graph/CVertexPredicate.h"
49 #include "DGtal/graph/CVertexPredicateArchetype.h"
51 
52 // @since 0.8 In DGtal::concepts
53 namespace DGtal {
54  namespace concepts {
55 
57  // class CUndirectedSimpleLocalGraph
99  template <typename T>
101  {
102  // ----------------------- Concept checks ------------------------------
103  public:
104  // 1. define first provided types (i.e. inner types), like
105  typedef typename T::Vertex Vertex;
106  typedef typename T::Size Size;
107  typedef typename T::VertexSet VertexSet;
108  template <typename Value> struct VertexMap {
109  typedef typename T::template VertexMap<Value>::Type Type;
111  };
112 
113  // possibly check these types so as to satisfy a concept with
118 
119  // 2. then check the presence of data members, operators and methods with
121  {
122  // check const methods.
124  }
126  {
127  ConceptUtils::sameType( mySize, myX.bestCapacity() );
129  myX.writeNeighbors( myOutIt, myVertex );
130  myX.writeNeighbors( myOutIt, myVertex, myVPred );
131  }
132 
133  // ------------------------- Private Datas --------------------------------
134  private:
135  T myX; // do not require T to be default constructible.
136  Size mySize;
137  Vertex myVertex;
138  mutable boost::output_iterator_archetype<Vertex> myOutIt;
140  // ------------------------- Internals ------------------------------------
141  private:
142 
143  }; // end of concept CUndirectedSimpleLocalGraph
144 
145  } // namespace concepts
146 } // namespace DGtal
147 
148 // //
150 
151 #endif // !defined CUndirectedSimpleLocalGraph_h
152 
153 #undef CUndirectedSimpleLocalGraph_RECURSES
154 #endif // else defined(CUndirectedSimpleLocalGraph_RECURSES)
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition: Boost.dox:30
void sameType(const T &t1, const T &t2)
boost::output_iterator_archetype< Vertex > myOutIt
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Aim: Represents the concept of local graph: each vertex has neighboring vertices, but we do not neces...
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
DGtal is the top-level namespace which contains all DGtal functions and types.
BOOST_CONCEPT_ASSERT((CVertexMap< VertexMap< Value > >))
BOOST_CONCEPT_ASSERT((CIntegralNumber< Size >))
Aim: models of CVertexMap concept implement mapping between graph vertices and values.
Definition: CVertexMap.h:96