cereal
A C++11 library for serialization
|
Creates a binding (map entry) between an output archive type and a polymorphic type. More...
#include </home/shane/workspace/cereal/include/cereal/details/polymorphic_impl.hpp>
Classes | |
class | PolymorphicSharedPointerWrapper |
Holds a properly typed shared_ptr to the polymorphic type. More... | |
Public Member Functions | |
OutputBindingCreator () | |
Initialize the binding. | |
Static Public Member Functions | |
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. More... | |
static void | savePolymorphicSharedPtr (Archive &ar, T const *dptr, std::false_type) |
Does the actual work of saving a polymorphic shared_ptr. More... | |
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
|
inlinestatic |
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.
ar | The archive to serialize to |
dptr | Pointer to the actual data held by the shared_ptr |
|
inlinestatic |
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
ar | The archive to serialize to |
dptr | Pointer to the actual data held by the shared_ptr |