| cereal::InputArchive< ArchiveType, Flags >(3) | Library Functions Manual | cereal::InputArchive< ArchiveType, Flags >(3) |
NAME
cereal::InputArchive< ArchiveType, Flags > - The base input archive class.
SYNOPSIS
#include </home/build/include/cereal/cereal.hpp>
Inherits cereal::detail::InputArchiveBase.
Public Member Functions
InputArchive (ArchiveType *const derived)
Construct the output archive. InputArchive & operator=
(InputArchive const &)=delete
template<class ... Types> ArchiveType & operator() (Types
&&... args)
Serializes all passed in data. void serializeDeferments ()
Serializes any data marked for deferment using defer. std::shared_ptr< void
> getSharedPointer (std::uint32_t const id)
Retrieves a shared pointer given a unique key for it. void
registerSharedPointer (std::uint32_t const id, std::shared_ptr<
void > ptr)
Registers a shared pointer to its unique identifier. std::string
getPolymorphicName (std::uint32_t const id)
Retrieves the string for a polymorphic type given a unique key for it. void
registerPolymorphicName (std::uint32_t const id, std::string const
&name)
Registers a polymorphic name string to its unique identifier.
Public Member Functions inherited from
cereal::detail::InputArchiveBase
InputArchiveBase (InputArchiveBase &&) CEREAL_NOEXCEPT
InputArchiveBase & operator= (InputArchiveBase &&)
CEREAL_NOEXCEPT
Friends
template<class A, class B, bool C, bool D, bool E, bool F>
struct detail::Construct
Befriend for versioning in load_and_construct.
Boost Transition Layer
Functionality that mirrors the syntax for Boost. This is useful if
you are transitioning a large project from Boost to cereal. The preferred
interface for cereal is using operator().
using is_loading = std::true_type
Indicates this archive is intended for loading. using is_saving =
std::false_type
Indicates this archive is not intended for saving. template<class T>
ArchiveType & operator& (T &&arg)
Serializes passed in data. template<class T> ArchiveType &
operator>> (T &&arg)
Serializes passed in data.
Detailed Description
template<class ArchiveType, std::uint32_t Flags = 0>
class cereal::InputArchive< ArchiveType, Flags >"The base input archive class.
This is the base input archive for all input 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
Flags Flags to control advanced functionality. See the Flags enum for more information.
Member Typedef Documentation
template<class ArchiveType, std::uint32_t Flags = 0> using cereal::InputArchive< ArchiveType, Flags >::is_loading = std::true_type
Indicates this archive is intended for loading. This ensures compatibility with boost archive types. If you are transitioning from boost, you can check this value within a member or external serialize function (i.e., Archive::is_loading::value) to enable behavior specific to loading, until you can transition to split save/load or save_minimal/load_minimal functions
template<class ArchiveType, std::uint32_t Flags = 0> using cereal::InputArchive< ArchiveType, Flags >::is_saving = std::false_type
Indicates this archive is not intended for saving. This ensures compatibility with boost archive types. If you are transitioning from boost, you can check this value within a member or external serialize function (i.e., Archive::is_saving::value) to disable behavior specific to loading, until you can transition to split save/load or save_minimal/load_minimal functions
Constructor & Destructor Documentation
template<class ArchiveType, std::uint32_t Flags = 0> cereal::InputArchive< ArchiveType, Flags >::InputArchive (ArchiveType *const derived) [inline]
Construct the output archive.
Parameters
Member Function Documentation
template<class ArchiveType, std::uint32_t Flags = 0> std::string cereal::InputArchive< ArchiveType, Flags >::getPolymorphicName (std::uint32_t const id) [inline]
Retrieves the string for a polymorphic type given a unique key for it. This is used to retrieve a string previously registered during a polymorphic load.
template<class ArchiveType, std::uint32_t Flags = 0> std::shared_ptr< void > cereal::InputArchive< ArchiveType, Flags >::getSharedPointer (std::uint32_t const id) [inline]
Retrieves a shared pointer given a unique key for it. This is used to retrieve a previously registered shared_ptr which has already been loaded.
template<class ArchiveType, std::uint32_t Flags = 0> template<class T> ArchiveType & cereal::InputArchive< ArchiveType, Flags >::operator& (T && arg) [inline]
Serializes passed in data. This is a boost compatability layer and is not the preferred way of using cereal. If you are transitioning from boost, use this until you can transition to the operator() overload
template<class ArchiveType, std::uint32_t Flags = 0> template<class ... Types> ArchiveType & cereal::InputArchive< ArchiveType, Flags >::operator() (Types &&... args) [inline]
Serializes all passed in data. This is the primary interface for serializing data with an archive
template<class ArchiveType, std::uint32_t Flags = 0> template<class T> ArchiveType & cereal::InputArchive< ArchiveType, Flags >::operator>> (T && arg) [inline]
Serializes passed in data. This is a boost compatability layer and is not the preferred way of using cereal. If you are transitioning from boost, use this until you can transition to the operator() overload
template<class ArchiveType, std::uint32_t Flags = 0> void cereal::InputArchive< ArchiveType, Flags >::registerPolymorphicName (std::uint32_t const id, std::string const & name) [inline]
Registers a polymorphic name string to its unique identifier. After a polymorphic type has been loaded for the first time, it should be registered with its loaded id for future references to it.
template<class ArchiveType, std::uint32_t Flags = 0> void cereal::InputArchive< ArchiveType, Flags >::registerSharedPointer (std::uint32_t const id, std::shared_ptr< void > ptr) [inline]
Registers a shared pointer to its unique identifier. After a shared pointer has been allocated for the first time, it should be registered with its loaded id for future references to it.
template<class ArchiveType, std::uint32_t Flags = 0> void cereal::InputArchive< ArchiveType, Flags >::serializeDeferments () [inline]
Serializes any data marked for deferment using defer. This will cause any data wrapped in DeferredData to be immediately serialized
Author
Generated automatically by Doxygen for cereal from the source code.
| Mon Oct 26 2026 20:39:03 | cereal |