12 #ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_OPTIONAL_H 13 #define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_OPTIONAL_H 15 #ifndef SST_INCLUDING_SERIALIZE_H 17 "The header file sst/core/serialization/impl/serialize_optional.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" 30 void operator()(std::optional<T>& obj,
serializer& ser, ser_opt_t options)
32 bool has_value =
false;
34 switch ( ser.mode() ) {
35 case serializer::SIZER:
36 has_value = obj.has_value();
40 case serializer::PACK:
41 has_value = obj.has_value();
45 case serializer::UNPACK:
46 ser.unpack(has_value);
61 if ( has_value ) SST_SER(*obj, options);
64 SST_FRIEND_SERIALIZE();
69 #endif // SST_CORE_SERIALIZATION_IMPL_SERIALIZE_OPTIONAL_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