summaryrefslogtreecommitdiffhomepage
path: root/flowgraph/data.h
blob: 353567cf2378f3bd63e457db077ecd22e66b09d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once

#include <cstdint>
#include <vector>

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> storage):m_type(type) {}
  DataType type() const { return m_type; }
 private:
  const DataType m_type;
  std::shared_ptr<Storage> m_storage;
 };

}

namespace GlobalData {

 // variable of simple or struct type
 class Element
 {
 private:
  size_t size;
  std::vector<uint8_t> data; // may be empty if uninitialized
 };

 class Segment: public std::vector<Element>
 {
 };

}