Skip to content
Snippets Groups Projects
Commit 95056685 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Added serialization method to NeuronBiased class

parent 6dd83076
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,15 @@
* @date 15.3.19 -
*/
#include <boost/serialization/export.hpp>
#include "NeuronBiased.h"
#include "NeuronConstant.h"
#include "NeuronBiasedSerialization.h"
BOOST_CLASS_EXPORT_IMPLEMENT(lib4neuro::NeuronBiased);
namespace lib4neuro{
NeuronBiased::NeuronBiased(double b) {
......
//
// Created by martin on 19.3.19.
//
#ifndef LIB4NEURO_NEURONBIASEDSERIALIZATION_H
#define LIB4NEURO_NEURONBIASEDSERIALIZATION_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 "NeuronSerialization.h"
#include "NeuronBiased.h"
BOOST_CLASS_EXPORT_KEY(lib4neuro::NeuronBiased);
struct lib4neuro :: NeuronBiased :: access {
template <class Archive>
static void serialize(Archive &ar, lib4neuro::NeuronBiased& n, const unsigned int version) {
ar & boost::serialization::base_object<lib4neuro::Neuron>(n);
ar & n.bias;
}
};
namespace boost {
namespace serialization {
/**
* Serialization function
* @tparam Archive Boost library template
* @param ar Boost parameter - filled automatically during serialization!
* @param n NeuronBiased instance
* @param version Boost parameter - filled automatically during serialization!
*/
template<class Archive>
void serialize(Archive & ar, lib4neuro::NeuronBiased& n, const unsigned int version)
{
lib4neuro::NeuronBiased::access::serialize(ar, n, version);
}
} // namespace serialization
} // namespace boost
#endif //LIB4NEURO_NEURONBIASEDSERIALIZATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment