ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::PackedBitReader Class Reference

reads the bits of a sequence of bytes in the order of a PackedBitWriter, and zeros past its end More...

#include <ADS/compression/PackedBits.h>

Public member functions

 PackedBitReader (std::span< const std::uint8_t > b)
 the reader of the bytes \( b \), which must outlive it
bool get (void)
 the next bit, 0 past the end
std::uint64_t get (int k)
 the value of the next \( k \) bits, the first the most significant
std::size_t position (void) const
 the number of bits read, past the end too
std::size_t size (void) const
 the number of bits of the bytes

Detailed description

reads the bits of a sequence of bytes in the order of a PackedBitWriter, and zeros past its end

Constructor and destructor documentation

◆ PackedBitReader()

ADS::PackedBitReader::PackedBitReader ( std::span< const std::uint8_t > b)
inlineexplicit

the reader of the bytes \( b \), which must outlive it

Member function documentation

◆ get() [1/2]

std::uint64_t ADS::PackedBitReader::get ( int k)

the value of the next \( k \) bits, the first the most significant

Precondition
\( 0 \le k \le 64 \)

◆ get() [2/2]

bool ADS::PackedBitReader::get ( void )

the next bit, 0 past the end

◆ position()

std::size_t ADS::PackedBitReader::position ( void ) const
inlinenodiscard

the number of bits read, past the end too

◆ size()

std::size_t ADS::PackedBitReader::size ( void ) const
inlinenodiscard

the number of bits of the bytes


The documentation for this class was generated from the following file: