Boost logo

Boost Users :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2008-08-26 17:05:48


On 26 Aug 2008, at 13:44, Diane wrote:

> I have a large, complex struct that is made up of many levels of
> structs,
> getting eventually to int, char*, enum, etc. There are also pointers
> to structs
> and arrays of pointers. There are no STL types within these
> structures.
>
> I am trying to wrap my head around how I can use boost.serialization
> for this,
> without modifying the structures themselves (I can't make changes to
> the
> definitions).
>
> Does anyone know the best way to do this? I saw several mentions of
> wrapper
> classes for serializing a float and figure I could use that
> approach, but I
> think I would have to make a mirror structure that's made up of my
> struct
> wrappers and copy the data over from the real struct into these
> classes. Or I
> guess I could use pointers, but I would still have to create this
> second
> monster. Is that really the best possibility?

Can't you just write a serialize() function for each of your structs?
As you say they are structs I assume that all members are public and a
free serialize function should be able to access all members?

Matthias


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