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 <boost/concept/assert.hpp>
14#include <string>
15
16int main(int, char*[])
17{
18 using namespace boost;
19 // Check const reverse_graph
20 {
21 typedef adjacency_list< vecS, vecS, bidirectionalS,
22 property< vertex_color_t, int >, property< edge_weight_t, int >,
23 property< graph_name_t, std::string > >
24 AdjList;
25 typedef reverse_graph< AdjList > Graph;
26 BOOST_CONCEPT_ASSERT((VertexListGraphConcept< Graph >));
27 BOOST_CONCEPT_ASSERT((BidirectionalGraphConcept< Graph >));
28 typedef graph_traits< Graph >::vertex_descriptor Vertex;
29 typedef graph_traits< Graph >::edge_descriptor Edge;
30 BOOST_CONCEPT_ASSERT(
31 (ReadablePropertyGraphConcept< Graph, Vertex, vertex_color_t >));
32 BOOST_CONCEPT_ASSERT(
33 (ReadablePropertyGraphConcept< Graph, Edge, edge_weight_t >));
34 BOOST_CONCEPT_ASSERT(
35 (ReadablePropertyGraphConcept< Graph, Edge, edge_underlying_t >));
36 AdjList g;
37 Graph gr(g);
38 get_property(g&: gr, graph_name_t());
39 }
40 // Check non-const reverse_graph
41 {
42 typedef adjacency_list< vecS, vecS, bidirectionalS,
43 property< vertex_color_t, int >, property< edge_weight_t, int >,
44 property< graph_name_t, std::string > >
45 AdjList;
46 typedef reverse_graph< AdjList, AdjList& > Graph;
47 BOOST_CONCEPT_ASSERT((VertexListGraphConcept< Graph >));
48 BOOST_CONCEPT_ASSERT((BidirectionalGraphConcept< Graph >));
49 typedef graph_traits< Graph >::vertex_descriptor Vertex;
50 typedef graph_traits< Graph >::edge_descriptor Edge;
51 BOOST_CONCEPT_ASSERT(
52 (PropertyGraphConcept< Graph, Vertex, vertex_color_t >));
53 BOOST_CONCEPT_ASSERT(
54 (PropertyGraphConcept< Graph, Edge, edge_weight_t >));
55 BOOST_CONCEPT_ASSERT(
56 (ReadablePropertyGraphConcept< Graph, Edge, edge_underlying_t >));
57 AdjList g;
58 Graph gr(g);
59 get_property(g&: gr, graph_name_t());
60 set_property(g: gr, tag: graph_name_t(), value: "foo");
61 }
62 return 0;
63}
64

source code of boost/libs/graph/test/reverse_graph_cc.cpp