|
Boost Users : |
From: Dan Leibovich (dan_at_[hidden])
Date: 2007-06-27 13:38:01
Hi,
I have tried using the HEAD version and found the same issues.
Let me summarize my findings:
I have used the to use the portable_binary_o/iarchive to serialize classes with strings and integers (no floating point)
I have got deferent results on linux / solaris hosts.
I have found that metadata types like class_id_type are not saved correctly. The save_impl(long t) method is not called for this kind of types.
The following program never reaches the save_impl method
------------------------------------------
#include "portable_binary_oarchive.hpp"
#include <fstream>
int main() {
char* file = "file" ;
boost::archive::class_id_type cid ;
std::ofstream ofs(file, std::ios::binary) ;
portable_binary_oarchive oar(ofs) ;
oar << cid ;
ofs.close() ;
}
------------------------------------------
I have tried adding specialization like:
void save(const boost::archive::class_id_type t){
save_impl(t);
}
and:
void load(unsigned short & t){
long l;
load_impl(l, sizeof(unsigned long));
t = l;
}
void load(short & t){
long l;
load_impl(l, sizeof(long));
t = l;
}
But it resulted with portable_binary_archive_exception
if(size > maxsize)
throw portable_binary_archive_exception() ;
Do you have any suggestion on how to proceed.
Thanks in advance,
Dan
>-----Original Message-----
>From: boost-users-bounces_at_[hidden]
>[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Robert Ramey
>Sent: á 25 éåðé 2007 20:50
>To: boost-users_at_[hidden]
>Subject: Re: [Boost-users] [Serialization] portable binary archive
>
>I believe I couldn't reproduce it with the code on the CVS
>HEAD so I assumed that it was no longer a problem and stopped looking.
>
>Robert Ramey
>
>"Dan Leibovich" <dan_at_[hidden]> wrote in message
>news:80726DBE398EBB4A8B77AD210C509EAA034B93DF_at_MAILEU.global.cad
>ence.com...
>Hi,
>Few month ago I have started a thread about an issue with the
>potable binary archive demo:
>http://lists.boost.org/boost-users/2007/03/26274.php
>
>Robert,
>Were you able to find the exact bug?
>
>Thanks in advance
> Dan
>
>
>
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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