|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-11-11 16:40:11
David Abrahams wrote:
> "Robert Ramey" <ramey_at_[hidden]> writes:
>> OK, let me rephrase that. There would be no advantage to doing that
>> since one could ->
>>
>>>> make thier own derivation(s) of one or more archive
>>>> classes or even a whole new archive class - but that doesn't
>>>> represent any conflict with the current library.
> A special archive class doesn't help if the interface for serializing
> arrays isn't a standard part of the archive concept. Everyone who
> writes a datatype containing an array will need to use that interface
> in his serialize function.
The archive class concept indicates that the following expression is true
ar << t
for any serializable type t.
The documentation defines a serializable type as:
A type T is Serializable if and only if one of the following is true:
a.. it is a primitive type.
In this document, we use the term primitive type to mean types whose data
is simply saved/loaded to/from an archive with no further processing.
Arithmetic (including characters), bool, enum and stl::string and
stl::wstring types are primitive types. Using serialization traits, any user
type can also be designated as "primitive" so that it is handled in this
way.
b.. It is a class type and for all Archive classes, one of the following
has been declared:
a.. a class member function serialize
b.. a global function serialize
c.. it is a pointer to a Serializable type.
d.. it is a reference to a Serializable type.
e.. it is an native C++ Array of Serializable type.
That is any array is serializable if its elements are serializable. Doesn't
that cover it?
Robert Ramey
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