mlpack
Classes | Namespaces | Macros | Functions
pointer_wrapper.hpp File Reference
#include <cereal/archives/binary.hpp>
#include <cereal/archives/json.hpp>
#include <cereal/archives/portable_binary.hpp>
#include <cereal/archives/xml.hpp>
#include <cereal/types/memory.hpp>
Include dependency graph for pointer_wrapper.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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. More...
 

Namespaces

 cereal
 Add an external serialization function for SpMat.
 

Macros

#define CEREAL_POINTER(T)   cereal::make_pointer(T)
 Cereal does not support the serialization of raw pointer. More...
 

Functions

template<typename T , typename... Args>
std::unique_ptr< T > std::make_unique (Args &&... args)
 
template<class T >
PointerWrapper< T > cereal::make_pointer (T *&t)
 Serialize raw pointer object by encapsulating the pointer into a smart pointer. More...
 

Detailed Description

Author
Omar Shrit

Implementation of a pointer wrapper to enable the serialization of raw pointers in cereal

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Macro Definition Documentation

◆ CEREAL_POINTER

#define CEREAL_POINTER (   T)    cereal::make_pointer(T)

Cereal does not support the serialization of raw pointer.

This macro enable developers to serialize a raw pointer by using the above PointerWrapper class which replace the raw pointer by a smart pointer internally.

Parameters
TRaw pointer to be serialized.