use THIS
This commit is contained in:
parent
773544da13
commit
d69186dc44
3 changed files with 4 additions and 12 deletions
|
@ -41,12 +41,6 @@ public:
|
|||
cout<<values[i]<<" ";
|
||||
}
|
||||
}
|
||||
|
||||
void Attribute(string n, vector<string> a){
|
||||
|
||||
name = n;
|
||||
values = a;
|
||||
}
|
||||
|
||||
void erase(int position)
|
||||
{
|
||||
|
|
10
Relation.h
10
Relation.h
|
@ -22,7 +22,7 @@ public:
|
|||
for(int i = 0; i < att.size(); i++) {
|
||||
|
||||
//Loop through the elements in the i'th column
|
||||
for(int j = 0; j < att[i].values.size(); j++){
|
||||
for(int j = 0; j < att[i].getValues().size(); j++){
|
||||
|
||||
//In this column, at this element's spot, assign an element from the tuple vector to this spot
|
||||
att[i].addRow(tuple[i]);
|
||||
|
@ -46,8 +46,6 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
int getSize() { return size; }
|
||||
|
||||
string getTableName() {
|
||||
return name;
|
||||
|
@ -68,7 +66,7 @@ public:
|
|||
|
||||
cout << "Column Title: " << input << endl;
|
||||
for(int j = 0; j < att[i].getSize(); j++) {
|
||||
cout << att[i].values[j] << endl;
|
||||
cout << att[i].getValues()[j] << endl;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -81,10 +79,10 @@ public:
|
|||
void display() {
|
||||
cout<<"\n\nDisplay of relation--------------------------------"<<endl;
|
||||
cout<<"Relation name: "<<name<<endl;
|
||||
for (int i = 0; i < attributeNames.size(); ++i)
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
|
||||
cout<<"\nAttribute name: "<<attributeNames[i]<<": ";
|
||||
cout<<"\nAttribute name: "<<att[i].getName()<<": ";
|
||||
|
||||
att[i].display();
|
||||
|
||||
|
|
BIN
a.out
BIN
a.out
Binary file not shown.
Reference in a new issue