Serializing the same Objekt several times
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?
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
participants (2)
-
Fabian Weiss
-
Robert Ramey