Skip to content
Snippets Groups Projects
NeuronBinarySerialization.h 1.27 KiB
Newer Older
  • Learn to ignore specific revisions
  • //
    // Created by martin on 9/17/18.
    //
    
    #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>
    
    
    #include "NeuronBinary.h"
    
    
    
    struct NeuronBinary :: access {
        template <class Archive>
        static void serialize(Archive &ar, 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, NeuronBinary& n, const unsigned int version)
            {
                NeuronBinary::access::serialize(ar, n, version);
            }
    
        } // namespace serialization
    } // namespace boost
    
    
    #endif //LIB4NEURO_NEURON_BINARY_SERIALIZATION_H