Boost logo

Boost Users :

From: Markus Lavin (markus.lavin_at_[hidden])
Date: 2022-11-03 07:40:13


I have a simulator type program where I want to be able to save (and load) the current simulation state using Boost serialization.

The program, as with most programs, consists of a part that is static during run-time and a part that is dynamic.

Ideally I would like to serialize only the dynamic part but this however raises the following problem.

If a serialized object in the dynamic part contains a pointer to a non-seralized object in the static part then how do I deal with that. Clearly the address cannot be serialized since it may change between builds and even between runs (ASLR). The program does contain a 'registry' though where all relevant static objects are registered with a unique identifier.

So question is would it somehow be possible to have Boost serialization use this registry to serialize the unique identifier instead of trying to serialize the entire object when one of those pointers are serialized?

As far as I can tell the documentation does not mention this situation and extensive web searching yields very little as well.

Any advice appreciated!

-Markus



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