NDDEM
Classes | Namespaces | Macros
specialize.hpp File Reference

Serialization disambiguation. More...

Go to the source code of this file.

Classes

struct  cereal::specialize< Archive, T, S >
 A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class. More...
 

Namespaces

 cereal
 in certain simple scenarios. They should probably not be used if maximizing performance is the main objective.
 

Macros

#define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES(Type, Specialization)    namespace cereal { template <class Archive> struct specialize<Archive, Type, Specialization> {}; }
 Convenient macro for performing specialization for all archive types. More...
 
#define CEREAL_SPECIALIZE_FOR_ARCHIVE(Archive, Type, Specialization)    namespace cereal { template <> struct specialize<Archive, Type, Specialization> {}; }
 Convenient macro for performing specialization for a single archive type. More...
 

Detailed Description

Serialization disambiguation.

Macro Definition Documentation

◆ CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES

#define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES (   Type,
  Specialization 
)     namespace cereal { template <class Archive> struct specialize<Archive, Type, Specialization> {}; }

Convenient macro for performing specialization for all archive types.

This performs specialization for the specific type for all types of archives. This macro should be placed at the global namespace.

struct MyType {};
CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( MyType, cereal::specialization::member_load_save );
#define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES(Type, Specialization)
Convenient macro for performing specialization for all archive types.
Definition: specialize.hpp:121

◆ CEREAL_SPECIALIZE_FOR_ARCHIVE

#define CEREAL_SPECIALIZE_FOR_ARCHIVE (   Archive,
  Type,
  Specialization 
)     namespace cereal { template <> struct specialize<Archive, Type, Specialization> {}; }

Convenient macro for performing specialization for a single archive type.

This performs specialization for the specific type for a single type of archive. This macro should be placed at the global namespace.

struct MyType {};
CEREAL_SPECIALIZE_FOR_ARCHIVE( cereal::XMLInputArchive, MyType, cereal::specialization::member_load_save );
An output archive designed to load data from XML.
Definition: xml.hpp:406
#define CEREAL_SPECIALIZE_FOR_ARCHIVE(Archive, Type, Specialization)
Convenient macro for performing specialization for a single archive type.
Definition: specialize.hpp:135