Partial serialization of a program

Markus Lavin via Boost-users <[email protected]>
Newsgroups gmane.comp.lib.boost.user
Message-ID <[email protected]>
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 mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.