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

Class BaseSetBitRunReader

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

Source from the content-addressed store, hash-verified

194
195template <bool Reverse>
196class 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) {

Callers

nothing calls this directly

Calls 3

MakeNonNullFunction · 0.85
LoadPartialWordFunction · 0.85
ifFunction · 0.50

Tested by

no test coverage detected