cereal
A C++11 library for serialization
|
Used to construct types with no default constructor. More...
#include </build/libcereal-SAfJB3/libcereal-1.3.2+dfsg/include/cereal/access.hpp>
Public Member Functions | |
template<class ... Args> | |
void | operator() (Args &&... args) |
Construct and initialize the type T with the given arguments. More... | |
T * | operator-> () |
Get a reference to the initialized underlying object. More... | |
T * | ptr () |
Returns a raw pointer to the initialized underlying object. More... | |
Friends | |
template<class Ar , class TT > | |
struct | ::cereal::memory_detail::LoadAndConstructLoadWrapper |
template<class Ar , class TT > | |
struct | ::cereal::boost_variant_detail::LoadAndConstructLoadWrapper |
Used to construct types with no default constructor.
When serializing a type that has no default constructor, cereal will attempt to call either the class static function load_and_construct or the appropriate template specialization of LoadAndConstruct. cereal will pass that function a reference to the archive as well as a reference to a construct object which should be used to perform the allocation once data has been appropriately loaded.
T | The class type being serialized |
|
inline |
Construct and initialize the type T with the given arguments.
This will forward all arguments to the underlying type T, calling an appropriate constructor.
Calling this function more than once will result in an exception being thrown.
args | The arguments to the constructor for T |
Exception | If called more than once |
|
inline |
Get a reference to the initialized underlying object.
This must be called after the object has been initialized.
Exception | If called before initialization |
|
inline |
Returns a raw pointer to the initialized underlying object.
This is mainly intended for use with passing an instance of a constructed object to cereal::base_class.
It is strongly recommended to avoid using this function in any other circumstance.