Boost logo

Boost Users :

Subject: Re: [Boost-users] serialization, tracking objects [was: serialization of recursive objects]
From: Frank Birbacher (bloodymir.crap_at_[hidden])
Date: 2012-11-29 11:57:11


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Am 27.11.12 11:13, schrieb kean:
> //serialize MyRecursiveObject and the vector of pointers { ofstream
> ofs("filename"); boost::archive::text_oarchive oa(ofs); oa <<
> rec_object; oa << elt_ptrs; }

The point here is object tracking: serializing a pointer will invoke
object tracking, but your pointer points to an object that has already
been serialized without tracking. You will need to put the following
into your code:

BOOST_CLASS_TRACKING(
  MyElementObject, boost::serialization::track_always)

Docs are at
http://www.boost.org/doc/libs/1_51_0/libs/serialization/doc/traits.html#tracking

Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: keyserver x-hkp://pool.sks-keyservers.net

iEYEARECAAYFAlC3k+cACgkQhAOUmAZhnmr1twCfcfdDVX9LQENB2gQO3E1MLk/V
7/oAnRdJYQm0q0xOtFXZ7vXVkqLLA+HT
=GdiJ
-----END PGP SIGNATURE-----


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