19 #ifndef OST_CONTAINER_SERIALIZATION_HH
20 #define OST_CONTAINER_SERIALIZATION_HH
28 #include <boost/type_traits/is_pod.hpp>
29 namespace ost {
namespace io {
34 if (boost::is_pod<T>::value) {
35 sink.
Stream().write(
reinterpret_cast<const char*
>(&value.front()),
36 sizeof(T)*value.size());
38 typename std::vector<T>::const_iterator i=value.begin();
39 for (; i!=value.end(); ++i) {
48 source >> vector_size;
49 value.resize(vector_size);
50 if (boost::is_pod<T>::value) {
51 source.
Stream().read(
reinterpret_cast<char*
>(&value.front()),
52 sizeof(T)*vector_size);
54 typename std::vector<T>::iterator i=value.begin();
55 for (; i!=value.end(); ++i) {
61 template <
typename K,
typename V>
64 typename std::map<K, V>::const_iterator i=value.begin();
65 for (; i!=value.end(); ++i) {
71 template <
typename K,
typename V>
74 source >> vector_size;
75 for (
uint32_t i=0; i<vector_size; ++i) {
78 std::pair<typename std::map<K, V>::iterator,
bool> p;
79 p=value.insert(std::make_pair(k, V()));
80 source >> p.first->second;
void Serialize(BinaryDataSink &sink, const T &value)