Xapian::TermIterator Class Reference

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

#include <termiterator.h>

Collaboration diagram for Xapian::TermIterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::input_iterator_tag iterator_category
 Allow use as an STL iterator.
typedef std::string value_type
typedef Xapian::termcount_diff difference_type
typedef std::string * pointer
typedef std::string & reference

Public Member Functions

 TermIterator (Internal *internal_)
 

For internal use only.

Reference counted internals.


 TermIterator ()
 Default constructor - for declaring an uninitialised iterator.
 ~TermIterator ()
 Destructor.
 TermIterator (const TermIterator &other)
 Copying is allowed.
void operator= (const TermIterator &other)
 Assignment is allowed.
std::string operator * () const
 Return the current term.
TermIteratoroperator++ ()
TermNameWrapper operator++ (int)
void skip_to (const std::string &tname)
 Skip the iterator to term tname, or the first term after tname if tname isn't in the list of terms being iterated.
Xapian::termcount get_wdf () const
 Return the wdf of the current term (if meaningful).
Xapian::doccount get_termfreq () const
 Return the term frequency of the current term (if meaningful).
Xapian::termcount positionlist_count () const
 Return length of positionlist for current term.
PositionIterator positionlist_begin () const
 Return PositionIterator pointing to start of positionlist for current term.
PositionIterator positionlist_end () const
 Return PositionIterator pointing to end of positionlist for current term.
std::string get_description () const
 Return a string describing this object.

Public Attributes

Xapian::Internal::RefCntPtr<
Internal
internal
 

For internal use only.

Reference counted internals.



Classes

class  Internal
 Abstract base class for termlists. More...

Detailed Description

An iterator pointing to items in a list of terms.

Definition at line 52 of file termiterator.h.


Member Typedef Documentation

typedef std::input_iterator_tag Xapian::TermIterator::iterator_category

Allow use as an STL iterator.

Definition at line 127 of file termiterator.h.

typedef std::string Xapian::TermIterator::value_type

Definition at line 128 of file termiterator.h.

typedef Xapian::termcount_diff Xapian::TermIterator::difference_type

Definition at line 129 of file termiterator.h.

typedef std::string* Xapian::TermIterator::pointer

Definition at line 130 of file termiterator.h.

typedef std::string& Xapian::TermIterator::reference

Definition at line 131 of file termiterator.h.


Constructor & Destructor Documentation

Xapian::TermIterator::TermIterator ( Internal internal_  )  [explicit]

For internal use only.

Reference counted internals.

Definition at line 40 of file omtermlistiterator.cc.

References handle_prune().

Xapian::TermIterator::TermIterator (  ) 

Default constructor - for declaring an uninitialised iterator.

Definition at line 50 of file omtermlistiterator.cc.

References DEBUGAPICALL.

Xapian::TermIterator::~TermIterator (  ) 

Destructor.

Definition at line 55 of file omtermlistiterator.cc.

References DEBUGAPICALL.

Xapian::TermIterator::TermIterator ( const TermIterator other  ) 

Copying is allowed.

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

Definition at line 59 of file omtermlistiterator.cc.

References DEBUGAPICALL.


Member Function Documentation

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

Assignment is allowed.

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

Definition at line 66 of file omtermlistiterator.cc.

References DEBUGAPICALL, and internal.

string Xapian::TermIterator::operator * (  )  const

Return the current term.

Definition at line 73 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, internal, and RETURN.

Xapian::TermIterator & Xapian::TermIterator::operator++ (  ) 

Definition at line 100 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, handle_prune(), and internal.

TermNameWrapper Xapian::TermIterator::operator++ ( int   )  [inline]

Definition at line 82 of file termiterator.h.

void Xapian::TermIterator::skip_to ( const std::string &  tname  ) 

Skip the iterator to term tname, or the first term after tname if tname isn't in the list of terms being iterated.

Referenced by DEFINE_TESTCASE().

Xapian::termcount Xapian::TermIterator::get_wdf (  )  const

Return the wdf of the current term (if meaningful).

The wdf (within document frequency) is the number of occurences of a term in a particular document.

Definition at line 82 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, internal, and RETURN.

Referenced by QuartzWritableDatabase::add_document_(), FlintWritableDatabase::add_document_(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), QuartzWritableDatabase::replace_document(), FlintWritableDatabase::replace_document(), QuartzTermListTable::set_entries(), FlintTermListTable::set_termlist(), and show_termlists().

Xapian::doccount Xapian::TermIterator::get_termfreq (  )  const

Return the term frequency of the current term (if meaningful).

The term frequency is the number of documents which a term indexes.

Definition at line 91 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, internal, and RETURN.

Referenced by DEFINE_TESTCASE(), main(), and QuartzTermListTable::set_entries().

Xapian::termcount Xapian::TermIterator::positionlist_count (  )  const

Return length of positionlist for current term.

Definition at line 123 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, internal, and RETURN.

Referenced by format_doc_termlist().

Xapian::PositionIterator Xapian::TermIterator::positionlist_begin (  )  const

Return PositionIterator pointing to start of positionlist for current term.

Definition at line 132 of file omtermlistiterator.cc.

References Assert, DEBUGAPICALL, internal, and RETURN.

Referenced by QuartzWritableDatabase::add_document_(), FlintWritableDatabase::add_document_(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), QuartzWritableDatabase::replace_document(), and FlintWritableDatabase::replace_document().

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

Return PositionIterator pointing to end of positionlist for current term.

Definition at line 118 of file termiterator.h.

Referenced by QuartzWritableDatabase::add_document_(), FlintWritableDatabase::add_document_(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), QuartzWritableDatabase::replace_document(), and FlintWritableDatabase::replace_document().

std::string Xapian::TermIterator::get_description (  )  const

Return a string describing this object.

Todo:
display contents of the object

Definition at line 141 of file omtermlistiterator.cc.


Member Data Documentation

Xapian::Internal::RefCntPtr<Internal> Xapian::TermIterator::internal

For internal use only.

Reference counted internals.

Definition at line 54 of file termiterator.h.

Referenced by get_termfreq(), get_wdf(), operator *(), operator++(), operator=(), Xapian::operator==(), positionlist_begin(), and positionlist_count().


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.