|
Boost : |
From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2004-04-25 13:34:34
----- Mensaje original -----
De: Jeff Garland <jeff_at_[hidden]>
Fecha: Domingo, Abril 25, 2004 0:37 am
Asunto: [boost] [serialization+date_time] Serialization Review: serialization of dates
> All -
>
> Since I'm the review manager I'm not doing a formal review of the
> library, but
> I thought I'd share some code and a few thoughts. If
> serialization is
> accepted users people will ask me and other library authors to provide
> serialization support for some of the types in their libraries. So
> to get a
> feel for the difficulty of extending serialization for new types I
> wrote the
> serialization code for gregorian::date and some example code to
> try it out.
Regarding the need to include "greg_serialize.hpp", I think
a better approach, from the point of view of the user, is
that serialization support is already embedded into
"boost/date_time/gregorian/gregorian_types.hpp" and
automatically provided if one of the archive headers
are included by the user program:
// case 1
"boost/date_time/gregorian/gregorian.hpp"
int main()
{
date d(2004,Apr,25);
boost::archive::text_oarchive oa(ofs);
// does not work, text_oarchive not defined.
oa << d;
}
// case 2
"boost/date_time/gregorian/gregorian.hpp"
#include <boost/archive/text_oarchive.hpp>
int main()
{
date d(2004,Apr,25);
boost::archive::text_oarchive oa(ofs);
// OK, no need to include anything else fromd date-time
oa << d;
}
See what I mean? For this to work with minimum
overhead, we'd need some forward headers for serialize,
save, load, etc. to be included by
"boost/date_time/gregorian/gregorian.hpp".
I'm not sure whether this forward headers are already
provided by Robert's library.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk