Rework of memory handling in Evaluation
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -5,22 +5,26 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "../EvalValues/EvalValue.hpp"
|
||||
#include "../EvalValuePointer.hpp"
|
||||
|
||||
using namespace Porygon::Binder;
|
||||
|
||||
namespace Porygon::Evaluation {
|
||||
class EvaluationScope {
|
||||
map<Utilities::HashedString, shared_ptr<const EvalValue>> *_scriptScope;
|
||||
map<uint64_t, shared_ptr<const EvalValue>> _localScope;
|
||||
map<Utilities::HashedString, EvalValuePointer> *_scriptScope;
|
||||
map<uint64_t, EvalValuePointer> _localScope;
|
||||
public:
|
||||
explicit EvaluationScope(map<Utilities::HashedString, shared_ptr<const EvalValue>> *scriptVariables);
|
||||
explicit EvaluationScope(map<Utilities::HashedString, EvalValuePointer> *scriptVariables);
|
||||
|
||||
~EvaluationScope() = default;
|
||||
~EvaluationScope(){
|
||||
_localScope.clear();
|
||||
};
|
||||
|
||||
void CreateVariable(const BoundVariableKey *key, const shared_ptr<const EvalValue>&value);
|
||||
void CreateVariable(const BoundVariableKey *key, EvalValuePointer value);
|
||||
|
||||
void SetVariable(const BoundVariableKey *key, const shared_ptr<const EvalValue> &value);
|
||||
void SetVariable(const BoundVariableKey *key, EvalValuePointer value);
|
||||
|
||||
shared_ptr<const EvalValue> GetVariable(const BoundVariableKey *key);
|
||||
EvalValuePointer GetVariable(const BoundVariableKey *key);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user