DGtal  1.1.0
CGraphVisitor.h
1 
17 #pragma once
18 
31 #if defined(CGraphVisitor_RECURSES)
32 #error Recursive header files inclusion detected in CGraphVisitor.h
33 #else // defined(CGraphVisitor_RECURSES)
34 
35 #define CGraphVisitor_RECURSES
36 
37 #if !defined CGraphVisitor_h
38 
39 #define CGraphVisitor_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "boost/tuple/tuple.hpp"
45 #include "DGtal/base/Common.h"
46 #include "DGtal/graph/CVertexPredicate.h"
47 #include "DGtal/graph/CVertexPredicateArchetype.h"
48 #include "DGtal/graph/CUndirectedSimpleLocalGraph.h"
50 
51 // @since 0.8 In DGtal::concepts
52 namespace DGtal {
53  namespace concepts {
54 
56 // class CGraphVisitor
109 template <typename T>
111 {
112  // ----------------------- Concept checks ------------------------------
113 public:
114  // 1. define first provided types (i.e. inner types), like
115  typedef typename T::Graph Graph;
116  typedef typename T::Vertex Vertex;
117  typedef typename T::Size Size;
118  typedef typename T::Data Data;
119  typedef typename T::MarkSet MarkSet;
120  typedef typename T::Node Node;
122 
132  BOOST_STATIC_ASSERT(( boost::is_convertible<Node, std::pair<Vertex,Data> >::value ));
133 
134  // To test if two types A and Y are equals, use
135  // 2. then check the presence of data members, operators and methods with
137  {
138  // check non-const methods.
139  myX.expand();
140  myX.expand( myVPred );
141  myX.ignore();
142  myX.terminate();
143  // check const methods.
145  }
147  {
148  ConceptUtils::sameType( myGraph, myX.graph() );
149  ConceptUtils::sameType( myNode, myX.current() );
150  ConceptUtils::sameType( myBool, myX.finished() );
151  ConceptUtils::sameType( myMarkSet, myX.markedVertices() );
152  ConceptUtils::sameType( myMarkSet, myX.visitedVertices() );
153  }
154  // ------------------------- Private Datas --------------------------------
155 private:
156  T myX; // do not require T to be default constructible.
159  bool myBool;
162 
163 }; // end of concept CGraphVisitor
164 
165 } // namespace concepts
166 } // namespace DGtal
167 
168 // //
170 
171 #endif // !defined CGraphVisitor_h
172 
173 #undef CGraphVisitor_RECURSES
174 #endif // else defined(CGraphVisitor_RECURSES)
boost::DefaultConstructible
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition: Boost.dox:30
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::CopyConstructible< Data >))
boost::UniqueAssociativeContainer
Go to http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html.
Definition: Boost.dox:140
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::Assignable< Data >))
DGtal::concepts::CGraphVisitor::Data
T::Data Data
Definition: CGraphVisitor.h:118
DGtal::concepts::CGraphVisitor::Vertex
T::Vertex Vertex
Definition: CGraphVisitor.h:116
DGtal::concepts::CGraphVisitor::Size
T::Size Size
Definition: CGraphVisitor.h:117
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::UniqueAssociativeContainer< MarkSet >))
DGtal::concepts::CGraphVisitor::myMarkSet
MarkSet myMarkSet
Definition: CGraphVisitor.h:161
DGtal::concepts::CGraphVisitor
Aim: Defines the concept of a visitor onto a graph, that is an object that traverses vertices of the ...
Definition: CGraphVisitor.h:111
Vertex
TriMesh::Vertex Vertex
Definition: testTriangulatedSurface.cpp:57
Size
HalfEdgeDataStructure::Size Size
Definition: testHalfEdgeDataStructure.cpp:50
DGtal::concepts::CGraphVisitor::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((ConceptUtils::SameType< Vertex, typename MarkSet::key_type >::value))
DGtal::concepts::CGraphVisitor::VertexPredicate
CVertexPredicateArchetype< Vertex > VertexPredicate
Definition: CGraphVisitor.h:121
DGtal::concepts::CUndirectedSimpleLocalGraph
Aim: Represents the concept of local graph: each vertex has neighboring vertices, but we do not neces...
Definition: CUndirectedSimpleLocalGraph.h:101
DGtal::concepts::CGraphVisitor::myBool
bool myBool
Definition: CGraphVisitor.h:159
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::concepts::CGraphVisitor::myGraph
Graph myGraph
Definition: CGraphVisitor.h:157
DGtal::concepts::CGraphVisitor::Node
T::Node Node
Definition: CGraphVisitor.h:120
DGtal::concepts::CGraphVisitor::MarkSet
T::MarkSet MarkSet
Definition: CGraphVisitor.h:119
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CUndirectedSimpleLocalGraph< Graph >))
DGtal::concepts::CVertexPredicateArchetype< Vertex >
boost::CopyConstructible
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
DGtal::concepts::CGraphVisitor::myX
T myX
Definition: CGraphVisitor.h:156
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal::concepts::CGraphVisitor::checkConstConstraints
void checkConstConstraints() const
Definition: CGraphVisitor.h:146
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CGraphVisitor)
Definition: CGraphVisitor.h:136
DGtal::concepts::CGraphVisitor::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((boost::is_convertible< Node, std::pair< Vertex, Data > >::value))
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::SimpleAssociativeContainer< MarkSet >))
DGtal::concepts::ConceptUtils::SameType
Definition: ConceptUtils.h:107
DGtal::concepts::CGraphVisitor::myNode
Node myNode
Definition: CGraphVisitor.h:158
DGtal::concepts::CGraphVisitor::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((ConceptUtils::SameType< Size, typename Graph::Size >::value))
boost::SimpleAssociativeContainer
Go to http://www.sgi.com/tech/stl/SimpleAssociativeContainer.html.
Definition: Boost.dox:146
DGtal::concepts::CGraphVisitor::Graph
T::Graph Graph
Definition: CGraphVisitor.h:115
DGtal::concepts::CGraphVisitor::myVPred
VertexPredicate myVPred
Definition: CGraphVisitor.h:160
DGtal::concepts::CGraphVisitor::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((ConceptUtils::SameType< Vertex, typename Graph::Vertex >::value))
boost::Assignable
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition: Boost.dox:32
DGtal::concepts::CGraphVisitor::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::DefaultConstructible< Data >))