Xapian::PostingIterator::Internal Class Reference

Abstract base class for postlists. More...

#include <postlist.h>

Inheritance diagram for Xapian::PostingIterator::Internal:

Inheritance graph
[legend]
Collaboration diagram for Xapian::PostingIterator::Internal:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~Internal ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor.
virtual Xapian::doccount get_termfreq_min () const=0
 Get a lower bound on the number of documents indexed by this term.
virtual Xapian::doccount get_termfreq_max () const=0
 Get an upper bound on the number of documents indexed by this term.
virtual Xapian::doccount get_termfreq_est () const=0
 Get an estimate of the number of documents indexed by this term.
virtual Xapian::weight get_maxweight () const=0
 Return an upper bound on what get_weight() can return.
virtual Xapian::docid get_docid () const=0
 Return the current docid.
virtual Xapian::doclength get_doclength () const=0
 Return the length of current document.
virtual Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position.
virtual Xapian::weight get_weight () const=0
 Return the weight contribution for the current position.
virtual const std::string * get_collapse_key () const
 If the collapse key is already known, return it.
virtual bool at_end () const=0
 Return true if the current position is past the last entry in this list.
virtual Xapian::weight recalc_maxweight ()=0
 Recalculate the upper bound on what get_weight() can return.
virtual PositionListread_position_list ()
 Read the position list for the term in the current document and return a pointer to it (owned by the PostList).
virtual 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).
virtual Internalnext (Xapian::weight w_min)=0
 Advance the current position to the next document in the postlist.
virtual Internalskip_to (Xapian::docid, Xapian::weight w_min)=0
 Skip forward to the specified docid.
virtual Internalcheck (Xapian::docid did, Xapian::weight w_min, bool &valid)
 Check if the specified docid occurs in this postlist.
Internalnext ()
 Advance the current position to the next document in the postlist.
Internalskip_to (Xapian::docid did)
 Skip forward to the specified docid.
virtual std::string get_description () const=0
 Return a string description of this object.

Protected Member Functions

 Internal ()
 Only constructable as a base class for derived classes.

Private Member Functions

void operator= (const Internal &)
 Don't allow assignment.
 Internal (const Internal &)
 Don't allow copying.

Detailed Description

Abstract base class for postlists.

Definition at line 33 of file postlist.h.


Constructor & Destructor Documentation

Xapian::PostingIterator::Internal::Internal ( const Internal  )  [private]

Don't allow copying.

Xapian::PostingIterator::Internal::Internal (  )  [inline, protected]

Only constructable as a base class for derived classes.

Definition at line 42 of file postlist.h.

Xapian::PostingIterator::Internal::~Internal (  )  [virtual]

We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor.

Definition at line 31 of file postlist.cc.


Member Function Documentation

void Xapian::PostingIterator::Internal::operator= ( const Internal  )  [private]

Don't allow assignment.

virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_min (  )  const [pure virtual]

Get a lower bound on the number of documents indexed by this term.

Implemented in LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::get_termfreq_min(), OrPostList::get_termfreq_min(), MultiAndPostList::get_termfreq_min(), ExtraWeightPostList::get_termfreq_min(), AndPostList::get_termfreq_min(), AndNotPostList::get_termfreq_min(), and AndMaybePostList::get_termfreq_min().

virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_max (  )  const [pure virtual]

Get an upper bound on the number of documents indexed by this term.

Implemented in LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::get_termfreq_max(), SelectPostList::get_termfreq_max(), OrPostList::get_termfreq_max(), MultiAndPostList::get_termfreq_max(), ExtraWeightPostList::get_termfreq_max(), AndPostList::get_termfreq_max(), AndNotPostList::get_termfreq_max(), AndMaybePostList::get_termfreq_max(), XorPostList::get_termfreq_min(), AndNotPostList::get_termfreq_min(), and CmpMaxOrTerms::operator()().

virtual Xapian::doccount Xapian::PostingIterator::Internal::get_termfreq_est (  )  const [pure virtual]

Get an estimate of the number of documents indexed by this term.

It should always be true that: get_termfreq_min() <= get_termfreq_est() <= get_termfreq_max()

Implemented in LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExactPhrasePostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, NearPostList, PhrasePostList, ValueRangePostList, and XorPostList.

