-
Notifications
You must be signed in to change notification settings - Fork 1
/
rtrie.h
65 lines (52 loc) · 1.1 KB
/
rtrie.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
#ifndef RTRIE_H_
#define RTRIE_H_
#include <string>
#include <list>
#include <map>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <vector>
#include <stdint.h>
#include "rulesutils.h"
using namespace std;
struct rg{
uint32_t low;
uint32_t high;
rg(uint32_t l, uint32_t h): low(l), high(h) {
};
rg() {
low =0;
high = 0;
}
rg(const rg &a) {
low = a.low;
high = a.high;
}
};
struct rnode{
rg b;
vector<pc_rule*> rlist;
struct rnode *right, *left;
rnode(rg a) : b(a) {
right = NULL;
left = NULL;
};
rnode(): b(0,0) {
right = NULL;
left = NULL;
}
void setb(const rg &sb) {
b = sb;
}
};
struct overlap_trees{
struct rnode roots[MAXDIMENSIONS];
};
bool rt_qry_insert(rnode *n, rg r, vector<pc_rule*> &set, pc_rule* index);
void rt_query_or(rnode *n, rg r, vector<pc_rule*> &set);
void rt_destory(rnode *n);
void rt_insert(rnode *n, rg r, pc_rule* index);
void rt_query_or(rnode *n, rg r, vector<pc_rule*> &set, int l, int h);
#endif