
Hajo Kirchhoff wrote:
My idea is to require all objects be derived from a common polymorphic base and then serialize a pointer to the object. The archive would serialize the entire object and also send type information with it, so the receiver could reconstruct the object simply by receiving a pointer.
all this automatically done by the library. There is no need to derive from a common base class.
For this in order to work I would need to disable tracking for 'my_command'. Otherwise only the very first instance of archive << &dosomething would actually send something.
You can easily disable tracking on a type by type basis.
Question: Can I 'reset' the binary archive such that the tracking information is reset, but not the type information? Or can I temporarily disable tracking for a class or for the next save/load operation?
why not just disable tracking for the types you want to resend?
I don't want to globally disable tracking for my_command, because I cannot rule out that someone might actually want tracking for their object in a different archive (such as saving settings to disk).
currently one can't have it both ways. The issue of disabling tracking has recently been raised. Perhaps you want to make a TRAK item requesting this feature. Robert Ramey
I'd love to hear from you and any comments are welcome. Has anyone already done this? What are your experiences?
Regards
Hajo