Referenced by AndPostList::AndPostList(), XorPostList::get_termfreq_est(), PhrasePostList::get_termfreq_est(), NearPostList::get_termfreq_est(), OrPostList::get_termfreq_est(), ExtraWeightPostList::get_termfreq_est(), ExactPhrasePostList::get_termfreq_est(), AndPostList::get_termfreq_est(), AndNotPostList::get_termfreq_est(), AndMaybePostList::get_termfreq_est(), ComparePostListTermFreqAscending::operator()(), and MultiAndPostList::ComparePostListTermFreqAscending::operator()().

virtual Xapian::weight Xapian::PostingIterator::Internal::get_maxweight (  )  const [pure virtual]

Return an upper bound on what get_weight() can return.

Implemented in EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by AndMaybePostList::AndMaybePostList(), AndPostList::AndPostList(), SelectPostList::get_maxweight(), ExtraWeightPostList::get_maxweight(), AndNotPostList::get_maxweight(), MultiMatch::getorrecalc_maxweight(), and CmpMaxOrTerms::operator()().

virtual Xapian::docid Xapian::PostingIterator::Internal::get_docid (  )  const [pure virtual]

Return the current docid.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::advance_to_next_match(), AndNotPostList::advance_to_next_match(), MultiAndPostList::find_next_match(), SelectPostList::get_docid(), ExtraWeightPostList::get_docid(), XorPostList::next(), ValueRangePostList::next(), ValueGePostList::next(), OrPostList::next(), AndPostList::process_next_or_skip_to(), AndMaybePostList::process_next_or_skip_to(), XorPostList::skip_to(), and OrPostList::skip_to().

virtual Xapian::doclength Xapian::PostingIterator::Internal::get_doclength (  )  const [pure virtual]

Return the length of current document.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::get_doclength(), SelectPostList::get_doclength(), OrPostList::get_doclength(), MultiAndPostList::get_doclength(), ExtraWeightPostList::get_doclength(), AndPostList::get_doclength(), AndNotPostList::get_doclength(), AndMaybePostList::get_doclength(), ExtraWeightPostList::get_weight(), and LeafPostList::get_weight().

Xapian::termcount Xapian::PostingIterator::Internal::get_wdf (  )  const [virtual]

Return the wdf for the document at the current position.

The default implementation throws Xapian::UnimplementedError.

Reimplemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, BranchPostList, ExactPhrasePostList, MergePostList, MultiAndPostList, NearPostList, and PhrasePostList.

Definition at line 34 of file postlist.cc.

Referenced by BranchPostList::get_wdf(), and LeafPostList::get_weight().

virtual Xapian::weight Xapian::PostingIterator::Internal::get_weight (  )  const [pure virtual]

Return the weight contribution for the current position.

Implemented in EmptyPostList, LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::get_weight(), SelectPostList::get_weight(), OrPostList::get_weight(), ExtraWeightPostList::get_weight(), AndPostList::get_weight(), AndNotPostList::get_weight(), and AndMaybePostList::get_weight().

const string * Xapian::PostingIterator::Internal::get_collapse_key (  )  const [virtual]

If the collapse key is already known, return it.

This is implemented by MSetPostList (and MergePostList). Other subclasses rely on the default implementation which just returns NULL.

Reimplemented in MergePostList, and MSetPostList.

Definition at line 40 of file postlist.cc.

Referenced by MultiMatch::get_collapse_key().

virtual bool Xapian::PostingIterator::Internal::at_end (  )  const [pure virtual]

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

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::advance_to_next_match(), AndNotPostList::advance_to_next_match(), SelectPostList::at_end(), OrPostList::at_end(), ExtraWeightPostList::at_end(), XorPostList::next(), ValueRangePostList::next(), ValueGePostList::next(), SelectPostList::next(), OrPostList::next(), InMemoryDatabase::open_post_list(), AndPostList::process_next_or_skip_to(), AndMaybePostList::process_next_or_skip_to(), and SelectPostList::skip_to().

virtual Xapian::weight Xapian::PostingIterator::Internal::recalc_maxweight (  )  [pure virtual]

Recalculate the upper bound on what get_weight() can return.

If the tree has pruned, get_maxweight() may use cached values. Calling this method instead forces a full recalculation.

Implemented in LeafPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueRangePostList, and XorPostList.

