]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/test/reverse_graph_cc.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / graph / test / reverse_graph_cc.cpp
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
16 int 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>,
23 property<edge_weight_t, int>,
24 property<graph_name_t, std::string>
25 > AdjList;
26 typedef reverse_graph<AdjList> Graph;
27 BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
28 BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept<Graph> ));
29 typedef graph_traits<Graph>::vertex_descriptor Vertex;
30 typedef graph_traits<Graph>::edge_descriptor Edge;
31 BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph, Vertex, vertex_color_t> ));
32 BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph, Edge, edge_weight_t> ));
33 BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph, Edge, edge_underlying_t> ));
34 AdjList g;
35 Graph gr(g);
36 get_property(gr, graph_name_t());
37 }
38 // Check non-const reverse_graph
39 {
40 typedef adjacency_list< vecS, vecS, bidirectionalS,
41 property<vertex_color_t, int>,
42 property<edge_weight_t, int>,
43 property<graph_name_t, std::string>
44 > AdjList;
45 typedef reverse_graph<AdjList,AdjList&> Graph;
46 BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
47 BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept<Graph> ));
48 typedef graph_traits<Graph>::vertex_descriptor Vertex;
49 typedef graph_traits<Graph>::edge_descriptor Edge;
50 BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Vertex, vertex_color_t> ));
51 BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Edge, edge_weight_t> ));
52 BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph, Edge, edge_underlying_t> ));
53 AdjList g;
54 Graph gr(g);
55 get_property(gr, graph_name_t());
56 set_property(gr, graph_name_t(), "foo");
57 }
58 return 0;
59 }