-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeleteTable.h
55 lines (40 loc) · 861 Bytes
/
DeleteTable.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// Created by Junchen Liu on 4/24/2022.
//
#ifndef TEST_DELETETABLE_H
#define TEST_DELETETABLE_H
#include <ctime>
#include <vector>
#include <string>
using namespace std;
class MinMaxPair
{
public:
int minKey ;
int maxKey;
unsigned long int t;
MinMaxPair(int _min, int _max) {
minKey = _min;
maxKey = _max;
t = time(nullptr);
}
MinMaxPair(int _min, int _max, unsigned long int _t) {
minKey = _min;
maxKey = _max;
t = _t;
}
};
class DeleteTable {
public:
DeleteTable();
~DeleteTable() {close();};
unsigned long int getTimeInt(int key); //If get 0, then not in dt.
void del(int min_key, int max_key);
void close();
private:
vector<MinMaxPair> vec;
string fileName = "dtFile";
void load();
void save();
};
#endif //TEST_DELETETABLE_H