cereal
A C++11 library for serialization
Public Member Functions | List of all members
cereal::BinaryOutputArchive Class Reference

An output archive designed to save data in a compact binary representation. More...

#include </home/shane/workspace/cereal/include/cereal/archives/binary.hpp>

Inheritance diagram for cereal::BinaryOutputArchive:
cereal::OutputArchive< BinaryOutputArchive, AllowEmptyClassElision > cereal::detail::OutputArchiveBase

Public Member Functions

 BinaryOutputArchive (std::ostream &stream)
 Construct, outputting to the provided stream. More...
 
void saveBinary (const void *data, std::size_t size)
 Writes size bytes of data to the output stream.
 
- Public Member Functions inherited from cereal::OutputArchive< BinaryOutputArchive, AllowEmptyClassElision >
 OutputArchive (BinaryOutputArchive *const derived)
 Construct the output archive. More...
 
OutputArchiveoperator= (OutputArchive const &)=delete
 
BinaryOutputArchiveoperator() (Types &&...args)
 Serializes all passed in data. More...
 
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...
 
BinaryOutputArchiveoperator& (T &&arg)
 Serializes passed in data. More...
 
BinaryOutputArchiveoperator<< (T &&arg)
 Serializes passed in data. More...
 
- Public Member Functions inherited from cereal::detail::OutputArchiveBase
 OutputArchiveBase (OutputArchiveBase &&) CEREAL_NOEXCEPT
 
OutputArchiveBaseoperator= (OutputArchiveBase &&) CEREAL_NOEXCEPT
 

Additional Inherited Members

- Public Types inherited from cereal::OutputArchive< BinaryOutputArchive, AllowEmptyClassElision >
using is_loading = std::false_type
 Indicates this archive is not intended for loading. More...
 
using is_saving = std::true_type
 Indicates this archive is intended for saving. More...
 

Detailed Description

An output archive designed to save data in a compact binary representation.

This archive outputs data to a stream in an extremely compact binary representation with as little extra metadata as possible.

This archive does nothing to ensure that the endianness of the saved and loaded data is the same. If you need to have portability over architectures with different endianness, use PortableBinaryOutputArchive.

When using a binary archive and a file stream, you must use the std::ios::binary format flag to avoid having your data altered inadvertently.

Constructor & Destructor Documentation

cereal::BinaryOutputArchive::BinaryOutputArchive ( std::ostream &  stream)
inline

Construct, outputting to the provided stream.

Parameters
streamThe stream to output to. Can be a stringstream, a file stream, or even cout!

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