Files
PorygonLang/src/Evaluator/EvaluationScope/EvaluationScope.hpp
Deukhoofd ccc6e297f2
Some checks failed
continuous-integration/drone/push Build is failing
Rework of memory handling in Evaluation
2019-07-27 17:59:42 +02:00

33 lines
874 B
C++

#ifndef PORYGONLANG_EVALUATIONSCOPE_HPP
#define PORYGONLANG_EVALUATIONSCOPE_HPP
#include <map>
#include <vector>
#include "../EvalValues/EvalValue.hpp"
#include "../EvalValuePointer.hpp"
using namespace Porygon::Binder;
namespace Porygon::Evaluation {
class EvaluationScope {
map<Utilities::HashedString, EvalValuePointer> *_scriptScope;
map<uint64_t, EvalValuePointer> _localScope;
public:
explicit EvaluationScope(map<Utilities::HashedString, EvalValuePointer> *scriptVariables);
~EvaluationScope(){
_localScope.clear();
};
void CreateVariable(const BoundVariableKey *key, EvalValuePointer value);
void SetVariable(const BoundVariableKey *key, EvalValuePointer value);
EvalValuePointer GetVariable(const BoundVariableKey *key);
};
}
#endif //PORYGONLANG_EVALUATIONSCOPE_HPP