is_serializable.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_PYTHON_IS_SERIALIZABLE_HPP
13 #define MLPACK_BINDINGS_PYTHON_IS_SERIALIZABLE_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace bindings {
19 namespace python {
20 
21 template<typename T>
22 inline bool IsSerializable(
23  util::ParamData& /* d */,
24  const typename boost::disable_if<data::HasSerialize<T>>::type* = 0)
25 {
26  return false;
27 }
28 
29 template<typename T>
30 inline bool IsSerializable(
31  util::ParamData& /* d */,
32  const typename boost::enable_if<data::HasSerialize<T>>::type* = 0)
33 {
34  return true;
35 }
36 
37 template<typename T>
39  const void* /* input */,
40  void* output)
41 {
42  *((bool*) output) =
43  IsSerializable<typename std::remove_pointer<T>::type>(data);
44 }
45 
46 } // python
47 } // bindings
48 } // mlpack
49 
50 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
python
Definition: CMakeLists.txt:7
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
bool IsSerializable(util::ParamData &, const typename boost::disable_if< data::HasSerialize< T >>::type *=0)