Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Storing Variable State

Reply
Thread Tools

Storing Variable State

 
 
chris
Guest
Posts: n/a
 
      10-27-2003
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

 
Reply With Quote
 
 
 
 
stephan beal
Guest
Posts: n/a
 
      10-27-2003
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.

 
Reply With Quote
 
 
 
 
tom_usenet
Guest
Posts: n/a
 
      10-27-2003
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
 
Reply With Quote
 
stephan beal
Guest
Posts: n/a
 
      10-27-2003
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Images: Storing in Files VS Storing in Database Jonathan Wood ASP .Net 1 06-02-2008 05:56 PM
storing pointer vs storing object toton C++ 11 10-13-2006 11:08 AM
Storing a datatable in application or session state? Jason ASP .Net 6 11-01-2005 09:31 PM
IHttpModule Question (storing state) Mike ASP .Net 4 04-04-2005 05:54 PM
Storing Session State in SQL Server..Session doesnt Time out, jakk ASP .Net 2 03-08-2005 04:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57