Boost logo

Boost :

From: Martin Ecker (martin.ecker_at_[hidden])
Date: 2004-05-07 17:34:36


Robert Ramey wrote:

> Francois Fath wrote:
>
> > I have difficulties when serializing two objects pointing to each other.
> > The generated archive is fine (I can see both references in it), but when
> > deserializing, only one is restored. In the attached example, I have a
> > collection of nodes, each one is pointing to the previous and to the next
> > node. When deserializing, only the ->next references are restored, all the
> > ->previous are NULL.
>
> Hmmm - I would have expect to get a "pointer_conflict" exception when the
> archive is being created - see test_cyclic_ptrs.

Hm, this is unfortunate. MFC's serialization mechanism (via CArchive)
supports these kinds of cyclic pointer relationships. I believe,
it should be possible to extend boost::serialization to support this
as well, especially since the written out archives seem to contain
all that is needed to reconstruct the data structure upon deserialization.
See my previous mail on this subject on what I think needs to be
addressed to achieve this. Am I missing something here or are
there other complications that maybe MFC's CArchive cannot deal
with or simply disregards with respect to cyclic pointer structures?

Best Regards,
Martin Ecker


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk