Thrill  0.1
BitStreamReader< BlockReader > Class Template Reference

Detailed Description

template<typename BlockReader>
class thrill::core::BitStreamReader< BlockReader >

Definition at line 114 of file bit_stream.hpp.

+ Inheritance diagram for BitStreamReader< BlockReader >:

#include <bit_stream.hpp>

Public Member Functions

 BitStreamReader (BlockReader &block_reader)
 
 BitStreamReader (const BitStreamReader &)=delete
 non-copyable: delete copy-constructor More...
 
 BitStreamReader (BitStreamReader &&)=default
 move-constructor: default More...
 
size_t GetBits (unsigned bits)
 Get bits at the cursor. More...
 
unsigned GetNumberOfOnesUntilNextZero ()
 Returns the number of continuous 1 bits at the cursor, followed by a zero. More...
 
bool HasNextZeroTest ()
 
BitStreamReaderoperator= (const BitStreamReader &)=delete
 non-copyable: delete assignment operator More...
 
BitStreamReaderoperator= (BitStreamReader &&)=default
 move-assignment operator: default More...
 

Protected Types

enum  : size_t { buffer_bits_ = sizeof(size_t) * 8 }
 number of bits in buffer_ More...
 
enum  : size_t { mask = (buffer_bits_ - 1) }
 modulo mask of number of bits in buffer for pos_ counter More...
 
enum  : size_t { msb_set = ((size_t)1) << (buffer_bits_ - 1) }
 highest bit set More...
 

Protected Attributes

BlockReader & block_reader_
 Input BlockReader. More...
 
size_t buffer_ = 0
 current buffer of 32/64 bits More...
 
size_t pos_ = buffer_bits_
 currently used number of bits More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : size_t
protected

number of bits in buffer_

Enumerator
buffer_bits_ 

Definition at line 118 of file bit_stream.hpp.

◆ anonymous enum

anonymous enum : size_t
protected

modulo mask of number of bits in buffer for pos_ counter

Enumerator
mask 

Definition at line 121 of file bit_stream.hpp.

◆ anonymous enum

anonymous enum : size_t
protected

highest bit set

Enumerator
msb_set 

Definition at line 124 of file bit_stream.hpp.

Constructor & Destructor Documentation

◆ BitStreamReader() [1/3]

BitStreamReader ( BlockReader &  block_reader)
inlineexplicit

Definition at line 127 of file bit_stream.hpp.

References BitStreamWriter< BlockWriter >::operator=().

◆ BitStreamReader() [2/3]

BitStreamReader ( const BitStreamReader< BlockReader > &  )
delete

non-copyable: delete copy-constructor

◆ BitStreamReader() [3/3]

BitStreamReader ( BitStreamReader< BlockReader > &&  )
default

move-constructor: default

Member Function Documentation

◆ GetBits()

size_t GetBits ( unsigned  bits)
inline

Get bits at the cursor.

Parameters
bitsnumber of bits to return
Returns
{bits} at the cursor

Definition at line 147 of file bit_stream.hpp.

References BitStreamWriter< BlockWriter >::buffer_, BitStreamWriter< BlockWriter >::buffer_bits_, BitStreamWriter< BlockWriter >::mask, and BitStreamWriter< BlockWriter >::pos_.

Referenced by LocationDetection< thrill::api::JoinNode::HashCount >::Flush().

◆ GetNumberOfOnesUntilNextZero()

unsigned GetNumberOfOnesUntilNextZero ( )
inline

Returns the number of continuous 1 bits at the cursor, followed by a zero.

Used in Golomb decoding.

Returns
Number of continuous 1 bits at the cursor, the zero is skipped.

Definition at line 194 of file bit_stream.hpp.

References BitStreamWriter< BlockWriter >::buffer_, BitStreamWriter< BlockWriter >::buffer_bits_, and BitStreamWriter< BlockWriter >::pos_.

◆ HasNextZeroTest()

bool HasNextZeroTest ( )
inline

Test if the buffer contains a zero or if another item can be read. This test is used by the Golomb decoder to check if another value is available.

Definition at line 174 of file bit_stream.hpp.

References BitStreamWriter< BlockWriter >::buffer_, BitStreamWriter< BlockWriter >::buffer_bits_, and BitStreamWriter< BlockWriter >::pos_.

◆ operator=() [1/2]

BitStreamReader& operator= ( const BitStreamReader< BlockReader > &  )
delete

non-copyable: delete assignment operator

◆ operator=() [2/2]

BitStreamReader& operator= ( BitStreamReader< BlockReader > &&  )
default

move-assignment operator: default

Member Data Documentation

◆ block_reader_

BlockReader& block_reader_
protected

Input BlockReader.

Definition at line 220 of file bit_stream.hpp.

◆ buffer_

size_t buffer_ = 0
protected

current buffer of 32/64 bits

Definition at line 223 of file bit_stream.hpp.

◆ pos_

size_t pos_ = buffer_bits_
protected

currently used number of bits

Definition at line 226 of file bit_stream.hpp.


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