DGtal 1.3.0
Loading...
Searching...
No Matches
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)
35#define CUndirectedSimpleLocalGraph_RECURSES
36
37#if !defined CUndirectedSimpleLocalGraph_h
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
53namespace 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.
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)
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
BOOST_CONCEPT_ASSERT((CVertexMap< VertexMap< Value > >))
Aim: Represents the concept of local graph: each vertex has neighboring vertices, but we do not neces...
BOOST_CONCEPT_ASSERT((boost::CopyConstructible< Vertex >))
BOOST_CONCEPT_ASSERT((boost::DefaultConstructible< Vertex >))
BOOST_CONCEPT_ASSERT((boost::Assignable< Vertex >))
BOOST_CONCEPT_ASSERT((CIntegralNumber< Size >))
boost::output_iterator_archetype< Vertex > myOutIt
Aim: models of CVertexMap concept implement mapping between graph vertices and values.
Definition: CVertexMap.h:98
Aim: Defines a an archetype for concept CVertexPredicate.
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition: Boost.dox:30