Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 : size_t
protected

number of bits in buffer_

Enumerator
buffer_bits_ 

Definition at line 118 of file bit_stream.hpp.

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 : size_t
protected

highest bit set

Enumerator
msb_set 

Definition at line 124 of file bit_stream.hpp.

Constructor & Destructor Documentation

BitStreamReader ( BlockReader &  block_reader)
inlineexplicit

Definition at line 127 of file bit_stream.hpp.

BitStreamReader ( const BitStreamReader< BlockReader > &  )
delete

non-copyable: delete copy-constructor

BitStreamReader ( BitStreamReader< BlockReader > &&  )
default

move-constructor: default

Member Function Documentation

size_t GetBits ( unsigned  bits)
inline
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_.

Referenced by GolombBitStreamReader< BlockReader >::GetGolomb().

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_.

Referenced by GolombBitStreamReader< BlockReader >::HasNext().

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

non-copyable: delete assignment operator

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

move-assignment operator: default

Member Data Documentation

BlockReader& block_reader_
protected
size_t buffer_ = 0
protected

current buffer of 32/64 bits

Definition at line 223 of file bit_stream.hpp.

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: