From a3b4cd4fdd4340c952eaa00bca9bebf817b901ae Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 15 Nov 2020 18:39:01 +0100 Subject: Fixed unit tests, prepared hierarchical evaluation via stack (WIP) --- flowgraph/storage.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'flowgraph/storage.h') diff --git a/flowgraph/storage.h b/flowgraph/storage.h index fd3c085..7f648b0 100644 --- a/flowgraph/storage.h +++ b/flowgraph/storage.h @@ -2,6 +2,7 @@ #pragma once #include "data.h" +#include "scope.h" #include #include @@ -37,16 +38,7 @@ namespace FlowGraph { std::string m_name; }; - // Provide a context for local temporaries name generation - class LocalScope - { - public: - LocalScope() = default; - size_t getNewIndex() { return m_index++; } - private: - size_t m_index{ 0 }; - }; - + // named values class LocalStorage : public Storage { public: @@ -62,9 +54,9 @@ namespace FlowGraph { { public: TemporaryStorage(LocalScope& scope); - const std::string& name() const { return m_name; } + std::string name() const; private: - std::string m_name; + LocalScope& m_scope; }; // dereferenced pointer -- cgit v1.2.3