-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGenericVariable.h
50 lines (41 loc) · 1.22 KB
/
GenericVariable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <map>
#include <string>
#include <vector>
#include "AtlasTypes.h"
using namespace std;
class GenericVariable
{
public:
GenericVariable();
GenericVariable(void* Data, unsigned int Type);
~GenericVariable();
unsigned int GetType();
void* GetData();
void SetData(void* Data, unsigned int Type);
void SetData(void* Data);
private:
bool Free();
void* DataPointer;
unsigned int DataType;
};
typedef std::map<std::string,GenericVariable*> VarMapType;
typedef std::map<std::string,GenericVariable*>::iterator VariableMapIt;
typedef std::map<std::string,GenericVariable*>::value_type VariableMapValue;
class VariableMap
{
public:
VariableMap();
~VariableMap();
bool AddVar(std::string& Identifier, void* Data, unsigned int Type);
bool Exists(std::string& Identifier, unsigned int Type);
bool Exists(std::string& Identifier);
GenericVariable* GetVar(std::string& Identifier);
void SetVarData(std::string& Identifier, void* Data, unsigned int Type);
void SetVar(std::string& Identifier, GenericVariable* Var);
void* GetData(std::string& Identifier);
unsigned int GetVarType(std::string& Identifier);
private:
VarMapType VarMap; // Maps strings to variables
VariableMapIt VarMapIt; // Iterator for the map
};