| 200 | |
| 201 | template <bool Reverse> |
| 202 | class BaseSetBitRunReader { |
| 203 | public: |
| 204 | /// \brief Constructs new SetBitRunReader. |
| 205 | /// |
| 206 | /// \param[in] bitmap source data |
| 207 | /// \param[in] start_offset bit offset into the source data |
| 208 | /// \param[in] length number of bits to copy |
| 209 | ARROW_NOINLINE |
| 210 | BaseSetBitRunReader(const uint8_t* bitmap, int64_t start_offset, int64_t length) |
| 211 | : bitmap_(util::MakeNonNull(bitmap)), |
| 212 | length_(length), |
| 213 | remaining_(length_), |
| 214 | current_word_(0), |
| 215 | current_num_bits_(0) { |
| 216 | if (Reverse) { |
| 217 | bitmap_ += (start_offset + length) / 8; |
| 218 | const int8_t end_bit_offset = static_cast<int8_t>((start_offset + length) % 8); |
| 219 | if (length > 0 && end_bit_offset) { |
| 220 | // Get LSBs from last byte |
| 221 | ++bitmap_; |
| 222 | current_num_bits_ = |
| 223 | std::min(static_cast<int32_t>(length), static_cast<int32_t>(end_bit_offset)); |
| 224 | current_word_ = LoadPartialWord(8 - end_bit_offset, current_num_bits_); |
| 225 | } |
| 226 | } else { |
| 227 | bitmap_ += start_offset / 8; |
| 228 | const int8_t bit_offset = static_cast<int8_t>(start_offset % 8); |
| 229 | if (length > 0 && bit_offset) { |
nothing calls this directly
no test coverage detected