Boost logo

Boost Users :

Subject: Re: [Boost-users] Serializing the same Objekt several times
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-10-21 12:48:08


Fabian Weiss wrote:
> At the moment I am working with XML serialization of Boost. I am
> serializing my own classes which works well. But my objects are
> changing often, for example:
>
> class Modul
> {
> public: setValue(int);
> private: int Value;
> }
>
> Modul* M = new Modul();
>
> Now I wanna serialize M every time Value changes, so that I can save a
> complete history of changes on M. But M is serialized only once, after
> that I get this in my XML, although Value has changed:
>
> <Modul class_id_reference="1" object_id_reference="_2"></Modul>
>
> This is unusable for my purpose, so how can I stop that kind of
> "linking" and serialize the Objekt every time completely?

look at serialization traits - tracking. This lets you suppress
object tracking on a per/class basis.

Robert Ramey


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