|
Boost Users : |
Subject: [Boost-users] [Serialization] [Serialization of stl map with pointer to POD type]
From: Denis Gabaidulin (gabaden_at_[hidden])
Date: 2008-12-30 18:23:53
I have following class with stl container:
class storage : {
private:
map<const char*, int, cmp> data_;
friend class boost::serialization::access;
template<class Archive>
void save(Archive & ar, const unsigned int version) const
{
map<string, int> local;
constDataIter iter;
for (iter = data_.begin(); iter != data_.end(); iter++) {
local[iter->first] = iter->second;
}
ar & local;
}
}
This code works, but it slowly(full copy) and consume too much memory (x2) :-(
What is the best serialization strategy with such stl containers or
pointer to pod type?
I cannot change const char* to string, dont ask me why :-))
Thanks you for any advice.
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