218
215
extern const key_map key_map_empty;
219
216
extern key_map key_map_full; /* Should be threaded as const */
222
* Class to be used when a thread safe version of std::bitset
223
* is needed. We just use a lock here to protect any modifications
226
class ThreadSafeBitset
231
pthread_mutex_init(&mutex, NULL);
235
pthread_mutex_destroy(&mutex);
238
* Resets a bit at the given bit position.
240
* @param position of the bit to reset
242
void resetBit(uint32_t pos);
244
* Finds the first bit that is not set and sets
247
uint32_t setNextBit();
249
std::bitset<MAX_FIELDS> bitmap;
250
pthread_mutex_t mutex;
254
* Returns the position of the first bit in the
255
* given bitmap which is not set. If every bit is set
256
* in the bitmap, return MY_BIT_NONE.
258
* @param the bitmap to work with
260
uint32_t getFirstBitPos(const std::bitset<MAX_FIELDS> &bitmap);
263
* Returns true if map1 is a subset of map2; otherwise,
266
* @param the bitmap to check with
267
* @param the bitmap to check against
269
bool isBitmapSubset(const std::bitset<MAX_FIELDS> *map1, const std::bitset<MAX_FIELDS> *map2);
272
* Returns true if there is any overlapping bits between
273
* the 2 given bitmaps.
275
* @param the first bitmap to work with
276
* @param the second bitmap to work with
278
bool isBitmapOverlapping(const std::bitset<MAX_FIELDS> *map1, const std::bitset<MAX_FIELDS> *map2);
280
218
#endif /* _SQL_BITMAP_H_ */