Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-08-18 12:22:28


You could do the following:

a) serialize your gigantic character array.
b) For each pointer you want to serialize serialize the displacement from
the front of your array

save(
    ?; // save to huge array using binary object
    unsigned int disp;
    disp = A - file.ptr;
    ar << disp;
    disp = B - file.ptr;
    ...
}

load(
    ?; // load huge array using binary object
    unsigned integer disp;
    ar >> disp
    a = file.ptr + disp;
    ar >> disp
    a = file.ptr + disp;
    ...
}

Good Luck

Robert Ramey


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