Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/example/graph_property.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 870 bytes
Line 
1//  (C) Copyright Jeremy Siek 2004
2//  Distributed under the Boost Software License, Version 1.0. (See
3//  accompanying file LICENSE_1_0.txt or copy at
4//  http://www.boost.org/LICENSE_1_0.txt)
5
6#include <string>
7#include <iostream>
8#include <boost/cstdlib.hpp>
9#include <boost/graph/adjacency_list.hpp>
10#include <boost/graph/subgraph.hpp>
11
12int
13main()
14{
15  using namespace boost;
16  using std::string;
17
18  typedef adjacency_list<vecS, vecS, directedS,no_property, 
19    property<edge_index_t, int>,
20    property<graph_name_t, string> > graph_t;
21
22  graph_t g;
23  get_property(g, graph_name) = "graph";
24
25  std::cout << "name: " << get_property(g, graph_name) << std::endl;
26
27  typedef subgraph<graph_t> subgraph_t;
28
29  subgraph_t sg;
30  get_property(sg, graph_name) = "subgraph";
31
32  std::cout << "name: " << get_property(sg, graph_name) << std::endl;
33 
34  return exit_success;
35}
Note: See TracBrowser for help on using the repository browser.