.TH "cereal::PortableBinaryOutputArchive" 3 "Mon Oct 26 2026 02:55:37" "cereal" \" -*- nroff -*- .ad l .nh .SH NAME cereal::PortableBinaryOutputArchive \- An output archive designed to save data in a compact binary representation portable over different architectures\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBcereal::OutputArchive< PortableBinaryOutputArchive, AllowEmptyClassElision >\fP\&. .SS "Classes" .in +1c .ti -1c .RI "class \fBOptions\fP" .br .RI "A class containing various advanced options for the PortableBinaryOutput archive\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBPortableBinaryOutputArchive\fP (std::ostream &stream, \fBOptions\fP const &options=\fBOptions::Default\fP())" .br .RI "Construct, outputting to the provided stream\&. " .ti -1c .RI "template void \fBsaveBinary\fP (const void *data, std::streamsize size)" .br .RI "Writes size bytes of data to the output stream\&. " .in -1c Public Member Functions inherited from \fBcereal::OutputArchive< PortableBinaryOutputArchive, AllowEmptyClassElision >\fP .in +1c .ti -1c .RI "\fBOutputArchive\fP (\fBPortableBinaryOutputArchive\fP *const derived)" .br .RI "Construct the output archive\&. " .ti -1c .RI "\fBOutputArchive\fP & \fBoperator=\fP (\fBOutputArchive\fP const &)=delete" .br .ti -1c .RI "\fBPortableBinaryOutputArchive\fP & \fBoperator()\fP (Types &&\&.\&.\&. args)" .br .RI "Serializes all passed in data\&. " .ti -1c .RI "void \fBserializeDeferments\fP ()" .br .RI "Serializes any data marked for deferment using defer\&. " .ti -1c .RI "std::uint32_t \fBregisterSharedPointer\fP (const std::shared_ptr< const void > &sharedPointer)" .br .RI "Registers a shared pointer with the archive\&. " .ti -1c .RI "std::uint32_t \fBregisterPolymorphicType\fP (char const *name)" .br .RI "Registers a polymorphic type name with the archive\&. " .in -1c .in +1c .ti -1c .RI "\fBPortableBinaryOutputArchive\fP & \fBoperator&\fP (T &&arg)" .br .RI "Serializes passed in data\&. " .in -1c .in +1c .ti -1c .RI "\fBPortableBinaryOutputArchive\fP & \fBoperator<<\fP (T &&arg)" .br .RI "Serializes passed in data\&. " .in -1c Public Member Functions inherited from \fBcereal::detail::OutputArchiveBase\fP .in +1c .ti -1c .RI "\fBOutputArchiveBase\fP (OutputArchiveBase &&) \fBCEREAL_NOEXCEPT\fP" .br .ti -1c .RI "OutputArchiveBase & \fBoperator=\fP (OutputArchiveBase &&) \fBCEREAL_NOEXCEPT\fP" .br .in -1c .SS "Additional Inherited Members" .in +1c .ti -1c .RI "using \fBis_loading\fP" .br .RI "Indicates this archive is not intended for loading\&. " .in -1c .in +1c .ti -1c .RI "using \fBis_saving\fP" .br .RI "Indicates this archive is intended for saving\&. " .in -1c .SH "Detailed Description" .PP 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\&. .PP This archive will record the endianness of the data as well as the desired in/out endianness and assuming that the user takes care of ensuring serialized types are the same size across machines, is portable over different architectures\&. .PP 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\&. .PP \fBWarning\fP .RS 4 This archive has not been thoroughly tested across different architectures\&. Please report any issues, optimizations, or feature requests at \fRthe project github\fP\&. .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "cereal::PortableBinaryOutputArchive::PortableBinaryOutputArchive (std::ostream & stream, \fBOptions\fP const & options = \fR\fBOptions::Default\fP()\fP)\fR [inline]\fP" .PP Construct, outputting to the provided stream\&. .PP \fBParameters\fP .RS 4 \fIstream\fP The stream to output to\&. Should be opened with std::ios::binary flag\&. .br \fIoptions\fP The PortableBinary specific options to use\&. See the \fBOptions\fP struct for the values of default parameters .RE .PP .SH "Author" .PP Generated automatically by Doxygen for cereal from the source code\&.