Boost logo

Boost Users :

Subject: [Boost-users] BGL property maps
From: Arne Schwabe (arne_at_[hidden])
Date: 2010-05-31 16:09:36


   Hi,

I trying to wrap my head about the usage of
iterator_property_map<RandomAccessIterator, OffsetMap, T, R>

What I am trying to do is the following:

create a map like color with key a graph_node and value type of a struct
like

struct foo {
      int numbervists;
      int color;
}

so I can use that in a breadth first like algorithm. The example shows
me how to do it for an int but do not know how to change

typedef boost::graph_traits<Graph>::edge_descriptor Edge;

   typedef boost::property_map<Graph, boost::id_tag>::type EdgeID_PMap;
    EdgeID_PMap edge_id = get(boost::edge_index(), G);

    boost::iterator_property_map<int*, EdgeID_PMap, int, int&>
capacity_pa(capacity, edge_id), flow_pa(flow, edge_id);

to use foo instead of int. In my understanding, I would have to change
int* to a RandomAccessIterator to to Iterator that has foo as value
type. But I am kind of lost how to construct such a thing.

Arne


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