Various classes and functions that are critical for the operation of cereal but of no interest to users.
More...
Various classes and functions that are critical for the operation of cereal but of no interest to users.
◆ CEREAL_REGISTER_ARCHIVE
#define CEREAL_REGISTER_ARCHIVE |
( |
|
Archive | ) |
|
Value: namespace cereal { namespace detail { \
template <class T, class BindingTag> \
typename polymorphic_serialization_support<Archive, T>::type \
instantiate_polymorphic_binding( T*, Archive*, BindingTag, adl_tag ); \
} }
Registers a specific Archive type with cereal.
This registration should be done once per archive. A good place to put this is immediately following the definition of your archive. Archive registration is only strictly necessary if you wish to support pointers to polymorphic data types. All archives that come with cereal are already registered.
◆ Flags
Special flags for archives.
AllowEmptyClassElision This allows for empty classes to be serialized even if they do not provide a serialization function. Classes with no data members are considered to be empty. Be warned that if this is enabled and you attempt to serialize an empty class with improperly formed serialize or load/save functions, no static error will occur - the error will propogate silently and your intended serialization functions may not be called. You can manually ensure that your classes that have custom serialization are correct by using the traits is_output_serializable and is_input_serializable in cereal/details/traits.hpp.
◆ epilogue()
template<class Archive , class T >
void cereal::epilogue |
( |
Archive & |
, |
|
|
T const & |
|
|
) |
| |
|
inline |
Called after a type is serialized to tear down any special archive state for processing some type
◆ prologue()
template<class Archive , class T >
void cereal::prologue |
( |
Archive & |
, |
|
|
T const & |
|
|
) |
| |
|
inline |
Called before a type is serialized to set up any special archive state for processing some type
If designing a serializer that needs to set up any kind of special state or output extra information for a type, specialize this function for the archive type and the types that require the extra information.
◆ swap_bytes()
template<std::size_t DataSize>
void cereal::portable_binary_detail::swap_bytes |
( |
std::uint8_t * |
data | ) |
|
|
inline |
Swaps the order of bytes for some chunk of memory.
- Parameters
-
data | The data as a uint8_t pointer |
- Template Parameters
-
DataSize | The true size of the data |