forked from gre4index/GRE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
competitor.h
81 lines (79 loc) · 2.48 KB
/
competitor.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include"./indexInterface.h"
#include "./alex/alex.h"
#include "./alexol/alex.h"
#include "./artsync/artrowex.h"
#include "./artsync/artolc.h"
#include "./artsync/artunsync.h"
#include "./xindex/xindex.h"
#include "./btreeolc/btreeolc.h"
#include "./hot/hot.h"
#include "./hot/hotrowex.h"
#include "./lipp/lipp.h"
#include "./lippol/lippol.h"
#include "pgm/pgm.h"
#include "btree/btree.h"
// #include "wormhole/wormhole.h"
#include "wormhole_u64/wormhole_u64.h"
#include "masstree/masstree.h"
#include "finedex/finedex.h"
#include "iostream"
template<class KEY_TYPE, class PAYLOAD_TYPE>
indexInterface<KEY_TYPE, PAYLOAD_TYPE> *get_index(std::string index_type) {
indexInterface<KEY_TYPE, PAYLOAD_TYPE> *index;
if (index_type == "alexol") {
index = new alexolInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if(index_type == "alex") {
index = new alexInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "btreeolc") {
index = new BTreeOLCInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
// else if (index_type == "wormhole") {
// index = new WormholeInterface<KEY_TYPE, PAYLOAD_TYPE>;
// }
else if (index_type == "wormhole_u64") {
index = new WormholeU64Interface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if( index_type == "hot") {
index = new HotInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if( index_type == "hotrowex") {
index = new HotRowexInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "masstree") {
index = new MasstreeInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "xindex") {
index = new xindexInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "pgm") {
index = new pgmInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if(index_type == "btree") {
index = new BTreeInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "artolc") {
index = new ARTOLCInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
// else if (index_type == "artrowex") {
// index = new ARTROWEXInterface<KEY_TYPE, PAYLOAD_TYPE>;
// }
else if (index_type == "artunsync") {
index = new ARTUnsynchronizedInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "lippol") {
index = new LIPPOLInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "lipp") {
index = new LIPPInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else if (index_type == "finedex") {
index = new finedexInterface<KEY_TYPE, PAYLOAD_TYPE>;
}
else {
std::cout << "Could not find a matching index called " << index_type << ".\n";
exit(0);
}
return index;
}