59 lines
848 B
C
59 lines
848 B
C
![]() |
#include <iostream>
|
||
|
#include <vector>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
//Funtional, might need more functionality
|
||
|
|
||
|
//template<typename T>
|
||
|
class Attribute {
|
||
|
//a named column of a relation
|
||
|
string name;
|
||
|
vector<string> values;
|
||
|
bool isKey;
|
||
|
int size;
|
||
|
|
||
|
public:
|
||
|
|
||
|
void initializeAttribute(string n, vector<string> a){
|
||
|
|
||
|
name = n;
|
||
|
values = a;
|
||
|
}
|
||
|
|
||
|
string getName(){
|
||
|
return name;
|
||
|
}
|
||
|
|
||
|
Attribute(){ }
|
||
|
|
||
|
void display()
|
||
|
{
|
||
|
cout<<"Atribute name:\t"<<name<<"\n";
|
||
|
cout<<"Elements: ";
|
||
|
for (int i = 0; i < values.size(); ++i)
|
||
|
{
|
||
|
cout<<values[i]<<" ";
|
||
|
}
|
||
|
}
|
||
|
/*
|
||
|
Attribute(vector<string> v){
|
||
|
this.values = v;
|
||
|
}
|
||
|
|
||
|
Attribute(const Attribute<string>& a){
|
||
|
this.values = a.getAll();
|
||
|
}
|
||
|
|
||
|
Attribute& operator=(const Attribute<string>& a){
|
||
|
this.values = a.getAll();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
vector<string> getAll(){
|
||
|
return this.values;
|
||
|
}
|
||
|
*/
|
||
|
};
|