Boost logo

Boost Users :

From: Bryan Donlan (bdonlan_at_[hidden])
Date: 2006-05-30 22:20:15


On 5/30/06, Robert Ramey <ramey_at_[hidden]> wrote:
> Rather than what you have below - just try
>
> BOOST_SERIALIZATION_SPLIT_FREE(creaturesImage);
>
> By default - pointers to primitive types aren't serializable. I'm not
> sure why you used the BOOST_CLASS_IMP.. below but it
> would seem to me in appropriate in your case. If you do this
> you will be able to do;
>
> const creaturesImage *pci;
> ...
> ar << pci;
>
> ...
> creaturesImage *new_pci;
> ar >> new_pci
>
> assert(*pci == *new_pci);
>
> In fact, given the size of your application, making a little program
> like the above to test your serialization code separately, is
> probably a good idea anyway.
>
> Good Luck
>
> Robert Ramey

I should clarify a bit - creaturesImage /is/ a class. But I want to
override the /pointer/ serialization, rather than the class
serialization. As such, it doesn't matter if the representations of
the pointers are unchanged between two runs of the program; rather, it
matters that the class not be serialized by boost, as these classes
are rather heavy in terms of memory-mappings and other external
resources (hence using a global cache to share them).


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