PointerWrapper< T > Class Template Reference

The objective of this class is to create a wrapper for raw pointer by encapsulating them in a smart pointer of type unique_ptr. More...

Public Member Functions

 PointerWrapper (T *&pointer)
 
template
<
class
Archive
>
void load (Archive &ar, const uint32_t)
 
T *& release ()
 
template
<
class
Archive
>
void save (Archive &ar, const uint32_t) const
 

Detailed Description


template
<
class
T
>

class cereal::PointerWrapper< T >

The objective of this class is to create a wrapper for raw pointer by encapsulating them in a smart pointer of type unique_ptr.

Cereal does not support the serialization of raw pointer out of the box. Therefore, we have created this wrapper to serialize raw pointer in cereal as a smart pointer since because it will be difficult to change all pointer type in mlpack.

Definition at line 44 of file pointer_wrapper.hpp.

Constructor & Destructor Documentation

◆ PointerWrapper()

PointerWrapper ( T *&  pointer)
inline

Definition at line 47 of file pointer_wrapper.hpp.

Member Function Documentation

◆ load()

void load ( Archive &  ar,
const uint32_t   
)
inline

Definition at line 62 of file pointer_wrapper.hpp.

◆ release()

T*& release ( )
inline

Definition at line 69 of file pointer_wrapper.hpp.

◆ save()

void save ( Archive &  ar,
const uint32_t   
) const
inline

Definition at line 52 of file pointer_wrapper.hpp.


The documentation for this class was generated from the following file: