NeuralEngine A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes. |

FgEnums.h
1#pragma once
2
3#include <boost/archive/xml_iarchive.hpp>
4#include <boost/archive/xml_oarchive.hpp>
5#include <boost/serialization/nvp.hpp>
6#include <boost/serialization/version.hpp>
7#include <boost/serialization/split_member.hpp>
8//#include <Core/NeEnum.h>
9
10 enum class LayerType
11{
12 LogLik,
13 GP
14};
15
16 struct layertype_serializer
17{
18 LayerType &a_;
19 layertype_serializer(LayerType &a) : a_(a) {}
20 template<class Archive>
21 void save(Archive & ar, const unsigned int version) const
22 {
23 std::string label = tlabels[static_cast<int>(a_)];
24 ar & boost::serialization::make_nvp("label", label);
25 }
26 template<class Archive>
27 void load(Archive & ar, const unsigned int version)
28 {
29 std::string label;
30 ar & boost::serialization::make_nvp("label", label);
31 a_ = static_cast<LayerType>(std::find(tlabels.begin(), tlabels.end(), label) - tlabels.begin());
32 }
33 BOOST_SERIALIZATION_SPLIT_MEMBER();
34 static std::vector<std::string> tlabels;
35};
36
37std::vector<std::string> layertype_serializer::tlabels({ "LogLik", "GP" });
layertype_serializer
Definition: FgEnums.h:17