12 #ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_TRIVIAL_H 13 #define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_TRIVIAL_H 15 #ifndef SST_INCLUDING_SERIALIZE_H 17 "The header file sst/core/serialization/impl/serialize_trivial.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> 34 template <
typename T,
size_t S>
52 std::enable_if_t<std::conjunction_v<std::negation<is_trivially_serializable_excluded<std::remove_pointer_t<T>>>,
53 is_trivially_serializable<std::remove_pointer_t<T>>>>>
55 void operator()(T& t,
serializer& ser, ser_opt_t UNUSED(options))
57 switch (
const auto mode = ser.mode() ) {
60 if constexpr ( std::is_arithmetic_v<std::remove_pointer_t<T>> ||
61 std::is_enum_v<std::remove_pointer_t<T>> ) {
63 if constexpr ( std::is_pointer_v<T> )
67 if ( SerOption::is_set(options, SerOption::map_read_only) ) ser.mapper().setNextObjectReadOnly();
68 ser.mapper().map_primitive(ser.getMapName(), obj_map);
77 if constexpr ( std::is_pointer_v<T> ) {
78 if ( mode == serializer::UNPACK ) t =
new std::remove_pointer_t<T> {};
88 SST_FRIEND_SERIALIZE();
93 #endif // SST_CORE_SERIALIZATION_IMPL_SERIALIZE_TRIVIAL_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
ObjectMap representing fundamental types, and classes treated as fundamental types.
Definition: objectMap.h:1264
Base serialize class.
Definition: serialize.h:113
Base class for objects created by the serializer mapping mode used to map the variables for objects...
Definition: objectMap.h:158
Definition: serialize_trivial.h:31