#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); };