cereal
A C++11 library for serialization
Classes | Macros | Enumerations
Access Control and Disambiguation

Provides ways to give cereal access to protected member functions, disambiguate which serialization function cereal should use, and provide ways of using smart pointers with types that have no default constructor. More...

Classes

struct  cereal::LoadAndConstruct< T >
 A class that allows cereal to load smart pointers to types that have no default constructor. More...
 
class  cereal::access
 A class that can be made a friend to give cereal access to non public functions. More...
 
struct  cereal::specialize< Archive, T, S >
 A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class. More...
 

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...
 

Enumerations

enum  cereal::specialization
 

Detailed Description

Provides ways to give cereal access to protected member functions, disambiguate which serialization function cereal should use, and provide ways of using smart pointers with types that have no default constructor.

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 );

◆ 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 );

Enumeration Type Documentation

◆ specialization

template<class Archive , class T , specialization S>
enum specialization
related

A specifier used in conjunction with cereal::specialize to disambiguate serialization in special cases

cereal::XMLInputArchive
An output archive designed to load data from XML.
Definition: xml.hpp:405
CEREAL_SPECIALIZE_FOR_ARCHIVE
#define CEREAL_SPECIALIZE_FOR_ARCHIVE(Archive, Type, Specialization)
Convenient macro for performing specialization for a single archive type.
Definition: specialize.hpp:135
CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES
#define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES(Type, Specialization)
Convenient macro for performing specialization for all archive types.
Definition: specialize.hpp:121