C
chris
Hello,
I am currently writing a simulation system which involves a large number
of C++ classes, many of which contain pointers to other objects. I need
the ability to save the state of the system and replay (at least partly)
from the saved state.
I have constructed my system to save the input stream and also set up
the random number generator so that I can save and resume its state. My
only major problem now is that I have a group of about 1,000 objects,
each of which can contain a number of pointers to other objects and
cannot come up with an efficent way to copy the all and "fix" the
pointers. Any suggestions appresiated (I'm quite happy to re-write parts
of the code to allow a new system to work).
One (possibly) specialist requirement is that while I save the state
often, frequently I will never use the copies. Therefore some system
which could copy the objects quickly and record enough state to fix up
the pointers later and possibly much slower would be very good!
Chris
I am currently writing a simulation system which involves a large number
of C++ classes, many of which contain pointers to other objects. I need
the ability to save the state of the system and replay (at least partly)
from the saved state.
I have constructed my system to save the input stream and also set up
the random number generator so that I can save and resume its state. My
only major problem now is that I have a group of about 1,000 objects,
each of which can contain a number of pointers to other objects and
cannot come up with an efficent way to copy the all and "fix" the
pointers. Any suggestions appresiated (I'm quite happy to re-write parts
of the code to allow a new system to work).
One (possibly) specialist requirement is that while I save the state
often, frequently I will never use the copies. Therefore some system
which could copy the objects quickly and record enough state to fix up
the pointers later and possibly much slower would be very good!
Chris