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