xapian-core  2.0.0
Public Member Functions | Private Attributes | List of all members
Honey::PostingChunkReader Class Reference

#include <honey_postlist.h>

Public Member Functions

 PostingChunkReader ()
 Create an uninitialised PostingChunkReader. More...
 
void init ()
 Initialise already at_end(). More...
 
void init (Xapian::doccount tf, Xapian::termcount cf_info)
 Initialise. More...
 
void assign (const char *p_, size_t len, Xapian::docid did)
 
void assign (const char *p_, size_t len, Xapian::docid did_, Xapian::docid last_did_in_chunk, Xapian::termcount wdf_)
 
bool at_end () const
 
Xapian::docid get_docid () const
 
Xapian::termcount get_wdf () const
 
bool next ()
 Advance, returning false if we've run out of data. More...
 
bool skip_to (Xapian::docid target)
 Skip ahead, returning false if we've run out of data. More...
 

Private Attributes

const char * p = nullptr
 
const char * end
 
Xapian::docid did
 
Xapian::termcount wdf
 
Xapian::docid last_did
 The last docid in this chunk. More...
 
Xapian::doccount termfreq
 
Xapian::termcount collfreq_info
 Value "to do with" collection frequency. More...
 

Detailed Description

Definition at line 78 of file honey_postlist.h.

Constructor & Destructor Documentation

◆ PostingChunkReader()

Honey::PostingChunkReader::PostingChunkReader ( )
inline

Create an uninitialised PostingChunkReader.

Definition at line 116 of file honey_postlist.h.

Member Function Documentation

◆ assign() [1/2]

void Honey::PostingChunkReader::assign ( const char *  p_,
size_t  len,
Xapian::docid  did 
)

◆ assign() [2/2]

void Honey::PostingChunkReader::assign ( const char *  p_,
size_t  len,
Xapian::docid  did_,
Xapian::docid  last_did_in_chunk,
Xapian::termcount  wdf_ 
)

Definition at line 315 of file honey_postlist.cc.

References did, end, last_did, p, and wdf.

◆ at_end()

bool Honey::PostingChunkReader::at_end ( ) const
inline

Definition at line 137 of file honey_postlist.h.

References p.

Referenced by HoneyPostList::next(), and HoneyPostList::skip_to().

◆ get_docid()

Xapian::docid Honey::PostingChunkReader::get_docid ( ) const
inline

Definition at line 139 of file honey_postlist.h.

References did.

Referenced by HoneyPostList::get_docid(), HoneyPostList::get_docid_range(), and HoneyPostList::next().

◆ get_wdf()

Xapian::termcount Honey::PostingChunkReader::get_wdf ( ) const
inline

Definition at line 141 of file honey_postlist.h.

References wdf.

Referenced by HoneyPostList::get_wdf().

◆ init() [1/2]

void Honey::PostingChunkReader::init ( )
inline

Initialise already at_end().

Definition at line 119 of file honey_postlist.h.

References p, and termfreq.

Referenced by HoneyPostList::HoneyPostList().

◆ init() [2/2]

void Honey::PostingChunkReader::init ( Xapian::doccount  tf,
Xapian::termcount  cf_info 
)
inline

Initialise.

Definition at line 125 of file honey_postlist.h.

References collfreq_info, p, and termfreq.

◆ next()

bool Honey::PostingChunkReader::next ( )

Advance, returning false if we've run out of data.

Definition at line 327 of file honey_postlist.cc.

References collfreq_info, did, end, last_did, p, termfreq, TOP_BIT_SET, unpack_uint(), and wdf.

Referenced by HoneyPostList::next().

◆ skip_to()

bool Honey::PostingChunkReader::skip_to ( Xapian::docid  target)

Skip ahead, returning false if we've run out of data.

Definition at line 360 of file honey_postlist.cc.

References AssertEq, collfreq_info, did, end, last_did, p, rare, termfreq, TOP_BIT_SET, unpack_uint(), unpack_uint_backwards(), and wdf.

Referenced by HoneyPostList::skip_to().

Member Data Documentation

◆ collfreq_info

Xapian::termcount Honey::PostingChunkReader::collfreq_info
private

Value "to do with" collection frequency.

In order to keep this class small in size the meaning of the value of collfreq_info depends on the context (which can be determined from the values of other members):

  • if (collfreq == 0 || tf <= 2) collfreq_info = collfreq;
  • otherwise:
    • if wdf is wdf_same for all documents (with the possible exception of the first) then to start with:

      collfreq_info = wdf_same | TOP_BIT_SET

      and once we've moved onto the second entry:

      collfreq_info = 0

    • else collfreq_info = 1

Definition at line 112 of file honey_postlist.h.

Referenced by assign(), init(), next(), and skip_to().

◆ did

Xapian::docid Honey::PostingChunkReader::did
private

Definition at line 82 of file honey_postlist.h.

Referenced by assign(), get_docid(), next(), and skip_to().

◆ end

const char* Honey::PostingChunkReader::end
private

Definition at line 80 of file honey_postlist.h.

Referenced by assign(), next(), and skip_to().

◆ last_did

Xapian::docid Honey::PostingChunkReader::last_did
private

The last docid in this chunk.

Definition at line 87 of file honey_postlist.h.

Referenced by assign(), next(), and skip_to().

◆ p

const char* Honey::PostingChunkReader::p = nullptr
private

Definition at line 79 of file honey_postlist.h.

Referenced by assign(), at_end(), init(), next(), and skip_to().

◆ termfreq

Xapian::doccount Honey::PostingChunkReader::termfreq
private

Definition at line 89 of file honey_postlist.h.

Referenced by init(), next(), and skip_to().

◆ wdf

Xapian::termcount Honey::PostingChunkReader::wdf
private

Definition at line 84 of file honey_postlist.h.

Referenced by assign(), get_wdf(), next(), and skip_to().


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