pointer_wrapper.hpp File Reference
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.


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





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



PointerWrapper< T > make_pointer (T *&t)
 Serialize raw pointer object by encapsulating the pointer into a smart pointer. More...

template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)

Detailed Description

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.

Definition in file pointer_wrapper.hpp.

Macro Definition Documentation


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

TRaw pointer to be serialized.

Definition at line 96 of file pointer_wrapper.hpp.

Referenced by PointerVectorWrapper< T >::load(), ModelToString(), PointerVectorWrapper< T >::save(), ScalingModel::serialize(), AdaBoostModel::serialize(), HoeffdingTreeModel::serialize(), HMMModel::serialize(), and mlpack::SerializePointerObject().