Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization of a complex data structure
From: Marco Meoni - Sbaush (sbaush_at_[hidden])
Date: 2010-04-30 09:46:51


I read about the non-intrusive serialization but my problem is:
in non-intrusive example the code for serialization is

void serialize(Archive & ar, gps_position & g, const unsigned int version) {
   ar & g.degrees;
   ar & g.minutes;
   ar & g.seconds;
}

In my example i should do this:

    ar & results_container;

result_container is not a STL type, but is a Container*. So i should declare
in Container body the serialization method (as suggested by Robert). Is this
right?
The big problem is that i can't write in Container body, because is not a
mine class, but is a lib class.

How can i serialize all my members in the same way of STL type, without
worring about nested serialize methods?
Is the asked question clear?

thank you so much.

On Fri, Apr 30, 2010 at 2:55 PM, Jeff Flinn
<TriumphSprint2000_at_[hidden]>wrote:

> Marco Meoni - Sbaush wrote:
>
>> Yes. I did an example like this to learn how to serialize in the
>> "classical" way.
>> My problem is that i can't define a serialize method inside Container, but
>> i would serialize it anyway. How can i serialize the Example strut entirely?
>>
>> Do you understand my problem?
>>
>
> Please don't top post. How does:
>
>
> http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/tutorial.html#nonintrusiveversion
>
> differ from what you want to do?
>
> Jeff
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Marco Meoni - Sbaush
www.marcomeoni.net


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