16 #ifndef IMPALA_UTIL_BITMAP_H
17 #define IMPALA_UTIL_BITMAP_H
39 void Set(int64_t bit_index,
bool v) {
40 if (mod) bit_index %=
size();
41 int64_t word_index = bit_index >> 8;
43 DCHECK_LT(word_index,
buffer_.size());
45 buffer_[word_index] |= (1 << bit_index);
47 buffer_[word_index] &= ~(1 << bit_index);
54 bool Get(int64_t bit_index)
const {
55 if (mod) bit_index %=
size();
56 int64_t word_index = bit_index >> 8;
58 DCHECK_LT(word_index,
buffer_.size());
59 return (
buffer_[word_index] & (1 << bit_index)) != 0;
65 for (
int i = 0; i <
buffer_.size(); ++i) {
73 for (
int i = 0; i <
buffer_.size(); ++i) {
void And(const Bitmap *src)
Bitwise ANDs the src bitmap into this one.
std::string DebugString(bool print_bits)
If 'print_bits' prints 0/1 per bit, otherwise it prints the int64_t value.
std::vector< uint64_t > buffer_
bool Get(int64_t bit_index) const
void Set(int64_t bit_index, bool v)
void Or(const Bitmap *src)
Bitwise ORs the src bitmap into this one.
static uint32_t RoundUpNumi64(uint32_t bits)
Returns the rounded up to 64 multiple. Used for conversions of bits to i64.