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

An output archive designed to save data in a compact binary representation portable over different architectures. More...

#include </build/libcereal-m2n5tT/libcereal-1.1.2/include/cereal/archives/portable_binary.hpp>

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

Public Member Functions

 PortableBinaryOutputArchive (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< PortableBinaryOutputArchive, AllowEmptyClassElision >
 OutputArchive (PortableBinaryOutputArchive *const derived)
 Construct the output archive. More...
 
OutputArchiveoperator= (OutputArchive const &)=delete
 
PortableBinaryOutputArchiveoperator() (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...
 
PortableBinaryOutputArchiveoperator& (T &&arg)
 Serializes passed in data. More...
 
PortableBinaryOutputArchiveoperator<< (T &&arg)
 Serializes passed in data. More...
 

Detailed Description

An output archive designed to save data in a compact binary representation portable over different architectures.

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

This archive will record the endianness of the data and assuming that the user takes care of ensuring serialized types are the same size across machines, is portable over different architectures.

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.

Warning
This archive has not been thoroughly tested across different architectures. Please report any issues, optimizations, or feature requests at the project github.

Constructor & Destructor Documentation

cereal::PortableBinaryOutputArchive::PortableBinaryOutputArchive ( 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: