|
Boost Users : |
Subject: Re: [Boost-users] [BGL] Serializing a filtered_graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-11-16 11:50:12
On Tue, 16 Nov 2010, Cedric Laczny wrote:
> Hi,
>
> I was wondering if there is a way to serialize filtered_graphs?
>
> My first attempts fail because keep_all seems not to be serializable:
> /usr/include/boost/serialization/access.hpp:109: error: âstruct
> boost::keep_allâ has no member named âserializeâ
>
> I have no problems serializing even custom adjacency_lists using the same
> approach.
Could you please try adding serialization code to the keep_all structure?
It should be easy since IIRC it does not have any members.
> Besides discussing if it actually makes sense to serialize a filtered_graph, I
> am interested in suggestions on how to achieve it (if it is indeed possible).
What about the graph do you want to keep? In my view (and probably what
actually happens), serializing a filtered_graph means serializing all of
the input graph (even with vertices and edges that are hidden by the
filter) and then serializing the filter function. That may not be what
you want, though: you might actually want to serialize the graph after
filtering, and thus read the data back into a normal, non-filtered graph.
Right now, that second option would require copying the filtered_graph
into a normal graph type then serializing that; deserialization would be
directly into the normal graph type. It would be possible to avoid the
copy, though, if that was important.
-- Jeremiah Willcock
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