Create Relation.h

This commit is contained in:
William Bracho Blok 2015-09-15 20:23:47 -05:00
parent 2b1141bfe7
commit c052e7cbf0

45
Relation.h Normal file
View file

@ -0,0 +1,45 @@
#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]<<" ";
}
*/
}
}
};