Update Attribute.h
This commit is contained in:
parent
758d3e55cc
commit
d4e1e5bc04
1 changed files with 27 additions and 17 deletions
44
Attribute.h
44
Attribute.h
|
@ -5,33 +5,43 @@ using namespace std;
|
||||||
|
|
||||||
//Funtional, might need more functionality
|
//Funtional, might need more functionality
|
||||||
|
|
||||||
template<typename T>
|
//template<typename T>
|
||||||
class Attribute {
|
class Attribute {
|
||||||
//a named column of a relation
|
//a named column of a relation
|
||||||
string name;
|
string name;
|
||||||
vector<T> values;
|
|
||||||
bool isKey;
|
bool isKey;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Attribute(){ }
|
|
||||||
|
vector<string> values;
|
||||||
Attribute(vector<T> v){
|
|
||||||
this.values = v;
|
void initializeAttribute(string n, vector<string> a){
|
||||||
}
|
|
||||||
|
name = n;
|
||||||
Attribute(const Attribute<T>& a){
|
values = a;
|
||||||
this.values = a.getAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
Attribute& operator=(const Attribute<T>& a){
|
|
||||||
this.values = a.getAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string getName(){
|
string getName(){
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<T> getAll(){
|
Attribute(){ }
|
||||||
return this.values;
|
|
||||||
|
void display()
|
||||||
|
{
|
||||||
|
cout<<"Atribute name:\t"<<name<<"\n";
|
||||||
|
cout<<"Elements: ";
|
||||||
|
for (int i = 0; i < values.size(); ++i)
|
||||||
|
{
|
||||||
|
cout<<values[i]<<" ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
/*
|
||||||
|
vector<string> getElements(){
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
Reference in a new issue