-
Notifications
You must be signed in to change notification settings - Fork 0
/
RelationTripple.hpp
52 lines (43 loc) · 1.25 KB
/
RelationTripple.hpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
template <typename T, typename D, typename K>
class Triple {
private:
T first;
D rel;
K second;
public:
Triple() = default;
Triple(const T& first, const D& rel, const K& second);
const T& getFirst() const;
const D& getRel() const;
const K& getSecond() const;
void setFirst(const T& newValue);
void setRel(const D& newValue);
void setSecond(const K& newValue);
};
template <typename T, typename D, typename K>
Triple<T, D, K>::Triple(const T& first, const D& rel, const K& second) : first(first), rel(rel), second(second) {}
template <typename T, typename D, typename K>
const T& Triple<T, D, K>::getFirst() const {
return first;
}
template <typename T, typename D, typename K>
const D& Triple<T, D, K>::getRel() const {
return rel;
}
template <typename T, typename D, typename K>
const K& Triple<T, D, K>::getSecond() const {
return second;
}
template <typename T, typename D, typename K>
void Triple<T, D, K>::setFirst(const T& newValue) {
first = newValue;
}
template <typename T, typename D, typename K>
void Triple<T, D, K>::setRel(const D& newValue) {
rel = newValue;
}
template <typename T, typename D, typename K>
void Triple<T, D, K>::setSecond(const K& newValue) {
second = newValue;
}