andres::graph
visitor.hxx
1 #pragma once
2 #ifndef ANDRES_GRAPH_VISITOR_HXX
3 #define ANDRES_GRAPH_VISITOR_HXX
4 
5 #include <cstddef>
6 #include <iostream>
7 
8 namespace andres {
9 namespace graph {
10 
15 template<class S = std::size_t>
17  typedef S size_type;
18 
20  void insertVertex(const size_type a) const {}
21  void insertVertices(const size_type a, const size_type n) const {}
22  void eraseVertex(const size_type a) const {}
23  void relabelVertex(const size_type a, const size_type b) const {}
24  void insertEdge(const size_type a) const {}
25  void eraseEdge(const size_type a) const {}
26  void relabelEdge(const size_type a, const size_type b) const {}
27 };
28 
33 template<class S = std::size_t>
35  typedef S size_type;
36 
38  void insertVertex(const size_type a) const
39  { std::cout << "inserting vertex " << a << std::endl; }
40  void insertVertices(const size_type a, const size_type n) const
41  { std::cout << "inserting " << n << " vertices, starting from index " << a << std::endl; }
42  void eraseVertex(const size_type a) const
43  { std::cout << "removing vertex " << a << std::endl; }
44  void relabelVertex(const size_type a, const size_type b) const
45  { std::cout << "relabeling vertex " << a << ". new label is " << b << std::endl; }
46  void insertEdge(const size_type a) const
47  { std::cout << "inserting edge " << a << std::endl; }
48  void eraseEdge(const size_type a) const
49  { std::cout << "removing edge " << a << std::endl; }
50  void relabelEdge(const size_type a, const size_type b) const
51  { std::cout << "relabeling edge " << a << ". new label is " << b << std::endl; }
52 };
53 
54 } // namespace graph
55 } // namespace andres
56 
57 #endif // #ifndef ANDRES_GRAPH_VISITOR_HXX