[BGL, Serialization] Serialization of vertex|edege properties

Hi folks, I am using the BGL and now I want to serialize the graph. Serialization of the vertices and edges works fine, but how do I serialize the vertex|edge properties? My properties and graph definition are the following: <code> struct vertex_cId_t { typedef vertex_property_tag kind; }; struct vertex_cType_t { typedef vertex_property_tag kind; }; struct vertex_cShape_t { typedef vertex_property_tag kind; }; struct edge_cType_t { typedef vertex_property_tag kind; }; struct edge_cColor_t { typedef vertex_property_tag kind; }; namespace boost { BOOST_INSTALL_PROPERTY(vertex, cId); BOOST_INSTALL_PROPERTY(vertex, cType); BOOST_INSTALL_PROPERTY(vertex, cShape); BOOST_INSTALL_PROPERTY(edge, cType); BOOST_INSTALL_PROPERTY(edge, cColor); } typedef property<vertex_cId_t, std::string> CVertexId; typedef property<vertex_cShape_t, std::string, CVertexId> CVertexShape; typedef property<vertex_cType_t, int, CVertexShape> CVertexAttribute; typedef property<edge_cColor_t, string> CEdgeColor; typedef property<edge_cType_t, int, CEdgeColor> CEdgeAttribute; typedef adjacency_list<vecS, vecS, undirectedS, CVertexAttribute, CEdgeAttribute> Graph; </code> How must the serialize functions for CVertexAttribute and CEdgeAttribute look like? Thanks in advance. David

Hi David, On Oct 15, 2007, at 9:22 AM, David Angelo wrote:
I am using the BGL and now I want to serialize the graph. Serialization of the vertices and edges works fine, but how do I serialize the vertex|edge properties? [snip] typedef property<vertex_cId_t, std::string> CVertexId; typedef property<vertex_cShape_t, std::string, CVertexId> CVertexShape; typedef property<vertex_cType_t, int, CVertexShape> CVertexAttribute;
typedef property<edge_cColor_t, string> CEdgeColor; typedef property<edge_cType_t, int, CEdgeColor> CEdgeAttribute;
typedef adjacency_list<vecS, vecS, undirectedS, CVertexAttribute, CEdgeAttribute> Graph; </code>
How must the serialize functions for CVertexAttribute and CEdgeAttribute look like?
The serialization code for property<...> types is in boost/pending/ property_serialize.hpp, which is already included by the BGL serialization code for adjacency lists. Are you running into some kind of compilation error? - Doug
participants (2)
-
David Angelo
-
Doug Gregor