xapian-core  1.4.27
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Xapian::BitReader Class Reference

Read a stream created by BitWriter. More...

#include <bitstream.h>

+ Collaboration diagram for Xapian::BitReader:

Classes

struct  DIStack
 
struct  DIState
 

Public Member Functions

 BitReader ()
 
 BitReader (const std::string &buf_)
 
 BitReader (const std::string &buf_, size_t skip)
 
void init (const std::string &buf_, size_t skip=0)
 
Xapian::termpos decode (Xapian::termpos outof, bool force=false)
 
bool check_all_gone () const
 
void decode_interpolative (int j, int k, Xapian::termpos pos_j, Xapian::termpos pos_k)
 Perform interpolative decoding between elements between j and k. More...
 
Xapian::termpos decode_interpolative_next ()
 Perform on-demand interpolative decoding. More...
 

Private Member Functions

Xapian::termpos read_bits (int count)
 

Private Attributes

std::string buf
 
size_t idx
 
int n_bits
 
Xapian::termpos acc
 
std::vector< DIStackdi_stack
 
DIState di_current
 

Detailed Description

Read a stream created by BitWriter.

Definition at line 64 of file bitstream.h.

Constructor & Destructor Documentation

◆ BitReader() [1/3]

Xapian::BitReader::BitReader ( )
inline

Definition at line 118 of file bitstream.h.

◆ BitReader() [2/3]

Xapian::BitReader::BitReader ( const std::string &  buf_)
inlineexplicit

Definition at line 121 of file bitstream.h.

◆ BitReader() [3/3]

Xapian::BitReader::BitReader ( const std::string &  buf_,
size_t  skip 
)
inline

Definition at line 125 of file bitstream.h.

Member Function Documentation

◆ check_all_gone()

bool Xapian::BitReader::check_all_gone ( ) const
inline

Definition at line 145 of file bitstream.h.

◆ decode()

Xapian::termpos Xapian::BitReader::decode ( Xapian::termpos  outof,
bool  force = false 
)

◆ decode_interpolative()

void Xapian::BitReader::decode_interpolative ( int  j,
int  k,
Xapian::termpos  pos_j,
Xapian::termpos  pos_k 
)

Perform interpolative decoding between elements between j and k.

Definition at line 224 of file bitstream.cc.

References Assert, and highest_order_bit().

◆ decode_interpolative_next()

Xapian::termpos Xapian::BitReader::decode_interpolative_next ( )

Perform on-demand interpolative decoding.

Definition at line 234 of file bitstream.cc.

References Assert, and decode().

◆ init()

void Xapian::BitReader::init ( const std::string &  buf_,
size_t  skip = 0 
)
inline

Definition at line 129 of file bitstream.h.

References decode(), and Xapian::BitReader::DIState::uninit().

◆ read_bits()

Xapian::termpos Xapian::BitReader::read_bits ( int  count)
private

Definition at line 197 of file bitstream.cc.

References Assert.

Member Data Documentation

◆ acc

Xapian::termpos Xapian::BitReader::acc
private

Definition at line 68 of file bitstream.h.

◆ buf

std::string Xapian::BitReader::buf
private

Definition at line 65 of file bitstream.h.

◆ di_current

DIState Xapian::BitReader::di_current
private

Definition at line 114 of file bitstream.h.

◆ di_stack

std::vector<DIStack> Xapian::BitReader::di_stack
private

Definition at line 113 of file bitstream.h.

◆ idx

size_t Xapian::BitReader::idx
private

Definition at line 66 of file bitstream.h.

◆ n_bits

int Xapian::BitReader::n_bits
private

Definition at line 67 of file bitstream.h.


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