OrTermList Class Reference

#include <ortermlist.h>

Inheritance diagram for OrTermList:

Inheritance graph
[legend]
Collaboration diagram for OrTermList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OrTermList (TermList *left_, TermList *right_)
 ~OrTermList ()
Xapian::termcount get_approx_size () const
 Return approximate size of this termlist.
void accumulate_stats (Xapian::Internal::ExpandStats &stats) const
 Collate weighting information for the current term.
std::string get_termname () const
 Return the termname at the current position.
Xapian::termcount get_wdf () const
 Return the wdf for the term at the current position.
Xapian::doccount get_termfreq () const
 Return the term frequency for the term at the current position.
TermListnext ()
 Advance the current position to the next term in the termlist.
TermListskip_to (const std::string &term)
 Skip forward to the specified term.
bool at_end () const
 Return true if the current position is past the last term in this list.
Xapian::termcount positionlist_count () const
 Return the length of the position list for the current position.
Xapian::PositionIterator positionlist_begin () const
 Return a PositionIterator for the current position.

Protected Member Functions

void check_started () const
 Check that next() has already been called.

Protected Attributes

TermListleft
 The two TermList objects we're merging.
TermListright
std::string left_current
 The current term for left and right respectively.
std::string right_current


Detailed Description

Definition at line 32 of file ortermlist.h.


Constructor & Destructor Documentation

OrTermList::OrTermList ( TermList left_,
TermList right_ 
) [inline]

Definition at line 49 of file ortermlist.h.

OrTermList::~OrTermList (  ) 

Definition at line 39 of file ortermlist.cc.

References left, and right.


Member Function Documentation

void OrTermList::accumulate_stats ( Xapian::Internal::ExpandStats stats  )  const [virtual]

Collate weighting information for the current term.

Reimplemented from Xapian::TermIterator::Internal.

Definition at line 56 of file ortermlist.cc.

References Xapian::TermIterator::Internal::accumulate_stats(), check_started(), left, left_current, LOGCALL_VOID, right, and right_current.

bool OrTermList::at_end (  )  const [virtual]

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

Implements Xapian::TermIterator::Internal.

Definition at line 206 of file ortermlist.cc.

References Assert, Xapian::TermIterator::Internal::at_end(), check_started(), left, LOGCALL, RETURN, and right.

void OrTermList::check_started (  )  const [protected]

Check that next() has already been called.

Definition at line 33 of file ortermlist.cc.

References Assert, left_current, and right_current.

Referenced by accumulate_stats(), at_end(), FreqAdderOrTermList::get_termfreq(), get_termfreq(), get_termname(), and get_wdf().

Xapian::termcount OrTermList::get_approx_size (  )  const [virtual]

Return approximate size of this termlist.

Implements Xapian::TermIterator::Internal.

Definition at line 46 of file ortermlist.cc.

References Xapian::TermIterator::Internal::get_approx_size(), left, LOGCALL, RETURN, and right.

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

Return the term frequency for the term at the current position.

Implements Xapian::TermIterator::Internal.

Reimplemented in FreqAdderOrTermList.

Definition at line 84 of file ortermlist.cc.

References Assert, check_started(), Xapian::TermIterator::Internal::get_termfreq(), left, left_current, LOGCALL, RETURN, right, and right_current.

string OrTermList::get_termname (  )  const [virtual]

Return the termname at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 65 of file ortermlist.cc.

References check_started(), left_current, LOGCALL, RETURN, and right_current.

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

Return the wdf for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 74 of file ortermlist.cc.

References check_started(), Xapian::TermIterator::Internal::get_wdf(), left, left_current, LOGCALL, RETURN, right, and right_current.

TermList * OrTermList::next (  )  [virtual]

Advance the current position to the next term in the termlist.

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

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::TermIterator::Internal.

Definition at line 116 of file ortermlist.cc.

References AssertEq, Xapian::TermIterator::Internal::at_end(), Xapian::TermIterator::Internal::get_termname(), handle_prune(), left, left_current, LOGCALL, Xapian::TermIterator::Internal::next(), RETURN, right, and right_current.

Xapian::PositionIterator OrTermList::positionlist_begin (  )  const [virtual]

Return a PositionIterator for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 224 of file ortermlist.cc.

References Assert.

Xapian::termcount OrTermList::positionlist_count (  )  const [virtual]

Return the length of the position list for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 217 of file ortermlist.cc.

References Assert.

TermList * OrTermList::skip_to ( const std::string &  term  )  [virtual]

Skip forward to the specified term.

If the specified term isn't in the list, position ourselves on the first term after tname (or at_end() if no terms after tname exist).

Implements Xapian::TermIterator::Internal.

Definition at line 161 of file ortermlist.cc.

References AssertEq, Xapian::TermIterator::Internal::at_end(), Xapian::TermIterator::Internal::get_termname(), handle_prune(), left, left_current, LOGCALL, RETURN, right, right_current, and Xapian::TermIterator::Internal::skip_to().


Member Data Documentation

TermList* OrTermList::left [protected]

The two TermList objects we're merging.

Definition at line 35 of file ortermlist.h.

Referenced by accumulate_stats(), at_end(), get_approx_size(), FreqAdderOrTermList::get_termfreq(), get_termfreq(), get_wdf(), next(), skip_to(), and ~OrTermList().

std::string OrTermList::left_current [protected]

The current term for left and right respectively.

Until next() is first called, these will be empty strings. Once next() has been called, they won't be empty (since the empty string isn't a valid term).

Definition at line 43 of file ortermlist.h.

Referenced by accumulate_stats(), check_started(), FreqAdderOrTermList::get_termfreq(), get_termfreq(), get_termname(), get_wdf(), next(), and skip_to().

TermList * OrTermList::right [protected]

std::string OrTermList::right_current [protected]


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

Documentation for Xapian (version 1.2.8).
Generated on 14 Dec 2011 by Doxygen 1.5.9.