12 #ifndef SST_CORE_SERIALIZATION_SERIALIZE_MAP_H 13 #define SST_CORE_SERIALIZATION_SERIALIZE_MAP_H 15 #include "sst/core/serialization/serializer.h" 18 #include <unordered_map> 22 namespace Serialization {
24 template <
class Key,
class Value>
27 typedef std::map<Key, Value> Map;
32 typedef typename std::map<Key, Value>::iterator iterator;
33 switch ( ser.mode() ) {
35 case serializer::SIZER:
37 size_t size = m.size();
39 iterator it, end = m.end();
40 for ( it = m.begin(); it != end; ++it ) {
42 ser&
const_cast<Key&
>(it->first);
47 case serializer::PACK:
49 size_t size = m.size();
51 iterator it, end = m.end();
52 for ( it = m.begin(); it != end; ++it ) {
53 ser&
const_cast<Key&
>(it->first);
58 case serializer::UNPACK:
62 for (
size_t i = 0; i < size; ++i ) {
75 template <
class Key,
class Value>
78 typedef std::unordered_map<Key, Value> Map;
83 typedef typename std::unordered_map<Key, Value>::iterator iterator;
84 switch ( ser.mode() ) {
86 case serializer::SIZER:
88 size_t size = m.size();
90 iterator it, end = m.end();
91 for ( it = m.begin(); it != end; ++it ) {
93 ser&
const_cast<Key&
>(it->first);
98 case serializer::PACK:
100 size_t size = m.size();
102 iterator it, end = m.end();
103 for ( it = m.begin(); it != end; ++it ) {
104 ser&
const_cast<Key&
>(it->first);
109 case serializer::UNPACK:
113 for (
size_t i = 0; i < size; ++i ) {
130 #endif // SST_CORE_SERIALIZATION_SERIALIZE_MAP_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
Serialization "gateway" object.
Definition: serialize.h:110