29 #define FOR_EACH_PROVENANCE(func, ...) \
30 func(Provenance, 2, __VA_ARGS__) \
31 func(Provenance, 3, __VA_ARGS__) \
32 func(Provenance, 4, __VA_ARGS__) \
33 func(Provenance, 5, __VA_ARGS__) \
34 func(Provenance, 6, __VA_ARGS__) \
35 func(Provenance, 7, __VA_ARGS__) \
36 func(Provenance, 8, __VA_ARGS__) \
37 func(Provenance, 9, __VA_ARGS__) \
38 func(Provenance, 10, __VA_ARGS__) \
39 func(Provenance, 11, __VA_ARGS__) \
40 func(Provenance, 12, __VA_ARGS__) \
41 func(Provenance, 13, __VA_ARGS__) \
42 func(Provenance, 14, __VA_ARGS__) \
43 func(Provenance, 15, __VA_ARGS__) \
44 func(Provenance, 16, __VA_ARGS__) \
45 func(Provenance, 17, __VA_ARGS__) \
46 func(Provenance, 18, __VA_ARGS__) \
47 func(Provenance, 19, __VA_ARGS__) \
48 func(Provenance, 20, __VA_ARGS__) \
49 func(Provenance, 21, __VA_ARGS__) \
50 func(Provenance, 22, __VA_ARGS__) \
51 func(Provenance, 23, __VA_ARGS__) \
52 func(Provenance, 24, __VA_ARGS__) \
53 func(Provenance, 25, __VA_ARGS__) \
54 func(Provenance, 26, __VA_ARGS__) \
55 func(Provenance, 27, __VA_ARGS__) \
56 func(Provenance, 28, __VA_ARGS__) \
57 func(Provenance, 29, __VA_ARGS__) \
58 func(Provenance, 30, __VA_ARGS__)
61 #define FOR_EACH_BTREE(func, ...)\
62 func(Btree, 0, __VA_ARGS__) \
63 func(Btree, 1, __VA_ARGS__) \
64 func(Btree, 2, __VA_ARGS__) \
65 func(Btree, 3, __VA_ARGS__) \
66 func(Btree, 4, __VA_ARGS__) \
67 func(Btree, 5, __VA_ARGS__) \
68 func(Btree, 6, __VA_ARGS__) \
69 func(Btree, 7, __VA_ARGS__) \
70 func(Btree, 8, __VA_ARGS__) \
71 func(Btree, 9, __VA_ARGS__) \
72 func(Btree, 10, __VA_ARGS__) \
73 func(Btree, 11, __VA_ARGS__) \
74 func(Btree, 12, __VA_ARGS__) \
75 func(Btree, 13, __VA_ARGS__) \
76 func(Btree, 14, __VA_ARGS__) \
77 func(Btree, 15, __VA_ARGS__) \
78 func(Btree, 16, __VA_ARGS__) \
79 func(Btree, 17, __VA_ARGS__) \
80 func(Btree, 18, __VA_ARGS__) \
81 func(Btree, 19, __VA_ARGS__) \
82 func(Btree, 20, __VA_ARGS__)
85 #define FOR_EACH_BRIE(func, ...)
108 #define FOR_EACH_EQREL(func, ...)\
109 func(Eqrel, 2, __VA_ARGS__)
111 #define FOR_EACH(func, ...) \
112 FOR_EACH_BTREE(func, __VA_ARGS__) \
113 FOR_EACH_BRIE(func, __VA_ARGS__) \
114 FOR_EACH_PROVENANCE(func, __VA_ARGS__) \
115 FOR_EACH_EQREL(func, __VA_ARGS__)
122 namespace index_utils {
126 template <
unsigned... Columns>
129 template <
unsigned First,
unsigned... Rest>
131 template <
typename T>
132 int operator()(
const T& a,
const T&
b)
const {
135 template <
typename T>
136 bool less(
const T& a,
const T&
b)
const {
137 return a[First] <
b[First] || (a[First] ==
b[First] &&
comparator<Rest...>().less(a,
b));
139 template <
typename T>
140 bool equal(
const T& a,
const T&
b)
const {
147 template <
typename T>
148 int operator()(
const T&,
const T&)
const {
151 template <
typename T>
152 bool less(
const T&,
const T&)
const {
155 template <
typename T>
156 bool equal(
const T&,
const T&)
const {
170 template <
unsigned... Columns>
179 namespace index_utils {
184 template <
typename Index,
unsigned column>
187 template <
unsigned... Columns,
unsigned Col>
188 struct extend<
index<Columns...>, Col> {
194 template <
unsigned arity>
206 template <
size_t Arity>
210 template <
size_t Arity>
214 template <
size_t Arity>
218 template <
size_t Arity>
222 template <
size_t Arity>
225 old_t[Arity - 2] = new_t[Arity - 2];
226 old_t[Arity - 1] = new_t[Arity - 1];
231 template <
size_t Arity>
238 template <
size_t Arity>