Xapian::PostingIterator Class Reference

An iterator pointing to items in a list of postings. More...

#include <postingiterator.h>

Collaboration diagram for Xapian::PostingIterator:

Collaboration graph
[legend]

List of all members.

Classes

class  Internal
 Abstract base class for postlists. More...

Public Types

typedef std::input_iterator_tag iterator_category
 Allow use as an STL iterator.
typedef Xapian::docid value_type
 Allow use as an STL iterator.
typedef Xapian::doccount_diff difference_type
 Allow use as an STL iterator.
typedef Xapian::docidpointer
 Allow use as an STL iterator.
typedef Xapian::docidreference
 Allow use as an STL iterator.

Public Member Functions

 PostingIterator ()
 Default constructor - for declaring an uninitialised iterator.
 ~PostingIterator ()
 Destructor.
 PostingIterator (const PostingIterator &other)
 Copying is allowed.
void operator= (const PostingIterator &other)
 Assignment is allowed.
PostingIteratoroperator++ ()
DerefWrapper_< docidoperator++ (int)
void skip_to (Xapian::docid did)
 Advance the iterator to the specified docid.
Xapian::docid operator* () const
 Get the document id at the current position in the postlist.
Xapian::termcount get_doclength () const
 Get the length of the document at the current position in the postlist.
Xapian::termcount get_wdf () const
 Get the within document frequency of the document at the current position in the postlist.
PositionIterator positionlist_begin () const
 Return PositionIterator pointing to start of positionlist for current document.
PositionIterator positionlist_end () const
 Return PositionIterator pointing to end of positionlist for current document.
std::string get_description () const
 Return a string describing this object.

Private Member Functions

 PostingIterator (Internal *internal_)

Private Attributes

Xapian::Internal::RefCntPtr
< Internal
internal

Friends

class Database
bool operator== (const PostingIterator &a, const PostingIterator &b)
 Test equality of two PostingIterators.


Detailed Description

An iterator pointing to items in a list of postings.

Definition at line 42 of file postingiterator.h.


Member Typedef Documentation

Allow use as an STL iterator.

Definition at line 132 of file postingiterator.h.

typedef std::input_iterator_tag Xapian::PostingIterator::iterator_category

Allow use as an STL iterator.

Definition at line 130 of file postingiterator.h.

Allow use as an STL iterator.

Definition at line 133 of file postingiterator.h.

Allow use as an STL iterator.

Definition at line 134 of file postingiterator.h.

Allow use as an STL iterator.

Definition at line 131 of file postingiterator.h.


Constructor & Destructor Documentation

Xapian::PostingIterator::PostingIterator ( Internal internal_  )  [explicit, private]

Definition at line 31 of file ompostlistiterator.cc.

References internal.

Xapian::PostingIterator::PostingIterator (  ) 

Default constructor - for declaring an uninitialised iterator.

Definition at line 42 of file ompostlistiterator.cc.

References LOGCALL_VOID.

Xapian::PostingIterator::~PostingIterator (  ) 

Destructor.

Definition at line 46 of file ompostlistiterator.cc.

References LOGCALL_VOID.

Xapian::PostingIterator::PostingIterator ( const PostingIterator other  ) 

Copying is allowed.

The internals are reference counted, so copying is also cheap.

Definition at line 50 of file ompostlistiterator.cc.

References LOGCALL_VOID.


Member Function Documentation

string Xapian::PostingIterator::get_description (  )  const

Return a string describing this object.

Definition at line 124 of file ompostlistiterator.cc.

Referenced by DEFINE_TESTCASE().

Xapian::termcount Xapian::PostingIterator::get_doclength (  )  const

Get the length of the document at the current position in the postlist.

This information may be stored in the postlist, in which case this lookup should be extremely fast (indeed, not require further disk access). If the information is not present in the postlist, it will be retrieved from the database, at a greater performance cost.

Definition at line 97 of file ompostlistiterator.cc.

References Assert, internal, LOGCALL, and RETURN.

Referenced by DEFINE_TESTCASE(), closedb1_iterators::perform(), and show_db_stats().

Xapian::termcount Xapian::PostingIterator::get_wdf (  )  const

Get the within document frequency of the document at the current position in the postlist.

Definition at line 106 of file ompostlistiterator.cc.

References Assert, internal, LOGCALL, and RETURN.

Referenced by DEFINE_TESTCASE(), and main().

Xapian::docid Xapian::PostingIterator::operator* (  )  const

Get the document id at the current position in the postlist.

Definition at line 64 of file ompostlistiterator.cc.

References Assert, internal, LOGCALL, and RETURN.

DerefWrapper_<docid> Xapian::PostingIterator::operator++ ( int   )  [inline]

Definition at line 75 of file postingiterator.h.

Xapian::PostingIterator & Xapian::PostingIterator::operator++ (  ) 

Definition at line 73 of file ompostlistiterator.cc.

References Assert, internal, and LOGCALL_VOID.

void Xapian::PostingIterator::operator= ( const PostingIterator other  ) 

Assignment is allowed.

The internals are reference counted, so assignment is also cheap.

Definition at line 57 of file ompostlistiterator.cc.

References internal, and LOGCALL_VOID.

Xapian::PositionIterator Xapian::PostingIterator::positionlist_begin (  )  const

Return PositionIterator pointing to start of positionlist for current document.

Definition at line 115 of file ompostlistiterator.cc.

References Assert, internal, LOGCALL, and RETURN.

Referenced by main().

PositionIterator Xapian::PostingIterator::positionlist_end (  )  const [inline]

Return PositionIterator pointing to end of positionlist for current document.

Definition at line 116 of file postingiterator.h.

Referenced by main().

void Xapian::PostingIterator::skip_to ( Xapian::docid  did  ) 

Advance the iterator 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).

Definition at line 86 of file ompostlistiterator.cc.

References Assert, internal, and LOGCALL_VOID.

Referenced by Xapian::Compactor::Internal::add_source(), DEFINE_TESTCASE(), main(), Xapian::FixedWeightPostingSource::next(), and Xapian::FixedWeightPostingSource::skip_to().


Friends And Related Function Documentation

friend class Database [friend]

Definition at line 49 of file postingiterator.h.

bool operator== ( const PostingIterator a,
const PostingIterator b 
) [friend]

Test equality of two PostingIterators.

Definition at line 139 of file postingiterator.h.


Member Data Documentation

For internal use only.

Reference counted internals.

Definition at line 44 of file postingiterator.h.

Referenced by get_doclength(), get_wdf(), operator*(), operator++(), operator=(), Xapian::operator==(), positionlist_begin(), PostingIterator(), and skip_to().


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.