//////////////////////////////////////////////////////////////////////////////// // Author: Andy Rushton // Copyright: (c) Southampton University 1999-2004 // (c) Andy Rushton 2004-2009 // License: BSD License, see ../docs/license.html //////////////////////////////////////////////////////////////////////////////// #include "persistent_int.hpp" namespace stlplus { //////////////////////////////////////////////////////////////////////////////// template void dump_map(dump_context& context, const std::map& data, DK key_fn, DT val_fn) throw(persistent_dump_failed) { dump_unsigned(context,data.size()); for (typename std::map::const_iterator i = data.begin(); i != data.end(); i++) { key_fn(context,i->first); val_fn(context,i->second); } } template void restore_map(restore_context& context, std::map& data, RK key_fn, RT val_fn) throw(persistent_restore_failed) { data.clear(); unsigned size = 0; restore_unsigned(context,size); for (unsigned j = 0; j < size; j++) { K key; key_fn(context,key); val_fn(context,data[key]); } } //////////////////////////////////////////////////////////////////////////////// } // end namespace stlplus