|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-03-19 08:08:16
rameysb wrote:
> Fellow programmers
>
> I have just uploaded draft # 2 of my proposal for a boost library to
> address saving and restoring of C++ objects. Serialization.zip
Great.
> In addition to the original list of requirements (see below), and in
> reponse to comments from boost members, I have implemented the
> following enhancements:
>
> 1) Archives are derived from a base class with virtual functions.
> This allows applications to implement custom archive formats. The
> library contains support for archives in character text, native
> binary data, and wide character text.
Great. However, suppose I want to serialize data as xml. Do I have a way to
do it? I'm not sure if "basic_iarchive" is a good name. It links in my mind
with basic_string/basic_istream &c. where "basic" means something
different.
> 2) More checking has been implemented to detect erroneas library usage
>
> 3) Archives no longer need to store class names. This makes them
> smaller and portable across platforms.
I'm missing something and can't easily find it from the code. How the
association between classes and class-ids in the stored file is maintained?
> 4) Archives have a header to detect cases of erroneas usage.
>
> 5) Objects serialized through pointers no longer require a default
> constructor. Any constructor can be supported. This implies that
> const values and references can be saved and restored for objects
> serialized through pointers.
>
> 6) System should function on platorms that fail to properly implement
> partial ordering for function templates (e.g MSVC 6)
>
> 7) library, test and demo build and function properly on MINGW as
> well as MSVC 7.0
>
> 8) More complete documentation.
There's one more problem that I've spotted. With virtual base classes your
code attempts to save a base twice when serializing the most derived class in
a dimond hierarchy. I'll send you an example in a private e-mail.
Another problem is that strings cannot be serialized, at least in some
context. Example will be emailed to you.
Some minor nits:
1. Should
::boost::whatever
be replaced with just
boost:::whatever
?
2. Looks like your source uses tabs, which is contracty to Boost requirements.
3. Class 'archive_exception' is better be derived from std::exception.
4. reference documentation is shown up incorrectly in my broser and
http://validator.w3.org shows a lot of errors.
5. reference documentation in some places says
*static_cast<base*>(*this)
by it should be
*static_cast<base*>(this)
Moreover, inside "save" method it should be
*static_cast<const base*>(this)
- Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk