|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2007-11-04 23:43:03
It just so happens that as I write this I'm working on a definitive solution
to this issue. I believe that I will get it resolved soon - though
probably not soon enough for 1.35. Of course that depends
on how long 1.35 takes.
Robert Ramey
Felipe Magno de Almeida wrote:
> Hi,
>
> I was able to make this work on serialization after some minor
> modifications: PS: pseudo-code
>
> DLL1:
> header.h
> BOOST_IS_ABSTRACT(base);
> class base
> {
> virtual ~base() {}
> // serialization
> };
> source.cpp
> class derived : base
> {
> // serialization
> };
> BOOST_CLASS_EXPORT(derived);
>
> void serialize(oarchive& ar)
> {
> boost::shared_ptr<derived> p(new derived);
> ar << p;
> }
>
> DLL2:
> std::stringstream stm;
>
> {
> oarchive oar(stm);
> serialize(oar);
> }
>
> {
> iarchive iar(stm);
> boost::shared_ptr<base> p;
> iar >> p; // deserializing a derived class defined in DLL1 in DLL2
> }
>
> I had to compile serialization as a lib. And making tk_map and kt_map
> global objects (not sure if this is necessary though), removing the
> assertion about multiple inserts in static insert function of both
> [kt][tk]_map's and commenting
> line 315 of basic_oarchive:
> //if((cobject_info_set.size() > original_count)){
> +{
>
> I don't know the internals of serialization enough to say this is
> anything near correct. And I'll still need to test more, which I will
> do, since I need this functionality very much.
>
> Regards,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk