45 lines
827 B
C++
45 lines
827 B
C++
#include <iostream>
|
|
#include <vector>
|
|
#include "Attribute.h"
|
|
|
|
using namespace std;
|
|
|
|
//NOT DONE
|
|
class Relation {
|
|
//a table with rows and columns
|
|
string name; //the name of the relation (table)
|
|
vector<Attribute> att;
|
|
vector<string> attributeNames;
|
|
|
|
public:
|
|
//Relation();
|
|
|
|
void initializeRelation(string n, vector<string> attNames, vector<Attribute> a)
|
|
{
|
|
attributeNames = attNames;
|
|
name = n;
|
|
att = a;
|
|
}
|
|
|
|
void addTuple(vector< Attribute> tuple);
|
|
|
|
void display()
|
|
{
|
|
cout<<"\n\nDisplay of relation--------------------------------"<<endl;
|
|
cout<<"Relation name: "<<name<<endl;
|
|
for (int i = 0; i < attributeNames.size(); ++i)
|
|
{
|
|
|
|
cout<<"\nAttribute name: "<<attributeNames[i]<<": ";
|
|
|
|
/*
|
|
for (int i = 0; i < att[i].getSize(); ++i)
|
|
{
|
|
//cout<<" "<<att[i]<<" ";
|
|
}
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
};
|