From 95c5eb96cf65019131a97e93031d4cdf38eca3c2 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 11 May 2015 10:00:29 +0200 Subject: Initial --- enginedata.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 enginedata.h (limited to 'enginedata.h') 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 +#include + +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 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); +}; -- cgit v1.2.3-70-g09d2