26 #ifndef SET_TT_INCLUDED
27 #define SET_TT_INCLUDED
34 #include "../base/ver.h"
38 #include "../base/str.h"
41 #ifndef CHECK_INCLUDED
42 #include "../base/check.h"
45 #ifndef MPOOL_INCLUDED
46 #include "../mem/mpool.h"
50 #include "../rel/rel.h"
62 static const long SET_TT_MAGIC = 0x5354540AL;
68 static const int SET_TT_C1_SIZE = 1024;
74 static const int SET_TT_C2_SIZE = 1024;
85 #define SET_TT_BITMAP_SIZE \
86 ((SET_TT_C2_SIZE + (VER_UINT_BITS-1)) / VER_UINT_BITS)
94 unsigned int BitMap[SET_TT_BITMAP_SIZE];
108 #define SET_TT_BITMAP_NULL (static_cast<set_tt_bitmap_t>(0))
139 bool insert(
int c1,
int c2);
145 inline bool contains(
int c1,
int c2)
const {
150 CHECK(c1 >= 0,
"set_tt_c::contains: c1 is negative");
151 CHECK(c2 >= 0,
"set_tt_c::contains: c2 is negative");
152 CHECK(c1 < SET_TT_C1_SIZE,
153 "set_tt_c::contains: c1 is too large");
154 CHECK(c2 < SET_TT_C2_SIZE,
155 "set_tt_c::contains: c2 is too large");
160 if(bitmap == SET_TT_BITMAP_NULL)
166 unsigned int *ptr = bitmap->BitMap + index;
167 unsigned int mask = 1 << bit_no;
168 return (*ptr & mask) != 0;
235 #define SET_TT_NULL (static_cast<set_tt_t>(0))
#define VER_UINT_BITS
Definition: ver.h:798
#define CHECK_VALID(EX)
Definition: check.h:85
const char * str_t
Definition: str.h:41
#define STR_NULL
Definition: str.h:52
#define CHECK(EX, MSG)
Definition: check.h:69