37 lines
587 B
C
37 lines
587 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<T> values;
|
||
|
bool isKey;
|
||
|
int size;
|
||
|
public:
|
||
|
Attribute(){ }
|
||
|
|
||
|
Attribute(vector<T> v){
|
||
|
this.values = v;
|
||
|
}
|
||
|
|
||
|
Attribute(const Attribute<T>& a){
|
||
|
this.values = a.getAll();
|
||
|
}
|
||
|
|
||
|
Attribute& operator=(const Attribute<T>& a){
|
||
|
this.values = a.getAll();
|
||
|
}
|
||
|
|
||
|
string getName(){
|
||
|
return name;
|
||
|
}
|
||
|
|
||
|
vector<T> getAll(){
|
||
|
return this.values;
|
||
|
}
|
||
|
};
|