-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.h
More file actions
41 lines (33 loc) · 764 Bytes
/
Copy pathstorage.h
File metadata and controls
41 lines (33 loc) · 764 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
/**
* Mocked storage table for storing information
* DON'T modify this file
*/
#pragma once
#include <string>
#include <vector>
class Tuple {
public:
Tuple(){};
Tuple(int id_val, int value1_val, std::string value2_val)
: id(id_val), val1(value1_val), val2(value2_val) {}
int id; // primary key
int val1;
std::string val2;
};
class Table {
public:
Table(){};
std::vector<Tuple>::iterator Begin() { return data.begin(); }
std::vector<Tuple>::iterator End() { return data.end(); }
bool insert(Tuple tuple) {
data.emplace_back(tuple);
return true;
}
bool insert(int id, int val1, std::string val2) {
data.emplace_back(Tuple(id, val1, val2));
return true;
}
private:
std::vector<Tuple> data;
int tid;
};