473,503 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing Variable State

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

Jul 19 '05 #1
3 1925
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.

Jul 19 '05 #2
On Mon, 27 Oct 2003 12:58:02 +0100, stephan beal
<st*****@wanderinghorse.net> 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
Jul 19 '05 #3
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.

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1986
by: Frank Rizzo | last post by:
In classic ASP, it was considered a bad idea to store VB6-created objects in the Application variable for various threading issues. What's the current wisdom on storing objects in the Application...
2
5017
by: jakk | last post by:
Below is the exception that Iam getting. It says that the DataView that Iam storing in the session is not Serializable. BUt works fine if I store in the inproc session and fails if I switch to...
7
1537
by: py | last post by:
how feasible is it to cache an entire page's content in a session variable? i am already doing it and it works fine, except i am afraid of scalability issues. what is the best way to test this? ...
5
2176
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
2
1508
by: newjazzharmony | last post by:
All, I'd appreciate it if someone could answer these questions for me. This scenario applies to an ASP dot net application that is deployed in a web farm. 1) Does the application live in a...
9
7277
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would...
3
2029
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
4
12588
by: =?Utf-8?B?YmFzdWxhc3o=?= | last post by:
Hi; I want to store a datatable (or an arraylist) as a session variable but when I try; Session = al_RecNo; I get an error that; "Cannot implicitly convert type...
9
1163
by: =?Utf-8?B?SmFzb24gSGFydHNvZQ==?= | last post by:
I have a sub routine that's passing in a variable. I need to take that variable and store it globally...but here's what's happening. ex: I'm executing my routine: doMyThing(path, "test") I'm...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.