$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Ivan (ivan.rachev_at_[hidden])
Date: 2005-08-17 10:23:24
I have a parser and there is one big object that holds the whole file
being parsed as a dynamic array
class File { public char * ptr; };
File file;
file.ptr = new char[very_big_number_like_100000];
The parser creates a lot of objects that keep pointers into this dynamic
array.
class A { char* internalPtr1; };
class B { char* internalPtr2; };
class C { char* internalPtr3; };
A a; B b; C c;
a.internalPtr1 = file.ptr + 234;
b.internalPtr2 = file.ptr + 10673;
c.internalPtr3 = file.ptr + 9583;
How could I serialize the file object and these numerous small objects?
I could write separate save/load for each of these A, B, C and so on but
I'll need access to File::ptr inside the save/load funcs and this would
be an ugly solution. Any ideas?