NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeMatlabIOContainer.h
1
11#pragma once
12
13#include <NeCoreLib.h>
14#include <string>
15#include <typeinfo>
16#include <boost/any.hpp>
17#include <Core/NeTypetraits.h>
18
19namespace NeuralEngine
20{
21 typedef std::vector<MatlabIOContainer> vectorMatlabIOContainer;
22 typedef std::vector<std::vector<MatlabIOContainer> > vector2DMatlabIOContainer;
23
35 class NE_IMPEXP MatlabIOContainer
36 {
37 public:
38 // constructors
39
46
55 MatlabIOContainer(const std::string name, const boost::any data);
56
63
64 // set methods
65
73 void SetName(const std::string name);
74
82 void SetData(const boost::any data);
83
98 template<class T> bool TypeEquals(void) const
99 {
100 return data_.type() == typeid(T);
101 }
102
117 std::string Type(void) const;
118
126 std::string Name(void) const;
127
141 template<class T> T Data(void) const
142 {
143 return boost::any_cast<T>(data_);
144 }
145
146 private:
147 std::string name_;
148 boost::any data_;
149 };
150}
A container class for storing type agnostic variables.
bool TypeEquals(void) const
Check if the stored type is equal to the templated type.
std::string Name(void) const
Gets the name.
MatlabIOContainer()
Default constructor.
virtual ~MatlabIOContainer()
Destructor.
void SetData(const boost::any data)
Sets any kind of data.
MatlabIOContainer(const std::string name, const boost::any data)
Constructor to initalize the container with data and an associated name.
void SetName(const std::string name)
Sets a name.
T Data(void) const
Gets the stored data.
std::string Type(void) const
The type of the variable.