-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuple.cpp
More file actions
43 lines (35 loc) · 876 Bytes
/
Copy pathtuple.cpp
File metadata and controls
43 lines (35 loc) · 876 Bytes
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
#include "tuple.h"
Tuple::Tuple(const Tuple& tuple_in) {
for (int index = 0; index < tuple_in.data_.size(); index++)
{
this->data_.push_back(tuple_in.data_[index]);
}
}
inline int Tuple::getSize() {
return (int)data_.size();
}
//新增数据
void Tuple::addData(Data data_in) {
this->data_.push_back(data_in);
}
bool Tuple::isDeleted() {
return isDeleted_;
}
void Tuple::setDeleted() {
isDeleted_ = true;
}
//得到元组中的数据
vector<Data> Tuple::getData() const {
return this->data_;
}
void Tuple::showTuple() {
for (int index = 0; index < getSize(); index++) {
if (data_[index].type == -1)
cout << data_[index].datai << '\t';
else if (data_[index].type == 0)
cout << data_[index].dataf << '\t';
else
cout << data_[index].datas << '\t';
}
cout << std::endl;
}