Hey alex,
     Thanks a lot for the reply.That worked for me.But can you help me understand the following in your code,

1.Second argument of the constructor,
member_property_map(Map map, Type bundle_type::* member) 
      : m_map(map), m_member(member)
    {}

2.What does the put_get_helper class actually do?

Thanks in advance.

On Tue, Sep 22, 2015 at 5:44 PM, alex <alexhighviz@hotmail.com> wrote:
>Rohith Reddy wrote:
> I have been working on a graph using boost graph library with edge
>properties as bundled properties.I have the following struct as my edge
>property,
>
>typedef struct Edge{
>int id;
>int source;
>int target;
>float cost;
>float reverse_cost;
>} Edge;
>
>    Provided that I am inserting the data correctly,how do I get a property map
>for each of the elements of the struct,that is a property map for id,a property
>map for the source and so on.And moreover I also want to know how to extract
>the type of property map,as it is required to pass its type to other function as a
>template parameter.
>
>Thanks in advance.

I had the same problem and developed a member_property_map to access the member of a bundled map.

It allows the following:

  typedef boost::vector_property_map<edge> bundle_map_type;
  typedef blink::member_property_map<bundle_map_type, float> cost_map_type;

  bundle_map_type bundle_map;
  cost_map_type cost_map(bundle_map, &edge::cost);

See attached for the implementation and example.


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users