Newer
Older
#ifndef LIB4NEURO_NEURON_BINARY_SERIALIZATION_H
#define LIB4NEURO_NEURON_BINARY_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>
Martin Beseda
committed
#include "NeuronSerialization.h"
#include "NeuronBinary.h"
Martin Beseda
committed
BOOST_CLASS_EXPORT_KEY(lib4neuro::NeuronBinary);
namespace lib4neuro {
struct NeuronBinary::access {
template<class Archive>
static void serialize(Archive& ar,
lib4neuro::NeuronBinary& n,
const unsigned int version) {
ar & boost::serialization::base_object<Neuron>(n);
}
};
}
namespace boost {
namespace serialization {
/**
* Serialization function
* @tparam Archive Boost library template
* @param ar Boost parameter - filled automatically during serialization!
* @param n NeuronBinary instance
* @param version Boost parameter - filled automatically during serialization!
*/
template<class Archive>
void serialize(Archive& ar,
lib4neuro::NeuronBinary& n,
const unsigned int version) {
lib4neuro::NeuronBinary::access::serialize(ar,
n,
version);
}
} // namespace serialization
} // namespace boost
Martin Beseda
committed
#endif //LIB4NEURO_NEURON_BINARY_SERIALIZATION_H