|
Boost Users : |
From: __PPS__ (i-love-spam_at_[hidden])
Date: 2005-11-22 00:52:37
Hello,
I want to write simple binary searialization class.
the serialized data should be as compact as possible, e.g. I don't want
to have "serialization::archive" string etc, since most of the time I
need really basic serialization performed into many separate archives:
something like hunrdreds of archives that contain simple int, or string.
I also don't need any versioning. These data serializations are for a
short period of time (automatically removed after a few minutes), to
share data between multiple processes on the same machine.
Basicly, I need to serialize many key-value pairs, and then to be able
to extract values by their keys. Keys are simple strings, values can be
anything.
Since I cannot use boost::any for value part, then I decided to go a way
around. I'll have a map that maps string keys to the serialized binary
string of value, and then this big map is serialized. The other process
then deserializes this map and if it accesses some value it also needs
to deserialize the value. I really need simple searialization, something
like
i:1234,s[5]:Hello
for int(1234) and string("Hello") with all the numbers serialized in
binary etc, without any BE/LE code - always the same machine used.
I think it would be really enough for me to have serialization of
numbers, strings and binary data, but I want to use boost::serialization
to allow users to insert objects of their own classes in that key-value
pairs.
basicly, my goal is to create such class that maps string keys to any
data, then all this map is serialized and some other process
deserializes this map and accesses values by keys.
Is there's something in serialization library you could suggest me to
look at. I viewed demo_fast_archive, but I cannot find good info on
creating my own archive classes.
It seems that my problem would be completely solved if there were some
way to serialize boost::any, in this case I would only needed to
serialize std::map<std::string,boost::any>
thanks
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net