mlpack
Classes | Namespaces | Macros | Functions
pointer_variant_wrapper.hpp File Reference
#include <cereal/archives/json.hpp>
#include <cereal/archives/portable_binary.hpp>
#include <cereal/archives/xml.hpp>
#include <cereal/types/boost_variant.hpp>
#include <boost/variant.hpp>
#include <boost/variant/variant_fwd.hpp>
#include <boost/variant/static_visitor.hpp>
#include "pointer_wrapper.hpp"
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

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

Namespaces

 cereal
 Add an external serialization function for SpMat.
 

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... > cereal::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.

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.