Skip to content
Snippets Groups Projects
NeuronAbsoluteSerialization.h 1.52 KiB
Newer Older
  • Learn to ignore specific revisions
  • 
    #ifndef LIB4NEURO_NEURONABSOLUTESERIALIZATION_H
    #define LIB4NEURO_NEURONABSOLUTESERIALIZATION_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 "NeuronAbsolute.h"
    #include "NeuronSerialization.h"
    
    BOOST_CLASS_EXPORT_KEY(lib4neuro::NeuronAbsolute);
    
    namespace lib4neuro {
        struct NeuronAbsolute::access {
            template<class Archive>
            static void serialize(Archive& ar,
                                  NeuronAbsolute& 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 NeuronAbsolute instance
             * @param version Boost parameter - filled automatically during serialization!
             */
            template<class Archive>
            void serialize(Archive& ar,
                           lib4neuro::NeuronAbsolute& n,
                           const unsigned int version) {
                lib4neuro::NeuronAbsolute::access::serialize(ar,
                                                           n,
                                                           version);
            }
    
        } // namespace serialization
    } // namespace boost
    
    #endif //LIB4NEURO_NeuronAbsoluteSERIALIZATION_H