Boost logo

Boost :

From: Marcin Tustin (mt_at_[hidden])
Date: 2005-05-19 11:24:47


> -----Original Message-----
> From: Robert Ramey [mailto:ramey_at_[hidden]]
> Sent: 19 May 2005 16:34
> To: boost_at_[hidden]
> Subject: [boost] Re: Re: Non-intrusive serialization with VC2003 (7.1)
>
> Marcin Tustin wrote:
> > c:\new_boost\boost\boost\archive\detail\oserializer.hpp(152) :
>
>
> The choice is made here.

        Yes, and for the moment my understanding of function selection
in C++ is not enough to understand why the choice is made.
 
> >>>> namespace boost {
> >>>> namespace serialization {
> >>>> template<class Archive >
> >>>> static void serialize(Archive & ar, const
> >>> D2::Message& g, const
> >>>> unsigned int version)
> >>>> {
> >>>> //...
> >>>> }
> >>>>
> >>>> } };
> >>>>
>
> Note that your serialize template above uses datatype
> D2::Message while one is trying to serialize D2::MessagePtr.

        I've changed the function to use D2::MessagePtr already. The
move to D2::MessagePtr (Which is a typedef for
Jrs::SmartPtr<D2::Message>) is for other reasons. In any case, the
problem still obtains.

The new code is:

          template<class Archive>
          void serialize(Archive & ar, const Jrs::SmartPtr<D2::Message>&
g, const unsigned int version)
          {
                  //ar & g.stdString();
                  ar & g.px; // contained pointer
                  ar & g.pn; // reference counter
          }

And yes, I am aware that there is a whole load of extra complexity in
correctly serialising smart pointers, and I will deal with that once I
can get any non-intrusive serialisation to work.

Thanks again for your help and attention.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk