$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [BGL] Finding the descriptor for a given vertex
From: Kelvin Chung (kelvSYC_at_[hidden])
Date: 2011-12-29 02:16:26
Suppose I have the following:
template <class T>
class Graph { // Adapter class that I use for my purposes
typedef typename boost::adjacency_list<boost::vecS, boost::vecS,
boost::directedS, T> innerGraph;
typedef typename boost::graph_traits<innerGraph>::vertex_descriptor
VertexDescriptor;
innerGraph G;
public:
void addVertex(const T& vertex);
bool containsVertex(const T& vertex) const;
void addEdge(const T& from, const T& to);
// More stuff here
};
The intent of this adapter class is to basically abstract out all the
mentions of stuff like the descriptors and such. So a good helper
function to this end would be a function that retrieves the
VertexDescriptor for a given T, if it exists. Is there such a function
already in the BGL, or do I have to manage that separately (ie. having
an external map)?