-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelation.h
39 lines (34 loc) · 873 Bytes
/
Relation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PROJECT_3_RELATION_H
#define PROJECT_3_RELATION_H
#include "Tuple.h"
#include "Header.h"
#include <set>
class Relation {
public:
Relation() {}
Relation(Header* header) {
this->header = header;
}
~Relation() {}
void AddTuple(Tuple tuple) {
tuples.insert(tuple);
}
std::set<Tuple> GetTuples() {
return tuples;
}
Header* GetHeader() {
return header;
}
void SetHeader(Header* newHeader) {
this->header = newHeader;
}
void Select(int index, std::string value);
void Select(int index1, int index2);
void Project(std::vector<int> indices, Relation* peeking);
void Rename(std::vector<std::string> newHeader);
void PrintRelation();
private:
Header* header;
std::set<Tuple> tuples;
};
#endif //PROJECT_3_RELATION_H