|
From: | Kai Sterker |
Subject: | [Adonthell-devel] new save/load mechanism |
Date: | Sat, 13 Mar 2004 13:40:44 +0100 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |