diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-15 18:39:01 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-15 18:39:01 +0100 |
commit | a3b4cd4fdd4340c952eaa00bca9bebf817b901ae (patch) | |
tree | 055d3ae4b9d1e37682c2e49b31a6531f189eebf5 /flowgraph/storage.h | |
parent | d07c5bc14edbe071ee7b4f47f174780e95e451aa (diff) |
Fixed unit tests, prepared hierarchical evaluation via stack (WIP)
Diffstat (limited to 'flowgraph/storage.h')
-rw-r--r-- | flowgraph/storage.h | 16 |
1 files changed, 4 insertions, 12 deletions
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 <cstdint> #include <string> @@ -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 |