MCPcopy Create free account
hub / github.com/apache/arrow / BaseSetBitRunReader

Class BaseSetBitRunReader

cpp/src/arrow/util/bit_run_reader.h:202–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201template <bool Reverse>
202class 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) {

Callers

nothing calls this directly

Calls 3

MakeNonNullFunction · 0.85
LoadPartialWordFunction · 0.85
ifFunction · 0.50

Tested by

no test coverage detected