From 1011655d2ef76a0c0aa29dbbff091dab139198e3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 24 Oct 2020 16:32:18 +0200 Subject: Add FlowGraph --- flowgraph/data.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 flowgraph/data.h (limited to 'flowgraph/data.h') diff --git a/flowgraph/data.h b/flowgraph/data.h new file mode 100644 index 0000000..353567c --- /dev/null +++ b/flowgraph/data.h @@ -0,0 +1,51 @@ +#pragma once + +#include +#include + +namespace FlowGraph { + + // Explicitely not including size + enum class DataType + { + Size, + Int, + UInt, + Pointer, + Bool, + Char, + UChar, + }; + + class Storage; ///< forward declaration + + // Argument for Operations + // -> includes identity of data point, e.g. a local int variable + // Built up as a list of Data instances for global and local data points in parallel to FlowGraph + class Data + { + public: + Data(DataType type, std::shared_ptr storage):m_type(type) {} + DataType type() const { return m_type; } + private: + const DataType m_type; + std::shared_ptr m_storage; + }; + +} + +namespace GlobalData { + + // variable of simple or struct type + class Element + { + private: + size_t size; + std::vector data; // may be empty if uninitialized + }; + + class Segment: public std::vector + { + }; + +} -- cgit v1.2.3