taco-db  0.1.0
idxtyps.h
Go to the documentation of this file.
1 #ifndef INDEX_IDXTYPS_H
2 #define INDEX_IDXTYPS_H
3 
4 #define IDXTYP_INVALID 0
5 #define IDXTYP_VOLATILETREE 1
6 #define IDXTYP_BTREE 2
7 
8 #define NUM_IDXTYPS 2
9 
10 #ifdef IDXTYP_CONSTANT_ONLY
11 #define IDXTYP(indextype) CONCAT(IDXTYP_, indextype)
12 
13 #else
14 #include "tdb.h"
15 
16 namespace taco {
17 
18 // typedef IdxType moved to base/tdb_base.h
19 
20 #define IDXTYP(indextype) ((IdxType) CONCAT(IDXTYP_, indextype))
21 
22 inline static constexpr bool
24  return idxtyp != IDXTYP(INVALID) && idxtyp <= NUM_IDXTYPS;
25 }
26 
27 absl::string_view IdxTypeGetName(IdxType idx);
28 bool IdxTypeIsVolatile(IdxType idx);
31 
32 } // namespace taco
33 
34 #endif // IDXTYP_CONSTANT_ONLY
35 
36 #endif // INDEX_IDXTYPS_H
#define IDXTYP(indextype)
Definition: idxtyps.h:20
#define NUM_IDXTYPS
Definition: idxtyps.h:8
Definition: datum.h:28
bool IdxTypeNeedsLessOperator(IdxType idx)
Definition: idxtyps.cpp:36
static constexpr bool IdxTypeIsValid(IdxType idxtyp)
Definition: idxtyps.h:23
bool IdxTypeNeedsEqualOperator(IdxType idx)
Definition: idxtyps.cpp:24
absl::string_view IdxTypeGetName(IdxType idx)
Definition: idxtyps.cpp:5
uint8_t IdxType
The index type, see index/idxtyps.h.
Definition: tdb_base.h:284
bool IdxTypeIsVolatile(IdxType idx)
Definition: idxtyps.cpp:19