12 #ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_MAP_H 13 #define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_MAP_H 15 #ifndef SST_INCLUDING_SERIALIZE_H 17 "The header file sst/core/serialization/impl/serialize_map.h should not be directly included as it is not part of the stable public API. The file is included in sst/core/serialization/serialize.h" 20 #include "sst/core/serialization/serializer.h" 24 #include <unordered_map> 28 namespace Serialization {
34 template <
class Key,
class Value>
37 typedef std::map<Key, Value> Map;
42 typedef typename std::map<Key, Value>::iterator iterator;
43 switch ( ser.mode() ) {
45 case serializer::SIZER:
47 size_t size = m.size();
49 iterator it, end = m.end();
50 for ( it = m.begin(); it != end; ++it ) {
52 ser&
const_cast<Key&
>(it->first);
57 case serializer::PACK:
59 size_t size = m.size();
61 iterator it, end = m.end();
62 for ( it = m.begin(); it != end; ++it ) {
63 ser&
const_cast<Key&
>(it->first);
68 case serializer::UNPACK:
72 for (
size_t i = 0; i < size; ++i ) {
87 void operator()(Map& UNUSED(m),
serializer& UNUSED(ser),
const char* UNUSED(name))
93 template <
class Key,
class Value>
96 typedef std::unordered_map<Key, Value> Map;
101 typedef typename std::unordered_map<Key, Value>::iterator iterator;
102 switch ( ser.mode() ) {
104 case serializer::SIZER:
106 size_t size = m.size();
108 iterator it, end = m.end();
109 for ( it = m.begin(); it != end; ++it ) {
111 ser&
const_cast<Key&
>(it->first);
116 case serializer::PACK:
118 size_t size = m.size();
120 iterator it, end = m.end();
121 for ( it = m.begin(); it != end; ++it ) {
122 ser&
const_cast<Key&
>(it->first);
127 case serializer::UNPACK:
131 for (
size_t i = 0; i < size; ++i ) {
140 case serializer::MAP:
146 void operator()(Map& UNUSED(m),
serializer& UNUSED(ser),
const char* UNUSED(name))
156 #endif // SST_CORE_SERIALIZATION_IMPL_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:43
Base serialize class.
Definition: serialize.h:45
Serialization "gateway" object.
Definition: serialize.h:133