Class BitReader
Defined in File BitStream.h
Class Documentation
-
class BitReader
a stream of bits read forward from a place of a BitVector, which must outlive the reader
Public Functions
-
explicit BitReader(const BitVector &b, std::size_t p = 0)
the bits of b from the place p
- Pre:
p <= b.size()
-
std::size_t position(void) const
the place of the next bit
-
void seek(std::size_t p)
moves to the place p
- Pre:
p <= the size of the bits
-
bool atEnd(void) const
whether all the bits have been read
-
Word read(int len)
the next len bits, the first in the least significant place
- Pre:
len <= 64 and len bits are left
-
Word readBinary(int len)
the next len bits, the first in the most significant place
- Pre:
len <= 64 and len bits are left
-
std::uint64_t readUnary(void)
the number of zeros before the next 1, which is read too
- Pre:
a 1 is left
-
explicit BitReader(const BitVector &b, std::size_t p = 0)