Storing Variable State

Discussion in 'C++' started by chris, Oct 27, 2003.

  1. chris

    chris Guest

    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
    chris, Oct 27, 2003
    #1
    1. Advertising

  2. chris

    stephan beal Guest

    chris wrote:
    > 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.


    Just launched this morning:

    http://stephan.rootonfire.org/s11n/

    (i'm still waiting on the s11n.net domain registration.)

    > 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).


    That's all EASY to do with the above framework.

    > 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!


    Again, see above. :)

    --
    ----- stephan beal
    Registered Linux User #71917 http://counter.li.org
    I speak for myself, not my employer. Contents may
    be hot. Slippery when wet. Reading disclaimers makes
    you go blind. Writing them is worse. You have been Warned.
    stephan beal, Oct 27, 2003
    #2
    1. Advertising

  3. chris

    tom_usenet Guest

    On Mon, 27 Oct 2003 12:58:02 +0100, stephan beal
    <> wrote:

    >chris wrote:
    >> 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.

    >
    >Just launched this morning:
    >
    >http://stephan.rootonfire.org/s11n/


    Have you looked at Boost's serialization efforts?

    See serialization12.zip available here:
    http://groups.yahoo.com/group/boost/files/
    and the discussion on the Boost mailing lists.

    Tom
    tom_usenet, Oct 27, 2003
    #3
  4. chris

    stephan beal Guest

    tom_usenet wrote:
    > Have you looked at Boost's serialization efforts?
    >
    > See serialization12.zip available here:
    > http://groups.yahoo.com/group/boost/files/
    > and the discussion on the Boost mailing lists.


    No, i hadn't. Thanks for the link!


    --
    ----- stephan beal
    Registered Linux User #71917 http://counter.li.org
    I speak for myself, not my employer. Contents may
    be hot. Slippery when wet. Reading disclaimers makes
    you go blind. Writing them is worse. You have been Warned.
    stephan beal, Oct 27, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    6
    Views:
    7,440
    Ksenia
    Nov 1, 2005
  2. jakk
    Replies:
    2
    Views:
    777
  3. Mike
    Replies:
    4
    Views:
    568
    Brock Allen
    Apr 4, 2005
  4. toton
    Replies:
    11
    Views:
    704
    toton
    Oct 13, 2006
  5. Jonathan Wood
    Replies:
    1
    Views:
    505
    Jonathan Wood
    Jun 2, 2008
Loading...

Share This Page