Return block count for next word when the bitmap is available otherwise return a block with length up to INT16_MAX when there is no validity bitmap (so all the referenced values are not null).
| 217 | /// return a block with length up to INT16_MAX when there is no validity |
| 218 | /// bitmap (so all the referenced values are not null). |
| 219 | BitBlockCount NextBlock() { |
| 220 | static constexpr int64_t kMaxBlockSize = std::numeric_limits<int16_t>::max(); |
| 221 | if (has_bitmap_) { |
| 222 | BitBlockCount block = counter_.NextWord(); |
| 223 | position_ += block.length; |
| 224 | return block; |
| 225 | } else { |
| 226 | int16_t block_size = |
| 227 | static_cast<int16_t>(std::min(kMaxBlockSize, length_ - position_)); |
| 228 | position_ += block_size; |
| 229 | // All values are non-null |
| 230 | return {block_size, block_size}; |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | // Like NextBlock, but returns a word-sized block even when there is no |
| 235 | // validity bitmap |