Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization, archive] Serialize boost::shared_ptr to custom archive
From: Francois Mauger (mauger_at_[hidden])
Date: 2013-03-14 18:45:43


>>> Le 10/03/2013 17:56, Robert Ramey a écrit :
>
> I can explain this.
>
> shared_ptr does not fullfil the type requirements for a serializable object.
> That is, it doesn't model the serializable concept. So I had to include
> special archive code to permit serialization of shared_ptr. This is
> the only place in the library where there is a coupling between archive
> classes and any object type to be serialized.
>
> The real fix is to modify the serialization library to include the facility
> built for shared_ptr in a generic manner. This is doable but would
> require some work. It would also require expansion of the documentation
> and "serializable" concept. And of course tests etc. It's not a huge
> project, but it's not trivial either. And sooner or later it's going to be
> necessary to accomodate std::shared_ptr.
>
> Robert Ramey
>

Hi Robert, all

Hmm, a question related to Robert's comment...

In my group, we use boost::shared_ptr<> instances to implement smart
relationships between various objects of a transcient physics data model
(particle/nuclear decays in a large detector).

The Boost/serialization lib (text + XML + eos::portable v5.0 I/O
archives) is (and will be) used to store/load 10s of TB of experimental
and simulated physics data.

Our experimental project is supposed to last ~10 years and we do need
to ensure backward compatibility for reading the data files we will
accumulate during the experimental data collection and the production of
large samples of monte-carlo data on various academic computing clusters.

My question is:
If, within some upcoming years, the Boost/Serialization migrates to
"fullfil the type requirements for a serializable object"
and, more, if we change boost::shared_ptr object into std::shared_ptr
in our data model, do you think it will be possible to ensure the
backward compatibility for our data storage ? I mean in a way as simple
as using class Boost versioning... or even having a storage format
completely unchanged !

thanks in advance.

regards

frc

-- 
François Mauger
LPC Caen-CNRS/IN2P3-UCBN-ENSICAEN
Département de Physique -- Université de Caen Basse-Normandie

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