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
19 namespace 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
45 MatlabIOContainer();
46
55 MatlabIOContainer(const std::string name, const boost::any data);
56
62 virtual ~MatlabIOContainer();
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}
NeuralEngine::MatlabIOContainer
A container class for storing type agnostic variables.
Definition: NeMatlabIOContainer.h:36
NeuralEngine::MatlabIOContainer::TypeEquals
bool TypeEquals(void) const
Check if the stored type is equal to the templated type.
Definition: NeMatlabIOContainer.h:98
NeuralEngine::MatlabIOContainer::Name
std::string Name(void) const
Gets the name.
NeuralEngine::MatlabIOContainer::MatlabIOContainer
MatlabIOContainer()
Default constructor.
NeuralEngine::MatlabIOContainer::~MatlabIOContainer
virtual ~MatlabIOContainer()
Destructor.
NeuralEngine::MatlabIOContainer::SetData
void SetData(const boost::any data)
Sets any kind of data.
NeuralEngine::MatlabIOContainer::MatlabIOContainer
MatlabIOContainer(const std::string name, const boost::any data)
Constructor to initalize the container with data and an associated name.
NeuralEngine::MatlabIOContainer::SetName
void SetName(const std::string name)
Sets a name.
NeuralEngine::MatlabIOContainer::Data
T Data(void) const
Gets the stored data.
Definition: NeMatlabIOContainer.h:141
NeuralEngine::MatlabIOContainer::Type
std::string Type(void) const
The type of the variable.
NeuralEngine
Definition: NeArray2.h:18