OS Manuals

cereal_detail_OutputBindingCreator(3)

cereal::detail::OutputBindingCreator< Archive, T > - Creates a binding (map entry) between an output archive type and a polymorphic type.

cereal::detail::OutputBindingCreator< Archive, T >(3) Library Functions Manual cereal::detail::OutputBindingCreator< Archive, T >(3)

cereal::detail::OutputBindingCreator< Archive, T > - Creates a binding (map entry) between an output archive type and a polymorphic type.

#include </home/build/include/cereal/details/polymorphic_impl.hpp>


class PolymorphicSharedPointerWrapper
Holds a properly typed shared_ptr to the polymorphic type.


OutputBindingCreator ()
Initialize the binding.


static void writeMetadata (Archive &ar)
Writes appropriate metadata to the archive for this polymorphic type. static void savePolymorphicSharedPtr (Archive &ar, T const *dptr, std::true_type)
Does the actual work of saving a polymorphic shared_ptr. static void savePolymorphicSharedPtr (Archive &ar, T const *dptr, std::false_type)
Does the actual work of saving a polymorphic shared_ptr.

struct cereal::detail::OutputBindingCreator< Archive, T >"Creates a binding (map entry) between an output archive type and a polymorphic type.

Bindings are made when types are registered, assuming that at least one archive has already been registered. When this struct is created, it will insert (at run time) an entry into a map that properly handles casting for serializing polymorphic objects

template<class Archive, class T> void cereal::detail::OutputBindingCreator< Archive, T >::savePolymorphicSharedPtr (Archive & ar, T const * dptr, std::false_type ) [inline], [static]

Does the actual work of saving a polymorphic shared_ptr. This function will properly create a shared_ptr from the void * that is passed in before passing it to the archive for serialization.

This version is for types that do not inherit from std::enable_shared_from_this.

Parameters

ar The archive to serialize to
dptr Pointer to the actual data held by the shared_ptr

template<class Archive, class T> void cereal::detail::OutputBindingCreator< Archive, T >::savePolymorphicSharedPtr (Archive & ar, T const * dptr, std::true_type ) [inline], [static]

Does the actual work of saving a polymorphic shared_ptr. This function will properly create a shared_ptr from the void * that is passed in before passing it to the archive for serialization.

In addition, this will also preserve the state of any internal enable_shared_from_this mechanisms

Parameters

ar The archive to serialize to
dptr Pointer to the actual data held by the shared_ptr

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 20:39:03 cereal

cereal 1.3.2-r8 · enterprise-packages · ingested 2026-10-27