From 856c73172af5090f0460269f0419f2867444d995 Mon Sep 17 00:00:00 2001 From: Rebecca Schofield Date: Tue, 15 Sep 2015 22:02:16 -0500 Subject: [PATCH] something --- Relation.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Relation.h b/Relation.h index 18a79f1..ee95ad7 100755 --- a/Relation.h +++ b/Relation.h @@ -8,20 +8,21 @@ class Relation { string name; //the name of the relation (table) vector att; vector attributeNames; + int size; public: //Relation(); - void initializeRelation(string n, vector attNames, vector a) - { + void initializeRelation(string n, vector attNames, vector a) { attributeNames = attNames; name = n; att = a; + size = 0; } - void addTuple(vector< string > tuple) { - - + int getSize() { return size; } + + void addTuple(vector tuple) { if(tuple.size() != att.size()){ cout << "\n ERROR" << endl; } @@ -33,8 +34,7 @@ public: } } - void removeTuple(int tupleNum) - { + void removeTuple(int tupleNum) { if (tupleNum > att[0].getSize() || tupleNum < 0) { cout<<"ERROR! index out of bound"<