|
Boost Users : |
Subject: Re: [Boost-users] [serialization] Serializing const* to serialized data
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-11-06 14:23:41
On Fri, Nov 6, 2009 at 11:00 AM, Noah Roberts <roberts.noah_at_[hidden]> wrote:
> In article <c72e33ce0911051651le8017fes28076be7778b87f5_at_[hidden]>,
> emildotchevski_at_[hidden] says...
>>
>> On Thu, Nov 5, 2009 at 4:08 PM, Noah Roberts <roberts.noah_at_[hidden]> wrote:
>> >
>> >
>> > Consider something like so:
>> >
>> > struct A
>> > {
>> > ...?
>> > };
>> >
>> > struct B
>> > {
>> > std::list<A> items;
>> > };
>> >
>> > struct C
>> > {
>> > A const* ptr_to_item_in_B_items;
>> > };
>> >
> I want to recover the structure layout. If a C had a pointer to A item
> X in C then when it reloads it should point at X again.
Sure but what do you imagine in terms of a serialization library?
Obviously, *you* could serialize your pointer, for example as index in
the list, but all that the serialization library sees is a pointer. It
has no way of knowing that it points an element within the list, it
has no way of knowing that there is a list even. But maybe I'm missing
something so I asked how would that work.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
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