1 | //======================================================================= |
---|
2 | // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. |
---|
3 | // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek |
---|
4 | // |
---|
5 | // Distributed under the Boost Software License, Version 1.0. (See |
---|
6 | // accompanying file LICENSE_1_0.txt or copy at |
---|
7 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | //======================================================================= |
---|
9 | #include <boost/graph/graph_concepts.hpp> |
---|
10 | #include <boost/graph/graph_archetypes.hpp> |
---|
11 | #include <boost/graph/adjacency_list.hpp> |
---|
12 | #include <boost/graph/reverse_graph.hpp> |
---|
13 | #include <string> |
---|
14 | |
---|
15 | int main(int,char*[]) |
---|
16 | { |
---|
17 | using namespace boost; |
---|
18 | // Check const reverse_graph |
---|
19 | { |
---|
20 | typedef adjacency_list< vecS, vecS, bidirectionalS, |
---|
21 | property<vertex_color_t, int>, |
---|
22 | property<edge_weight_t, int>, |
---|
23 | property<graph_name_t, std::string> |
---|
24 | > AdjList; |
---|
25 | typedef reverse_graph<AdjList> Graph; |
---|
26 | function_requires< VertexListGraphConcept<Graph> >(); |
---|
27 | typedef graph_traits<Graph>::vertex_descriptor Vertex; |
---|
28 | typedef graph_traits<Graph>::edge_descriptor Edge; |
---|
29 | function_requires< ReadablePropertyGraphConcept<Graph, Vertex, vertex_color_t> >(); |
---|
30 | function_requires< ReadablePropertyGraphConcept<Graph, Edge, edge_weight_t> >(); |
---|
31 | AdjList g; |
---|
32 | Graph gr(g); |
---|
33 | get_property(gr, graph_name_t()); |
---|
34 | } |
---|
35 | // Check non-const reverse_graph |
---|
36 | { |
---|
37 | typedef adjacency_list< vecS, vecS, bidirectionalS, |
---|
38 | property<vertex_color_t, int>, |
---|
39 | property<edge_weight_t, int>, |
---|
40 | property<graph_name_t, std::string> |
---|
41 | > AdjList; |
---|
42 | typedef reverse_graph<AdjList,AdjList&> Graph; |
---|
43 | function_requires< VertexListGraphConcept<Graph> >(); |
---|
44 | typedef graph_traits<Graph>::vertex_descriptor Vertex; |
---|
45 | typedef graph_traits<Graph>::edge_descriptor Edge; |
---|
46 | function_requires< PropertyGraphConcept<Graph, Vertex, vertex_color_t> >(); |
---|
47 | function_requires< PropertyGraphConcept<Graph, Edge, edge_weight_t> >(); |
---|
48 | AdjList g; |
---|
49 | Graph gr(g); |
---|
50 | get_property(gr, graph_name_t()); |
---|
51 | set_property(gr, graph_name_t(), "foo"); |
---|
52 | } |
---|
53 | return 0; |
---|
54 | } |
---|