|
cereal_fwd
Fork of cereal library adding archive supporting forward compatibility
|
The base input archive class. More...
#include </home/breiker/code/git/cereal_fwd_github/include/cereal/cereal.hpp>
Public Types | |
| using | is_saving = std::false_type |
| indicates if archive is used for saving | |
| using | is_loading = std::true_type |
| indicates if archive is used for loading | |
Public Member Functions | |
| InputArchive (ArchiveType *const derived) | |
| Construct the input archive. More... | |
| InputArchive & | operator= (InputArchive const &)=delete |
| template<class ... Types> | |
| ArchiveType & | operator() (Types &&... args) |
| Serializes all passed in data. More... | |
| std::shared_ptr< void > | getSharedPointer (std::uint32_t const id) |
| Retrieves a shared pointer given a unique key for it. More... | |
| void | registerSharedPointer (std::uint32_t const id, std::shared_ptr< void > ptr) |
| Registers a shared pointer to its unique identifier. More... | |
| std::string | getPolymorphicName (std::uint32_t const id) |
| Retrieves the string for a polymorphic type given a unique key for it. More... | |
| void | registerPolymorphicName (std::uint32_t const id, std::string const &name) |
| Registers a polymorphic name string to its unique identifier. More... | |
| bool | wasSerialized () const |
| Indicates if last field was loaded. More... | |
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(). | |
| template<class T > | |
| ArchiveType & | operator & (T &&arg) |
| Serializes passed in data. More... | |
| template<class T > | |
| ArchiveType & | operator>> (T &&arg) |
| Serializes passed in data. More... | |
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. | |
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.
| ArchiveType | The archive type that derives from InputArchive |
| Flags | Flags to control advanced functionality. See the Flags enum for more information. |
|
inline |
Construct the input archive.
| derived | A pointer to the derived ArchiveType (pass this from the derived archive) |
|
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.
| id | The unique id that was serialized for the polymorphic type |
|
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.
| id | The unique id that was serialized for the pointer |
| Exception | if the id does not exist |
|
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
|
inline |
Serializes all passed in data.
This is the primary interface for serializing data with an archive
|
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
|
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.
| id | The unique identifier for the polymorphic type |
| name | The name associated with the tyep |
|
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.
| id | The unique identifier for the shared pointer |
| ptr | The actual shared pointer |
|
inline |
Indicates if last field was loaded.
Always true for archives not supporting forward compatibility flag. For other archives returns false if field was not saved. It means that OmittedTag was used on the saving side. Truth table: T - type is written/read O - OmittedTag is used |Writing side | Reading side | Return value | | T | T | true | | O | O | false | | T | O | true | | O | T | false |
1.8.13