.TH "cereal::PortableBinaryInputArchive" 3 "Mon Oct 26 2026 02:55:37" "cereal" \" -*- nroff -*- .ad l .nh .SH NAME cereal::PortableBinaryInputArchive \- An input archive designed to load data saved using \fBPortableBinaryOutputArchive\fP\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBcereal::InputArchive< PortableBinaryInputArchive, AllowEmptyClassElision >\fP\&. .SS "Classes" .in +1c .ti -1c .RI "class \fBOptions\fP" .br .RI "A class containing various advanced options for the PortableBinaryInput archive\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBPortableBinaryInputArchive\fP (std::istream &stream, \fBOptions\fP const &options=\fBOptions::Default\fP())" .br .RI "Construct, loading from the provided stream\&. " .ti -1c .RI "template void \fBloadBinary\fP (void *const data, std::streamsize size)" .br .RI "Reads size bytes of data from the input stream\&. " .in -1c Public Member Functions inherited from \fBcereal::InputArchive< PortableBinaryInputArchive, AllowEmptyClassElision >\fP .in +1c .ti -1c .RI "\fBInputArchive\fP (\fBPortableBinaryInputArchive\fP *const derived)" .br .RI "Construct the output archive\&. " .ti -1c .RI "\fBInputArchive\fP & \fBoperator=\fP (\fBInputArchive\fP const &)=delete" .br .ti -1c .RI "\fBPortableBinaryInputArchive\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::shared_ptr< void > \fBgetSharedPointer\fP (std::uint32_t const id)" .br .RI "Retrieves a shared pointer given a unique key for it\&. " .ti -1c .RI "void \fBregisterSharedPointer\fP (std::uint32_t const id, std::shared_ptr< void > ptr)" .br .RI "Registers a shared pointer to its unique identifier\&. " .ti -1c .RI "std::string \fBgetPolymorphicName\fP (std::uint32_t const id)" .br .RI "Retrieves the string for a polymorphic type given a unique key for it\&. " .ti -1c .RI "void \fBregisterPolymorphicName\fP (std::uint32_t const id, std::string const &name)" .br .RI "Registers a polymorphic name string to its unique identifier\&. " .in -1c .in +1c .ti -1c .RI "\fBPortableBinaryInputArchive\fP & \fBoperator&\fP (T &&arg)" .br .RI "Serializes passed in data\&. " .in -1c .in +1c .ti -1c .RI "\fBPortableBinaryInputArchive\fP & \fBoperator>>\fP (T &&arg)" .br .RI "Serializes passed in data\&. " .in -1c Public Member Functions inherited from \fBcereal::detail::InputArchiveBase\fP .in +1c .ti -1c .RI "\fBInputArchiveBase\fP (InputArchiveBase &&) \fBCEREAL_NOEXCEPT\fP" .br .ti -1c .RI "InputArchiveBase & \fBoperator=\fP (InputArchiveBase &&) \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 intended for loading\&. " .in -1c .in +1c .ti -1c .RI "using \fBis_saving\fP" .br .RI "Indicates this archive is not intended for saving\&. " .in -1c .SH "Detailed Description" .PP An input archive designed to load data saved using \fBPortableBinaryOutputArchive\fP\&. This archive outputs data to a stream in an extremely compact binary representation with as little extra metadata as possible\&. .PP This archive will load the endianness of the serialized data and if necessary transform it to match that of the local machine\&. This comes at a significant performance cost compared to non portable archives if the transformation is necessary, and also causes a small performance hit even if it is not necessary\&. .PP It is recommended to use portable archives only if you know that you will be sending binary data to machines with different endianness\&. .PP The archive will do nothing to ensure types are the same size - that is the responsibility of the user\&. .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::PortableBinaryInputArchive::PortableBinaryInputArchive (std::istream & stream, \fBOptions\fP const & options = \fR\fBOptions::Default\fP()\fP)\fR [inline]\fP" .PP Construct, loading from the provided stream\&. .PP \fBParameters\fP .RS 4 \fIstream\fP The stream to read from\&. 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 "Member Function Documentation" .PP .SS "template void cereal::PortableBinaryInputArchive::loadBinary (void *const data, std::streamsize size)\fR [inline]\fP" .PP Reads size bytes of data from the input stream\&. .PP \fBParameters\fP .RS 4 \fIdata\fP The data to save .br \fIsize\fP The number of bytes in the data .RE .PP \fBTemplate Parameters\fP .RS 4 \fIDataSize\fP T The size of the actual type of the data elements being loaded .RE .PP .SH "Author" .PP Generated automatically by Doxygen for cereal from the source code\&.