Ocular Engine
ExposedVariable.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_EXPOSED_VARIABLE__H__
19 #define __H__OCULAR_CORE_EXPOSED_VARIABLE__H__
20 
21 #include "Utilities/Types.hpp"
22 #include "Utilities/StringUtils.hpp"
23 
24 #include <string>
25 #include <unordered_map>
26 
27 //------------------------------------------------------------------------------------------
28 
33 namespace Ocular
34 {
39  namespace Core
40  {
45  {
46  ExposedVariable(std::string const& name, std::string const& type, void* data, bool pointer, bool exposed)
47  : name(name), type(type), data(data), isPointer(pointer), isExposed(exposed) { }
48 
50  : data(nullptr), isPointer(false), isExposed(false) { }
51 
52  ExposedVariable(ExposedVariable const& other)
53  {
54  name = other.name;
55  type = other.type;
56  data = other.data;
57 
58  isPointer = other.isPointer;
59  isExposed = other.isExposed;
60  }
61 
62  ExposedVariable& operator=(ExposedVariable const& other)
63  {
64  name = other.name;
65  type = other.type;
66  data = other.data;
67 
68  isPointer = other.isPointer;
69  isExposed = other.isExposed;
70 
71  return (*this);
72  }
73 
74  //------------------------------------------------------------
75 
76  std::string name;
77  std::string type;
78 
79  void* data;
80 
81  bool isPointer;
82  bool isExposed;
83  };
84 
85  }
89 }
94 //------------------------------------------------------------------------------------------
95 
96 #endif
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
std::string name
Name of the member variable.
Definition: ExposedVariable.hpp:76
Definition: ExposedVariable.hpp:44
void * data
Raw data value of the variable.
Definition: ExposedVariable.hpp:79
bool isExposed
If true, the type inherits from Exposable.
Definition: ExposedVariable.hpp:82
bool isPointer
If true, the exposed variable is a pointer (and must be handled accordingly).
Definition: ExposedVariable.hpp:81
std::string type
String representation of the variable type.
Definition: ExposedVariable.hpp:77