Boost logo

Boost Users :

From: Pfligersdorffer, Christian (Christian.Pfligersdorffer_at_[hidden])
Date: 2007-03-26 04:02:56


Dear Robert,

> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]]On Behalf Of Robert Ramey
> Sent: Friday, March 16, 2007 9:49 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Serialization] issue
> withportable_binary_oarchive
>
>
> Pfligersdorffer, Christian wrote:
>
> > I read this thread with very much interest since I want to use the
> > portable binary archive too. Could you please share your experience
> > and especially the code of the version that actually works?
>
> I've made some a few changes. I'll check them in to the HEAD before
> tomorrow.

I will have a look at that.

> a) I made a small change to binary_?archvive which was losing
> a "const" along the line and frustrating a template match
>
> b) I made a change in portable_binary_?archive to fix an
> error whereby the sign bit was changed on certain
> negative numbers.
>
> > Did you also add code to treat floating point types?
>
> Nope - that's an excercise for the user.
> Notes on the current implementation:
>
> a) It presumes a two's complement computer so its not
> "truely" portable.

OK, I would not use it on some very fancy cpus then. ppc and x86 should probably work and that's what counts with me.

> b) It doesn't include floating point. I think this would be more
> effort than first meets the eye. At least one attractive proposal on
> how to effectively do this was suggested.
> c) Its not all that efficient on big endien machines. I think
> a better version would write the data out in native mode
> with flags in the header indicating how it was written. Then
> the endian fix up would occur when it was moved from
> one machine to another.

I would like to switch to big endian representation to ensure maximum speed on the embedded system. This should easily be possible by changing the #ifdef BOOST_LITTLE_ENDIAN sections into #ifndef, or? ...

> d) It focuses more on reducing archive size. So some
> a 64 bit value of 0 is written as one byte. This is probably
> a good choice for most. But it costs time in sign extending
> etc.
>
> Robert Ramey

By the way: did you solve the destruction issue when deleting an archive through the polymorphic interface? I sent you an email about that (a couple of months ago) and you answered you'd have a look at it.

Regards,

--
DI Christian Pfligersdorffer
Software Engineering EOS GmbH 

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