12#ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_ADAPTER_H
13#define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_ADAPTER_H
15#ifndef SST_INCLUDING_SERIALIZE_H
17 "The header file sst/core/serialization/impl/serialize_adapter.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"
26namespace SST::Core::Serialization {
29constexpr bool is_adapter_v = is_same_type_template_v<T, std::stack> || is_same_type_template_v<T, std::queue> ||
30 is_same_type_template_v<T, std::priority_queue>;
41 void operator()(T& v,
serializer& ser, ser_opt_t options)
43 switch ( ser.mode() ) {
48 if constexpr ( is_same_type_template_v<T, std::priority_queue> ) options |= SerOption::map_read_only;
51 SST_SER_NAME(
static_cast<S&
>(v).c,
"container", options);
53 ser.mapper().map_hierarchy_end();
58 SST_SER(
static_cast<S&
>(v).c, options);
63 SST_FRIEND_SERIALIZE();
69 void operator()(T*& obj,
serializer& ser, ser_opt_t options)
71 if ( ser.mode() == serializer::UNPACK ) obj =
new T;
72 SST_SER(*obj, options);
74 SST_FRIEND_SERIALIZE();
Class used to map containers.
Definition objectMap.h:1420
Base serialize class.
Definition serialize.h:132
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43