MultiPostList Class Reference

#include <multi_postlist.h>

Inheritance diagram for MultiPostList:

Inheritance graph
[legend]
Collaboration diagram for MultiPostList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~MultiPostList ()
Xapian::doccount get_termfreq () const
 Return the exact term frequency.
Xapian::docid get_docid () const
 Return the current docid.
Xapian::doclength get_doclength () const
 Return the length of current document.
Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position.
PositionListread_position_list ()
 Read the position list for the term in the current document and return a pointer to it (owned by the PostList).
PositionListopen_position_list () const
 Read the position list for the term in the current document and return a pointer to it (not owned by the PostList).
PostListnext (Xapian::weight w_min)
 Advance the current position to the next document in the postlist.
PostListskip_to (Xapian::docid did, Xapian::weight w_min)
 Skip forward to the specified docid.
bool at_end () const
 Return true if the current position is past the last entry in this list.
std::string get_description () const
 Return a string description of this object.

Private Member Functions

 MultiPostList (std::vector< LeafPostList * > &pls, const Xapian::Database &this_db_)

Private Attributes

std::vector< LeafPostList * > postlists
const Xapian::Databasethis_db
bool finished
Xapian::docid currdoc
bool freq_initialised
Xapian::doccount termfreq
Xapian::doccount multiplier

Friends

class Xapian::Database

Detailed Description

Definition at line 28 of file multi_postlist.h.


Constructor & Destructor Documentation

MultiPostList::MultiPostList ( std::vector< LeafPostList * > &  pls,
const Xapian::Database this_db_ 
) [private]

Definition at line 34 of file multi_postlist.cc.

References multiplier.

MultiPostList::~MultiPostList (  ) 

Definition at line 46 of file multi_postlist.cc.

References postlists.


Member Function Documentation

Xapian::doccount MultiPostList::get_termfreq (  )  const [virtual]

Return the exact term frequency.

Leaf postlists have an exact termfreq, which get_termfreq_min(), get_termfreq_max(), and get_termfreq_est() all report.

Implements LeafPostList.

Definition at line 56 of file multi_postlist.cc.

References DEBUGLINE, freq_initialised, postlists, and termfreq.

Referenced by get_description().

Xapian::docid MultiPostList::get_docid (  )  const [virtual]

Return the current docid.

Implements Xapian::PostingIterator::Internal.

Definition at line 73 of file multi_postlist.cc.

References Assert, at_end(), currdoc, DEBUGCALL, and RETURN.

Referenced by get_doclength().

Xapian::doclength MultiPostList::get_doclength (  )  const [virtual]

Return the length of current document.

Implements Xapian::PostingIterator::Internal.

Definition at line 82 of file multi_postlist.cc.

References Assert, AssertEqParanoid, at_end(), currdoc, DEBUGCALL, get_docid(), Xapian::Database::get_doclength(), multiplier, postlists, RETURN, and this_db.

Xapian::termcount MultiPostList::get_wdf (  )  const [virtual]

Return the wdf for the document at the current position.

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::PostingIterator::Internal.

Definition at line 93 of file multi_postlist.cc.

References currdoc, multiplier, and postlists.

PositionList * MultiPostList::read_position_list (  )  [virtual]

Read the position list for the term in the current document and return a pointer to it (owned by the PostList).

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::PostingIterator::Internal.

Definition at line 99 of file multi_postlist.cc.

References currdoc, multiplier, and postlists.

PositionList * MultiPostList::open_position_list (  )  const [virtual]

Read the position list for the term in the current document and return a pointer to it (not owned by the PostList).

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::PostingIterator::Internal.

Definition at line 105 of file multi_postlist.cc.

References currdoc, multiplier, and postlists.

PostList * MultiPostList::next ( Xapian::weight  w_min  )  [virtual]

Advance the current position to the next document in the postlist.

The list starts before the first entry in the list, so next() must be called before any methods which need the context of the current position.

Parameters:
w_min The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore).
Returns:
If a non-NULL pointer is returned, then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::PostingIterator::Internal.

Definition at line 111 of file multi_postlist.cc.

References Assert, at_end(), currdoc, DEBUGCALL, DEBUGLINE, finished, multiplier, postlists, and RETURN.

PostList * MultiPostList::skip_to ( Xapian::docid  ,
Xapian::weight  w_min 
) [virtual]

Skip forward to the specified docid.

If the specified docid isn't in the list, position ourselves on the first document after it (or at_end() if no greater docids are present).

Parameters:
w_min The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore).
Returns:
If a non-NULL pointer is returned, then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::PostingIterator::Internal.

Definition at line 148 of file multi_postlist.cc.

References Assert, at_end(), currdoc, DEBUGCALL, finished, multiplier, postlists, and RETURN.

bool MultiPostList::at_end (  )  const [virtual]

Return true if the current position is past the last entry in this list.

Implements Xapian::PostingIterator::Internal.

Definition at line 179 of file multi_postlist.cc.

References finished.

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

std::string MultiPostList::get_description (  )  const [virtual]

Return a string description of this object.

Implements Xapian::PostingIterator::Internal.

Definition at line 185 of file multi_postlist.cc.

References get_termfreq(), om_tostring(), and postlists.


Friends And Related Function Documentation

friend class Xapian::Database [friend]

Definition at line 29 of file multi_postlist.h.


Member Data Documentation

std::vector<LeafPostList *> MultiPostList::postlists [private]

Definition at line 31 of file multi_postlist.h.

Referenced by get_description(), get_doclength(), get_termfreq(), get_wdf(), next(), open_position_list(), read_position_list(), skip_to(), and ~MultiPostList().

const Xapian::Database& MultiPostList::this_db [private]

Definition at line 33 of file multi_postlist.h.

Referenced by get_doclength().

bool MultiPostList::finished [private]

Definition at line 35 of file multi_postlist.h.

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

Xapian::docid MultiPostList::currdoc [private]

Definition at line 36 of file multi_postlist.h.

Referenced by get_docid(), get_doclength(), get_wdf(), next(), open_position_list(), read_position_list(), and skip_to().

bool MultiPostList::freq_initialised [mutable, private]

Definition at line 38 of file multi_postlist.h.

Referenced by get_termfreq().

Xapian::doccount MultiPostList::termfreq [mutable, private]

Definition at line 39 of file multi_postlist.h.

Referenced by get_termfreq().

Xapian::doccount MultiPostList::multiplier [private]

Definition at line 41 of file multi_postlist.h.

Referenced by get_doclength(), get_wdf(), MultiPostList(), next(), open_position_list(), read_position_list(), and skip_to().


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.