Newer
Older
//
// Created by martin on 9/17/18.
//
Martin Beseda
committed
#ifndef LIB4NEURO_NEURON_CONSTANT_SERIALIZATION_H
#define LIB4NEURO_NEURON_CONSTANT_SERIALIZATION_H
#include <boost/serialization/base_object.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/export.hpp>
#include "NeuronConstant.h"
Martin Beseda
committed
#include "NeuronSerialization.h"
Martin Beseda
committed
BOOST_CLASS_EXPORT_KEY(lib4neuro::NeuronConstant);
Martin Beseda
committed
namespace lib4neuro {
struct NeuronConstant::access {
template<class Archive>
static void serialize(Archive &ar, NeuronConstant &n, const unsigned int version) {
ar & boost::serialization::base_object<Neuron>(n);
ar & n.p;
}
};
}
namespace boost {
namespace serialization {
/**
* Serialization function
* @tparam Archive Boost library template
* @param ar Boost parameter - filled automatically during serialization!
* @param n NeuronConstant instance
* @param version Boost parameter - filled automatically during serialization!
*/
template<class Archive>
Martin Beseda
committed
void serialize(Archive & ar, lib4neuro::NeuronConstant& n, const unsigned int version)
Martin Beseda
committed
lib4neuro::NeuronConstant::access::serialize(ar, n, version);
}
} // namespace serialization
} // namespace boost
Martin Beseda
committed
#endif //LIB4NEURO_NEURON_SERIALIZATION_H