Rework of variable scope to reduce load on evaluator
This commit is contained in:
@@ -8,24 +8,14 @@
|
||||
|
||||
class EvaluationScope {
|
||||
unordered_map<size_t, shared_ptr<EvalValue>>* _scriptScope;
|
||||
vector<shared_ptr<unordered_map<int, shared_ptr<EvalValue>>>> _localScope;
|
||||
int _currentScope;
|
||||
unordered_map<u_int64_t, shared_ptr<EvalValue>> _localScope;
|
||||
public:
|
||||
explicit EvaluationScope(unordered_map<size_t, shared_ptr<EvalValue>>* scriptVariables, int deepestScope);
|
||||
~EvaluationScope() = default;
|
||||
|
||||
void CreateVariable(int scope, int id, const shared_ptr<EvalValue>& value);
|
||||
void SetVariable(int scope, int id, const shared_ptr<EvalValue>& value);
|
||||
void OuterScope();
|
||||
void InnerScope(bool clearScope = true);
|
||||
shared_ptr<EvalValue> GetVariable(int scope, int id);
|
||||
|
||||
EvaluationScope* CreateBranchingScope(int scopeIndex);
|
||||
|
||||
int GetCurrentScope(){
|
||||
return _currentScope;
|
||||
}
|
||||
|
||||
void CreateVariable(BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
void SetVariable(BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
shared_ptr<EvalValue> GetVariable(BoundVariableKey* key);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user