-
Notifications
You must be signed in to change notification settings - Fork 0
/
SymbolsTable.h
40 lines (34 loc) · 1017 Bytes
/
SymbolsTable.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
//
// Created by t on 17/12/18.
//
#ifndef FLIGHTSIMULATOR_SYMBOLSTABLE_H
#define FLIGHTSIMULATOR_SYMBOLSTABLE_H
#include <map>
#include <vector>
#include <queue>
#include <utility>
#include <iostream>
using namespace std;
class SymbolsTable {
//vars that exist in program
map<string, double> symbolsMap;
//all vars from simulation
map<string, double> simulatorOutput;
//vars order in simulation output
vector<string> varsOrder;
//binded vars in program. name var first, bind path second
map<string, string> bindedVars;
//queue of values to be set to simulation
queue<pair<string, double >> setQueue;
public:
SymbolsTable();
void addVar(string name, string bind);
void addVar(string name, double value);
bool exist(string var);
bool isBinded(string var);
void updateServer(char *buffer);
void set(string var, double value);
pair<string, double> getMessage();
double getVarValue(string name);
};
#endif //FLIGHTSIMULATOR_SYMBOLSTABLE_H