pointer_variant_wrapper.hpp File Reference
Include dependency graph for pointer_variant_wrapper.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  load_visitor< T >
 
class  PointerVariantWrapper< VariantTypes >
 The objective of this class is to create a wrapper for boost::variant. More...

 
class  PointerVariantWrapper< VariantTypes >
 The objective of this class is to create a wrapper for boost::variant. More...

 
struct  save_visitor< Archive >
 

Namespaces

 cereal
 

Macros

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

 

Functions

template<typename... VariantTypes>
PointerVariantWrapper< VariantTypes... > make_pointer_variant (boost::variant< VariantTypes... > &t)
 Serialize a boost variant in which the variant it self is a raw pointer. More...

 

Detailed Description

Author
Omar Shrit

Implementation of a boost::variant wrapper to enable the serialization of the pointers inside boost variant 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_variant_wrapper.hpp.

Macro Definition Documentation

◆ CEREAL_VARIANT_POINTER

#define CEREAL_VARIANT_POINTER (   T)    cereal::make_pointer_variant(T)

Cereal does not support the serialization of raw pointer.

This macro enable developers to serialize boost::variant that holds raw pointers by using the above PointerVariantWrapper class which replace the internal raw pointers by smart pointer internally.

Parameters
Tboost::variant that holds raw pointer to be serialized.

Definition at line 155 of file pointer_variant_wrapper.hpp.

Referenced by PointerVectorVariantWrapper< VariantTypes >::load(), and PointerVectorVariantWrapper< VariantTypes >::save().