| 159 | |
| 160 | template<typename T> |
| 161 | inline int BatchedBitReader::UnpackBatch(int bit_width, int num_values, T* v) { |
| 162 | DCHECK(buffer_pos_ != nullptr); |
| 163 | DCHECK_GE(bit_width, 0); |
| 164 | DCHECK_LE(bit_width, MAX_BITWIDTH); |
| 165 | DCHECK_LE(bit_width, sizeof(T) * 8); |
| 166 | DCHECK_GE(num_values, 0); |
| 167 | |
| 168 | int64_t num_read; |
| 169 | std::tie(buffer_pos_, num_read) = BitPacking::UnpackValues(bit_width, buffer_pos_, |
| 170 | bytes_left(), num_values, v); |
| 171 | DCHECK_LE(buffer_pos_, buffer_end_); |
| 172 | DCHECK_LE(num_read, num_values); |
| 173 | return static_cast<int>(num_read); |
| 174 | } |
| 175 | |
| 176 | inline bool BatchedBitReader::SkipBatch(int bit_width, int num_values_to_skip) { |
| 177 | DCHECK(buffer_pos_ != nullptr); |
no outgoing calls