Referenced by QueryOptimiser::do_or_like(), MultiMatch::getorrecalc_maxweight(), XorPostList::recalc_maxweight(), SelectPostList::recalc_maxweight(), OrPostList::recalc_maxweight(), ExtraWeightPostList::recalc_maxweight(), AndPostList::recalc_maxweight(), AndNotPostList::recalc_maxweight(), and AndMaybePostList::recalc_maxweight().

virtual PositionList* Xapian::PostingIterator::Internal::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 in ContiguousAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, ExtraWeightPostList, SelectPostList, and ValueRangePostList.

Referenced by SelectPostList::read_position_list(), and ExtraWeightPostList::read_position_list().

virtual PositionList* Xapian::PostingIterator::Internal::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 in ContiguousAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, ExtraWeightPostList, SelectPostList, and ValueRangePostList.

Referenced by SelectPostList::open_position_list(), and ExtraWeightPostList::open_position_list().

virtual Internal* Xapian::PostingIterator::Internal::next ( Xapian::weight  w_min  )  [pure 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.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueGePostList, ValueRangePostList, and XorPostList.

Referenced by ValueRangePostList::next(), ValueGePostList::next(), SelectPostList::next(), ExtraWeightPostList::next(), AndPostList::next(), AndNotPostList::next(), AndMaybePostList::next(), next_handling_prune(), and MultiAndPostList::next_helper().

virtual Internal* Xapian::PostingIterator::Internal::skip_to ( Xapian::docid  ,
Xapian::weight  w_min 
) [pure 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.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, SelectPostList, ValueGePostList, ValueRangePostList, and XorPostList.

Referenced by ValueRangePostList::next(), ValueGePostList::next(), SelectPostList::skip_to(), ExtraWeightPostList::skip_to(), AndPostList::skip_to(), AndNotPostList::skip_to(), AndMaybePostList::skip_to(), skip_to(), skip_to_handling_prune(), and MultiAndPostList::skip_to_helper().

virtual Internal* Xapian::PostingIterator::Internal::check ( Xapian::docid  did,
Xapian::weight  w_min,
bool &  valid 
) [virtual]

Check if the specified docid occurs in this postlist.

The caller is required to ensure that the specified docid actually exists in the database.

This method acts like skip_to() if that can be done at little extra cost, in which case it then sets valid to true.

Otherwise it simply checks if a particular docid is present. If it is, valid is set to true. If it isn't, it sets valid to false, and leaves the position unspecified (and hence the result of calling methods which depends on the current position, such as get_docid(), are also unspecified). In this state, next() will advance to the first matching position after docid, and skip_to() will act as it would if the position was the first matching position after docid.

The default implementation calls skip_to().

Reimplemented in ValueGePostList, and ValueRangePostList.

Referenced by MultiAndPostList::check_helper().

Internal* Xapian::PostingIterator::Internal::next (  )  [inline]

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

Any weight contribution is acceptable.

Definition at line 170 of file postlist.h.

Referenced by FlintModifiedPostList::next(), FlintModifiedPostList::skip_deletes(), ValueRangePostList::skip_to(), ValueGePostList::skip_to(), SelectPostList::skip_to(), NetworkPostList::skip_to(), and InMemoryPostList::skip_to().

Internal* Xapian::PostingIterator::Internal::skip_to ( Xapian::docid  did  )  [inline]

Skip forward to the specified docid.

Any weight contribution is acceptable.

Definition at line 176 of file postlist.h.

References skip_to().

virtual std::string Xapian::PostingIterator::Internal::get_description (  )  const [pure virtual]

Return a string description of this object.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, EmptyPostList, AndMaybePostList, AndNotPostList, AndPostList, ExactPhrasePostList, ExtraWeightPostList, MergePostList, MSetPostList, MultiAndPostList, OrPostList, NearPostList, PhrasePostList, SelectPostList, ValueGePostList, ValueRangePostList, and XorPostList.

Referenced by XorPostList::get_description(), SelectPostList::get_description(), PhrasePostList::get_description(), NearPostList::get_description(), OrPostList::get_description(), MultiAndPostList::get_description(), ExtraWeightPostList::get_description(), ExactPhrasePostList::get_description(), AndPostList::get_description(), AndNotPostList::get_description(), and AndMaybePostList::get_description().


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.