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/graph.h | |
parent | d07c5bc14edbe071ee7b4f47f174780e95e451aa (diff) |
Fixed unit tests, prepared hierarchical evaluation via stack (WIP)
Diffstat (limited to 'flowgraph/graph.h')
-rw-r--r-- | flowgraph/graph.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/flowgraph/graph.h b/flowgraph/graph.h index 265a3bd..15c6aef 100644 --- a/flowgraph/graph.h +++ b/flowgraph/graph.h @@ -2,18 +2,32 @@ #include "node.h" +#include <deque> #include <exception> #include <memory> -#include <string> #include <stdexcept> -#include <vector> namespace FlowGraph { - class Graph: public std::vector<std::shared_ptr<Node>> + class Graph: public std::deque<std::shared_ptr<Node>> { public: - Graph() {} + Graph(); + Graph(const std::deque<std::shared_ptr<Node>>& nodes); + Graph(const Graph& other) = default; + ~Graph(); + + Graph& operator= (const Graph&) = default; + + // returns the outermost scope inside this graph + LocalScope& scope() const; + + // append other graph by joining the respective outermost scopes + void append(const Graph& other); + + void append(std::shared_ptr<Node> node); + + std::shared_ptr<Node> lastOp() const; }; } |