|
Boost : |
From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-09-05 09:49:44
Hello,
Boost.Serialization 1.33-1.34 introduces the notion or "helpers" to the
Archive
interface by means of the member functions:
void lookup_helper(
const extended_type_info* const eti,
shared_ptr<void>& sph);
void insert_helper(
const extended_type_info* const eti,
shared_ptr<void>& sph);
which allow the user to make an archive instance store arbitrary helper
objects
associated to any given type. This helper interface is used to implement
serialization of boost::shared_ptr in a non-intrusive way, which was
impossible
for former versions of Boost.Serialization. This is a wonderful addition
to the library because not only solves the old problem with
serializating
shared_ptr but also serves as a general utility for implementing
complicated
serialization schemes, notably those in which internal resources are
serialized
which cannot be directly manipulated from the class public interface.
I have used archive helpers to good effect in implementing an otherwise
unfeasible serialization algorithm for a library I'm writing, but when I
moved
from Boost 1.34 to the SVN trunk I discovered to my dismay that this
(admittedly undocumented) feature has been removed in favor of an ad-hoc
extension of the Archive interface (internally based on something
resembling
the former helper code) to specifically allow serialization of
boost::shared_ptr.
IMHO this is a step back because it singles out shared_ptr as a type
receiving special attention (vg. what will happen with
std::tr1::shared_ptr,
will the interface be augmented again to cope with this?) and primarily
because it deprives us developers from a very very powerful tool.
Could the helper interface please please be brought back to
Boost.Serialization? Thank you,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk