Newer
Older
//
// Created by martin on 9/18/18.
//
#ifndef LIB4NEURO_DATASETSERIALIZATION_H
#define LIB4NEURO_DATASETSERIALIZATION_H
Martin Beseda
committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <boost/serialization/base_object.hpp>
#include <boost/range/size_type.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include "DataSet.h"
struct DataSet :: access {
template <class Archive>
static void serialize(Archive &ar, DataSet& ds, const unsigned int version) {
ar & ds.n_elements;
ar & ds.input_dim;
ar & ds.output_dim;
ar & ds.data;
}
};
namespace boost {
namespace serialization {
/**
* Serialization function
* @tparam Archive Boost library template
* @param ar Boost parameter - filled automatically during serialization!
* @param ds DataSet instance
* @param version Boost parameter - filled automatically during serialization!
*/
template<class Archive>
void serialize(Archive & ar, DataSet & ds, const unsigned int version)
{
DataSet::access::serialize(ar, ds, version);
}
} // namespace serialization
} // namespace boost
#endif //LIB4NEURO_DATASETSERIALIZATION_H