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