Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Polymorphic serializationwithpolymorphic archives problem...
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-02-25 02:32:35


Martin Lederhilger wrote:

> Thanks for your answer,
>
> in my case I want to be able to serialize an object with a pointer to
> its most derived type, a pointer to it's base class,
> a pointer to the base class of base class, ...
>
> Actually this problem should happen with all
> BOOST_CLASS_EXPORT_IMPLEMENTed classes
> which reside in one DLL, and are serialized (+automatic register_type)
> in another DLL or EXE.
>
> Is the intention of the exception to prevent useres from using
> BOOST_CLASS_EXPORT_IMPLEMENT
> multiple times?

My concern was that having (possibly different) implementations
of code with the same signature in different modules would lead
to bizarre behavior which would be impossible to track down. The
problem for me is that when this happens with the serialization
library, I get a message "The serialization library has a bug" which
really bugs me. Worse, it takes a huge amount of time to resolve
the issue.

> If so, then the quick solution for me is to ignore the
> exception (the serialisation seems to work then, but I know that a
> solution for the library itself is much trickier).

Of course that works.
>
> Martin

It's becoming clear to me that it's very common to have code with the
same signature duplicated across DLLS. It should be clear why this
CAN be a big problem but USUALLY won't be. It takes (a lot?) of
extra effort to avoid this situation.

I'm thinking about the best way to handle this.

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