c++ - Debug Boost.Serialization Address Tracking -
c++ - Debug Boost.Serialization Address Tracking -
roughly speaking, have object o
, pointer object po = &o
, serialize this:
// somewhere ar & o; // somewhere else, after somewhere ar & po;
when serializing po
, boost.serialization should find has serialized o
, not serialize *po
again. have situation library fails @ discovering situation , instead serializes o
twice.
unfortunately, attempts @ reproducing behaviour in simple illustration failed, , original code way big posted here. instead of solution problem, inquire pointer relevant code section in boost.serialization tracks addresses , determines whether pointer needs "deeply" serialized or not. hope can debugging myself.
of course, best guesses error might welcome, don't want strain crystal balls much. ;-)
btw, utilize boost::archive::text_oarchive
if relevant.
the code section in question save_pointer()
function in basic_oarchive.
boost.serialization uses 2 characteristics check whether object has been serialized: object address , object type. address part obvious, , if think type part makes sense. problem did not think , checked 2 addresses in question same. indeed held true, since types different, serialization library assumed 2 different objects.
c++ serialization boost boost-serialization
Comments
Post a Comment