mlpack  master
Classes | Namespaces | Functions
serialization_shim.hpp File Reference
Include dependency graph for serialization_shim.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mlpack::data::FirstArrayShim< T >
 A first shim for arrays. More...
 
struct  mlpack::data::FirstArrayShim< T >
 A first shim for arrays. More...
 
struct  mlpack::data::FirstNormalArrayShim< T >
 A first shim for arrays without a Serialize() method. More...
 
struct  mlpack::data::FirstNormalArrayShim< T >
 A first shim for arrays without a Serialize() method. More...
 
struct  mlpack::data::FirstShim< T >
 The first shim: simply holds the object and its name. More...
 
struct  mlpack::data::FirstShim< T >
 The first shim: simply holds the object and its name. More...
 
struct  mlpack::data::HasSerialize< T >
 
struct  mlpack::data::HasSerialize< T >::check< U, V, W >
 
struct  mlpack::data::HasSerializeFunction< T >
 
struct  mlpack::data::PointerShim< T >
 A shim for pointers. More...
 
struct  mlpack::data::PointerShim< T >
 A shim for pointers. More...
 
struct  mlpack::data::SecondArrayShim< T >
 A shim for objects in an array; this is basically like the SecondShim, but for arrays that hold objects that have Serialize() methods instead of serialize() methods. More...
 
struct  mlpack::data::SecondArrayShim< T >
 A shim for objects in an array; this is basically like the SecondShim, but for arrays that hold objects that have Serialize() methods instead of serialize() methods. More...
 
struct  mlpack::data::SecondNormalArrayShim< T >
 A shim for objects in an array which do not have a Serialize() function. More...
 
struct  mlpack::data::SecondNormalArrayShim< T >
 A shim for objects in an array which do not have a Serialize() function. More...
 
struct  mlpack::data::SecondShim< T >
 The second shim: wrap the call to Serialize() inside of a serialize() function, so that an archive type can call serialize() on a SecondShim object and this gets forwarded correctly to our object's Serialize() function. More...
 
struct  mlpack::data::SecondShim< T >
 The second shim: wrap the call to Serialize() inside of a serialize() function, so that an archive type can call serialize() on a SecondShim object and this gets forwarded correctly to our object's Serialize() function. More...
 

Namespaces

 boost
 
 boost::serialization
 
 mlpack
 Linear algebra utility functions, generally performed on matrices or vectors.
 
 mlpack::data
 Functions to load and save matrices and models.
 

Functions

template<typename T >
FirstArrayShim< T > mlpack::data::CreateArrayNVP (T *t, const size_t len, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
 Call this function to produce a name-value pair for an array; this is similar to boost::serialization::make_array(), but provides a nicer wrapper, allows types that have a Serialize() function, and allows you to give a name to your array. More...
 
template<typename T >
FirstNormalArrayShim< T > mlpack::data::CreateArrayNVP (T *t, const size_t len, const std::string &name, typename std::enable_if_t<!HasSerialize< T >::value > *=0)
 Call this function to produce a name-value pair for an array; this is similar to boost::serialization::make_array(), but provides a nicer wrapper, allows types that have a Serialize() function, and allows you to give a name to your array. More...
 
template<typename T >
FirstShim< T > mlpack::data::CreateNVP (T &t, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
 Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function. More...
 
template<typename T >
const boost::serialization::nvp< T > mlpack::data::CreateNVP (T &t, const std::string &name, typename std::enable_if_t<!HasSerialize< T >::value > *=0, typename std::enable_if_t<!std::is_pointer< T >::value > *=0)
 Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function. More...
 
template<typename T >
const boost::serialization::nvp< PointerShim< T > * > mlpack::data::CreateNVP (T *&t, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
 Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function. More...
 
template<typename T >
const boost::serialization::nvp< T * > mlpack::data::CreateNVP (T *&t, const std::string &name, typename std::enable_if_t<!HasSerialize< T >::value > *=0)
 Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function. More...
 
 mlpack::data::HAS_MEM_FUNC (Serialize, HasSerializeCheck)
 
template<typename Archive , typename T >
Archive & mlpack::data::operator& (Archive &ar, FirstShim< T > t)
 Catch when we call operator& with a FirstShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator& (Archive &ar, FirstArrayShim< T > t)
 Catch when we call operator& with a FirstArrayShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator& (Archive &ar, FirstNormalArrayShim< T > t)
 Catch when we call operator& with a FirstNormalArrayShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator<< (Archive &ar, FirstShim< T > t)
 Catch when we call operator<< with a FirstShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator<< (Archive &ar, FirstArrayShim< T > t)
 Catch when we call operator<< with a FirstArrayShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator<< (Archive &ar, FirstNormalArrayShim< T > t)
 Catch when we call operator<< with a FirstNormalArrayShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator>> (Archive &ar, FirstShim< T > t)
 Catch when we call operator>> with a FirstShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator>> (Archive &ar, FirstArrayShim< T > t)
 Catch when we call operator>> with a FirstArrayShim object. More...
 
template<typename Archive , typename T >
Archive & mlpack::data::operator>> (Archive &ar, FirstNormalArrayShim< T > t)
 Catch when we call operator>> with a FirstNormalArrayShim object. More...
 
template<typename Archive , typename T >
void boost::serialization::serialize (Archive &ar, mlpack::data::PointerShim< T > &t, const BOOST_PFTO unsigned int version)
 Catch a call to serialize() with a PointerShim, and call the Serialize() function directly. More...
 

Detailed Description

Author
Ryan Curtin

This file contains the necessary shims to make boost::serialization work with classes that have a Serialize() method (instead of a serialize() method).

This allows our mlpack naming conventions to remain intact, and only costs a small amount of ridiculous template metaprogramming.

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 serialization_shim.hpp.