
----- Mensaje original ----- De: Rene Rivera <grafikrobot@gmail.com> Fecha: Sábado, Mayo 5, 2007 7:05 pm Asunto: Re: [boost] Serialization support Para: boost@lists.boost.org
JOAQUIN LOPEZ MU?Z wrote:
Ok now I understand, and basically share, your concerns about the lack of documentation on what goes into the serialization stream.
I'm not sure you see the full scope of what Peter is raising, or perhaps I'm reading more into it :-) It is not enough to document the serialization for, nor the serialization procedure, as that leaves out non-Boost Serialization implementations.
Well the idea is, you can leverage the B.S interface to add yout non-Boost serialization support. As its crudest, you can do the following: void non_boost_save(const T& t,non_boost_archive& a) { std::ostringstream oss; { boost::archive::text_oarchive oa(oss); oa<<t; } a.save(os.str()); } Something more sensible could be done by defining your own utility B.S Archive class, you get the idea.
I happen to have one of those non-Boost implementations, and it's implemented non-intrusively. In thinking about the scope of designing a serializable class, I consider the case of writing an external copy algorithm. If I can't write a copy function that given one instance will create an equivalent instance, then the class isn't usefully serializable.
Here you lost me. I know you're not referring to the following, but from your description looks like you're asking for a function T create_copy(const T& t) { return t; } which of course is readily available whenever T is copy-constructible. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo