|
Boost Users : |
Subject: Re: [Boost-users] [serialization] serialize object tree and values
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2014-06-07 11:13:29
On Jun 1, 2014, at 6:38 AM, Daniel Krikun <dkrikun0_at_[hidden]> wrote:
>
> I have an application which creates some objects connected between them using boost::shared_ptr and then executes a main loop. The object graph structure is almost constant over time but primitive member fields of the objects change over time.
> I would like to serialize the whole object graph *each cycle* saving both the object graph structure and primitive member fields.
> Currently I don't know how to achieve this: when I try to serialize via pointer only first value is saved. Also, I'm not sure if I should turn object tracking off, because indeed it should be a single instance of each, it just should be modified over time.
For each re-serialization of the graph, create a new serialization archive, always writing to the same stream. Similarly on read, of course.
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