This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/Attribute.h

48 lines
679 B
C
Raw Normal View History

2015-09-15 16:30:25 -05:00
#include <iostream>
#include <vector>
using namespace std;
//Funtional, might need more functionality
2015-09-15 20:21:26 -05:00
//template<typename T>
2015-09-15 16:30:25 -05:00
class Attribute {
//a named column of a relation
string name;
2015-09-15 20:21:26 -05:00
2015-09-15 16:30:25 -05:00
bool isKey;
int size;
2015-09-15 20:21:26 -05:00
public:
vector<string> values;
void initializeAttribute(string n, vector<string> a){
name = n;
values = a;
2015-09-15 16:30:25 -05:00
}
2015-09-15 20:21:26 -05:00
string getName(){
return name;
2015-09-15 16:30:25 -05:00
}
2015-09-15 20:21:26 -05:00
Attribute(){ }
2015-09-15 16:30:25 -05:00
2015-09-15 20:21:26 -05:00
void display()
{
cout<<"Atribute name:\t"<<name<<"\n";
cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i)
{
cout<<values[i]<<" ";
}
2015-09-15 16:30:25 -05:00
}
2015-09-15 20:21:26 -05:00
/*
vector<string> getElements(){
return values;
2015-09-15 16:30:25 -05:00
}
2015-09-15 20:21:26 -05:00
*/
};