|
-
Aug 7th, 2001, 03:32 PM
#1
Saving objects
I wonder if there is any way to save instances of objects keeping all the relations self-consistent after loading them back.
The problem i see is that pointers would become corrupted after the objects being reloaded into memory. Is there a way to get over that? or do i have to write my own algorithms?
Thanks in advance
-
Aug 7th, 2001, 03:54 PM
#2
transcendental analytic
You could 1) index your objects and store the indexes with them. 2) sort your objects by pointer and then have each objects look up their reference's order.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2001, 04:07 PM
#3
-
Aug 7th, 2001, 04:16 PM
#4
transcendental analytic
no problemo the first will use some extra memory under runtime, so if you don't have too many possible solution for some object references, always try find it in it's array and store the index instead.
Good luck
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 8th, 2001, 03:33 PM
#5
As a note - if you're using MFC:
DECLARE_SERIAL and IMPLEMENT_SERIAL allow you to use CArchive which handles all the overhead of reading/writing any object to/from disk.
SDK - stick with Kedaman's ideas.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|