adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] new save/load mechanism


From: Kai Sterker
Subject: [Adonthell-devel] new save/load mechanism
Date: Sat, 13 Mar 2004 13:40:44 +0100

As suggested in my earlier mail, I have written a new mechanism to load/save data in a better way. Main reason is to ensure better compatibility across versions.

The implementation turned out a little different as suggested: there's the class flat that contaions the basic functionality: flattening all the data into a single buffer and retrieving it again from the buffer. On top of that sits diskio, which adds methods to save and load that buffer to/from a gzstream.

That means for one we can keep our put_state/get_state methods, which take gzstrream as argument. However, internally, the data is first put into the diskio container, which is then saved to disk. When loading, that container is restored from file first and the data can then be retreived from it.

Later on, we could easily write a netio class that can transfer the flattened data over a network.

There is also a little test program called diskiotest that demonstrates the functionality.

Hope that thing proves to be helpful!

Kai





reply via email to

[Prev in Thread] Current Thread [Next in Thread]