On Aug 31, 2004, at 1:13 PM, Jeffrey Holle wrote:
// Graph Data accessor methods typedef boost::property_map
::type VertexData; typedef boost::property_map ::type EdgeData; const VertexData& getVertexData(void) const {return vertexData_;} ...
FWIW, this type of thing will get easier in 1.32.0 because we'll actually support dropping user-defined classes into adjacency_list, adjacency_matrix, etc. for vertex and edge properties; but this is the currently the best solution.
I guess my biggest concern is initializing vertexData_ once, before the graph has any data, and keeping it around though the life of the graph. Is this safe?
It's safe.
Also, I expect clients of this class to be able to use the operator[] method via getVertexData(). Will this work?
Yes, to an extent. The only issue is that const/non-const access to
properties won't be correct, because the types of property_map