|
Boost Users : |
Subject: [Boost-users] [graph] Getting bundled-properties types
From: Juan Antonio Farré Basurte (jafb_at_[hidden])
Date: 2009-03-14 20:29:24
Hello,
I'm working in a graph algorithm that works on graphs that implement
BidirectionalGraphConcept and
VertexAndEdgeListGraphConcept.
The only additional requirement is that they must have some concrete bundled properties
(I don't want to
deal with the, I understand old, method of defining properties).
For example, if g is a graph and v is a valid vertex descriptor of that
graph,
g[v].min
must be a valid boolean expression.
I have defined template classes for those bundled properties, but I
wish not to impose using those concrete classes.
To do so, I never get g[v] in a variable to later access the properties. For example, I always
write
g[v].min
instead of something like
BundledVertexPropertyType &p=g[v];
p.min
Ok, for the
moment.
The problem is that, at some point of my algorithm (concretely when wanting to invoke the topological_sort
BGL algorithm) I must
have knowledge of what's the concrete type of the bundled properties
(i.e., I need to know that BundledVertexPropertyType written before).
I can't find in BGL documentation a way to do that. I look, for example, for something like, imagine,
graph_traits<Graph>::bundled_vertex_properties_type
Is there a documented way to achieve that?
If not, is there any way how
I can get a property map to provide access to a bundled property without knowing the bundled-property type?
Right now I'm using an expression
like the following one:
get(&BundledVertexPropertyType::index,g)
But this obviously requires knowing the
BundledVertexPropertyType when writing the code. Is there any way to avoid it?
Thanks a lot,
Juan
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net