Boost logo

Boost Users :

Subject: Re: [Boost-users] BoostSerialization callinga customserialize method
From: Rune Lund Olesen (rune.olesen_at_[hidden])
Date: 2010-08-26 05:50:37


Hi

I would like to support Robert in that. Ive used this library to
partially serialize some classes from another 3rd party library. Maybe
not using the serialization library as intended, but nevertheless got
the effect i wanted and retaining most features of the library.

And reading this yesterday im also pretty sure there is a way to
accomplish the effect you want.

Did you consider this:

typedef std::pair<?,?> MyPair;

and implementing serialize method for MyPair.

?

Kind regards

Rune

On Wed, Aug 25, 2010 at 9:39 PM, Robert Ramey <ramey_at_[hidden]> wrote:
> Pooyan Dadvand wrote:
>> The question is not the name of the method, the problem is the
>> additional parameter which boost::serialization cannot pass to me.
>> For this reason I have to call my own serialize method inside the
>> standard serialize method prepared for boost::serialization.
>>
>> template<class TArchiveType>
>> MyContainer::serialize(TArchiveType &rArchive, const unsigned int
>> Version)
>> {
>>    p_variable_data->MyCustomSerialize(rArchive, Version, MyData);
>> }
>>
>
> try the following:
>
> template<class TArchiveType>
> MyContainer::serialize(TArchiveType &rArchive, const unsigned int
> Version)
> {
>    rArchive << p_variable_data;
> }
>
> or
>
> template<class TArchiveType>
> MyContainer::serialize(TArchiveType &rArchive, const unsigned int
> Version)
> {
>    rArchive << std::pair<?, ?>(p_variable_data, MyData);
> }
>
> I'm sure that there is an easy way to use the library to get the effect you
> want.
>
> But it will require effort to see it.
>
> Robert Ramey
>
>
>
> _______________________________________________
> 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