Boost logo

Boost :

From: Lie-Quan Lee (llee1_at_[hidden])
Date: 2001-04-03 17:27:22


At Tue, 3 Apr 2001 15:30:49 -0500 (CDT),
Kevin S. Van Horn wrote:
>
> Although the documentation for adjacency_list shows the last template
> parameter for the adjacency_list template to be "GraphProperties",
> described as "specifying property_storage for the graph object", there
> is no further documentation on the subject and no examples. In
> particular, how do I read and write a graph property (as opposed to an
> edge or vertex property)?

Here is an example excerpt to use graph properties and access it.

enum my_graph_name_t { my_graph_name = 3333 };

typedef property<my_graph_name_t, std::string> GP;
typedef adjacency_list<boost::vecS, boost::vecS, boost::directedS,
                       no_plugin, no_plugin, GP> Graph_With_GraphProperty;

//....

template <class Graph>
void foo(Graph& g) {
 typedef typename graph_property<Graph, my_graph_name_t>::type NameType;
 NameType& g_name = get_property(g, graph_name);
 //...
}

--
Lie-Quan Lee

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk