cereal
A C++11 library for serialization
 All Classes Files Functions Variables Typedefs Enumerations Groups
Public Member Functions | List of all members
cereal::OutputArchive< ArchiveType, Flags > Class Template Reference

The base output archive class. More...

#include <cereal/cereal.hpp>

Inheritance diagram for cereal::OutputArchive< ArchiveType, Flags >:
cereal::detail::OutputArchiveBase

Public Member Functions

 OutputArchive (ArchiveType *const self)
 Construct the output archive. More...
 
template<class... Types>
ArchiveType & operator() (Types &&...args)
 Serializes all passed in data.
 
std::uint32_t registerSharedPointer (void const *addr)
 Registers a shared pointer with the archive. More...
 
std::uint32_t registerPolymorphicType (char const *name)
 Registers a polymorphic type name with the archive. More...
 

Detailed Description

template<class ArchiveType, std::uint32_t Flags = 0>
class cereal::OutputArchive< ArchiveType, Flags >

The base output archive class.

This is the base output archive for all output archives. If you create a custom archive class, it should derive from this, passing itself as a template parameter for the ArchiveType.

The base class provides all of the functionality necessary to properly forward data to the correct serialization functions.

Individual archives should use a combination of prologue and epilogue functions together with specializations of serialize, save, and load to alter the functionality of their serialization.

Template Parameters
ArchiveTypeThe archive type that derives from OutputArchive
FlagsFlags to control advanced functionality. See the Flags enum for more information.

Constructor & Destructor Documentation

template<class ArchiveType, std::uint32_t Flags = 0>
cereal::OutputArchive< ArchiveType, Flags >::OutputArchive ( ArchiveType *const  self)
inline

Construct the output archive.

Parameters
selfA pointer to the derived ArchiveType (pass this from the derived archive)

Member Function Documentation

template<class ArchiveType, std::uint32_t Flags = 0>
std::uint32_t cereal::OutputArchive< ArchiveType, Flags >::registerPolymorphicType ( char const *  name)
inline

Registers a polymorphic type name with the archive.

This function is used to track polymorphic types to prevent unnecessary saves of identifying strings used by the polymorphic support functionality.

Parameters
nameThe name to associate with a polymorphic type
Returns
A key that uniquely identifies the polymorphic type name
template<class ArchiveType, std::uint32_t Flags = 0>
std::uint32_t cereal::OutputArchive< ArchiveType, Flags >::registerSharedPointer ( void const *  addr)
inline

Registers a shared pointer with the archive.

This function is used to track shared pointer targets to prevent unnecessary saves from taking place if multiple shared pointers point to the same data.

Parameters
addrThe address (see shared_ptr get()) pointed to by the shared pointer
Returns
A key that uniquely identifies the pointer

The documentation for this class was generated from the following file: