aboutsummaryrefslogtreecommitdiff
path: root/enginedata.h
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-05-11 10:00:29 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-05-11 10:01:23 +0200
commit95c5eb96cf65019131a97e93031d4cdf38eca3c2 (patch)
tree06226daa75ef0f5ecf50f58ce620f52e353b74a9 /enginedata.h
Initial
Diffstat (limited to 'enginedata.h')
-rw-r--r--enginedata.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/enginedata.h b/enginedata.h
new file mode 100644
index 0000000..29550f6
--- /dev/null
+++ b/enginedata.h
@@ -0,0 +1,52 @@
+#include <string>
+#include <vector>
+
+using namespace std;
+
+struct RowItem;
+struct Row;
+struct ColHeader;
+struct Table;
+
+
+struct RowItem{
+ union { //watch the pointerness or not-pointerness of the attributes!
+ int rh_int32;
+ unsigned int rh_uint32;
+ unsigned char *rh_bytes;
+ } u;
+};
+
+enum ColHeaderType{
+ RH_INT32,
+ RH_UINT32,
+ RH_BYTES //takes length argument
+};
+struct ColHeader{
+ ColHeaderType type;
+ int arg;
+};
+
+struct Row{
+ const Table *table; //pointer to the parent table; don't delete!
+ RowItem *items;
+
+ Row(const int nc,const Table *const _t);
+ ~Row(void);
+ Row(Row &&other);
+ Row(const Row &other);
+};
+
+struct Table{
+ const string name;
+ const int nc;
+ ColHeader *header;
+ vector<Row> rows;
+
+ Table(const string &_n,const int _nc,const ColHeader *const _hd);
+ ~Table(void);
+ Table(Table &&other);
+
+ void insert(Row &&row);
+ void insert(Row &row);
+};