cereal
A C++11 library for serialization
Classes | Macros | Enumerations | Functions
cereal.hpp File Reference

Main cereal functionality. More...

#include <type_traits>
#include <string>
#include <memory>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstddef>
#include <cstdint>
#include "cereal/macros.hpp"
#include "cereal/details/traits.hpp"
#include "cereal/details/helpers.hpp"
#include "cereal/types/base_class.hpp"
#include "cereal/types/common.hpp"

Go to the source code of this file.

Classes

class  cereal::OutputArchive< ArchiveType, Flags >
 The base output archive class. More...
 
class  cereal::InputArchive< ArchiveType, Flags >
 The base input archive class. More...
 

Macros

#define CEREAL_NVP(T)   ::cereal::make_nvp(#T, T)
 Creates a name value pair for the variable T with the same name as the variable.
 
#define CEREAL_REGISTER_ARCHIVE(Archive)
 Registers a specific Archive type with cereal. More...
 
#define CEREAL_UNUSED_FUNCTION   static void unused() { (void)version; }
 Helper macro to omit unused warning.
 
#define CEREAL_CLASS_VERSION(TYPE, VERSION_NUMBER)
 Defines a class version for some type. More...
 
#define PROCESS_IF(name)
 Helper macro that expands the requirements for activating an overload. More...
 
#define PROCESS_IF(name)
 Helper macro that expands the requirements for activating an overload. More...
 

Enumerations

enum  cereal::Flags { AllowEmptyClassElision = 1 }
 Special flags for archives. More...
 

Functions

template<class Archive , class T >
void cereal::prologue (Archive &, T const &)
 
template<class Archive , class T >
void cereal::epilogue (Archive &, T const &)
 

Detailed Description

Main cereal functionality.

Macro Definition Documentation

◆ PROCESS_IF [1/2]

#define PROCESS_IF (   name)
Value:
traits::EnableIf<traits::has_##name<T, ArchiveType>::value, \
!traits::has_invalid_output_versioning<T, ArchiveType>::value, \
(traits::is_output_serializable<T, ArchiveType>::value && \
(traits::is_specialized_##name<T, ArchiveType>::value || \
!traits::is_specialized<T, ArchiveType>::value))> = traits::sfinae

Helper macro that expands the requirements for activating an overload.

Requirements: Has the requested serialization function Does not have version and unversioned at the same time Is output serializable AND is specialized for this type of function OR has no specialization at all

Requirements: Has the requested serialization function Does not have version and unversioned at the same time Is input serializable AND is specialized for this type of function OR has no specialization at all

◆ PROCESS_IF [2/2]

#define PROCESS_IF (   name)
Value:
traits::EnableIf<traits::has_##name<T, ArchiveType>::value, \
!traits::has_invalid_input_versioning<T, ArchiveType>::value, \
(traits::is_input_serializable<T, ArchiveType>::value && \
(traits::is_specialized_##name<T, ArchiveType>::value || \
!traits::is_specialized<T, ArchiveType>::value))> = traits::sfinae

Helper macro that expands the requirements for activating an overload.

Requirements: Has the requested serialization function Does not have version and unversioned at the same time Is output serializable AND is specialized for this type of function OR has no specialization at all

Requirements: Has the requested serialization function Does not have version and unversioned at the same time Is input serializable AND is specialized for this type of function OR has no specialization at all