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" 24 #include <type_traits> 29 constexpr
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>;
34 class serialize_impl<T, std::enable_if_t<is_adapter_v<std::remove_pointer_t<T>>>>
36 struct S : std::remove_pointer_t<T>
38 using std::remove_pointer_t<T>::c;
41 void operator()(T& v,
serializer& ser, ser_opt_t options)
43 if constexpr ( std::is_pointer_v<T> ) {
44 if ( ser.mode() == serializer::UNPACK ) v =
new std::remove_pointer_t<T>;
45 SST_SER(static_cast<S&>(*v).c, options);
48 SST_SER(static_cast<S&>(v).c, options);
51 SST_FRIEND_SERIALIZE();
56 #endif // SST_CORE_SERIALIZATION_IMPL_SERIALIZE_ADAPTER_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Base serialize class.
Definition: serialize.h:113