Object Serialization

BlitzMax Forums/BlitzMax Programming/Object Serialization

BLaBZ(Posted 2012) [#1]
Does it exist?

I found bruceys mod called Persistence but there doesn't seem to be a download.

Thanks


GW(Posted 2012) [#2]
I think you have to use svn to get it from the googlecode repository.
be warned that it doesn't work with multithreaded apps. (it is an awesome module though)


BLaBZ(Posted 2012) [#3]
Awesome thanks!


Derron(Posted 2012) [#4]

doesn't work with multithreaded apps



What? Hope you mean: it does not serialize threaded data. This is in most cases not problematic as you avoid saving temporary data (eg unprocessed network packets) but eg gamestates (player names, money, ...) which is managed by the main thread.


bye
Ron


Oddball(Posted 2012) [#5]
There's a major bug in bah.Persistence. If you deserialize two or more files/objects then you'll get errors as the reference list isn't cleared between deserializations. Here is a version I fixed up for my own use.



I hope Brucey doesn't mind me posting that.


Derron(Posted 2012) [#6]
Thanks... just updated my library - will test it as soon as I rewrote my save/load-parts.


bye
Ron


Brucey(Posted 2012) [#7]
Are you sure?
According to the code in SVN, it calls Free() often, and always clears the objectMap.
.. which is true since July 2011, according to the log ;-)


Oddball(Posted 2012) [#8]
Fair enough. I stand corrected then. It's a great module BTW. Thanks.