FlintAllTermsList Class Reference

#include <flint_alltermslist.h>

Inheritance diagram for FlintAllTermsList:

Inheritance graph
[legend]
Collaboration diagram for FlintAllTermsList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FlintAllTermsList (Xapian::Internal::RefCntPtr< const FlintDatabase > database_, const string &prefix_)
 ~FlintAllTermsList ()
 Destructor.
string get_termname () const
 Returns the current termname.
Xapian::doccount get_termfreq () const
 Returns the term frequency of the current term.
Xapian::termcount get_collection_freq () const
 Returns the collection frequency of the current term.
TermListnext ()
 Advance to the next term in the list.
TermListskip_to (const string &tname)
 Advance to the first term which is >= tname.
bool at_end () const
 True if we're off the end of the list.

Private Member Functions

 FlintAllTermsList (const FlintAllTermsList &)
 Copying is not allowed.
void operator= (const FlintAllTermsList &)
 Assignment is not allowed.
void read_termfreq_and_collfreq () const
 Read and cache the term frequency and collection frequency.

Private Attributes

Xapian::Internal::RefCntPtr<
const FlintDatabase
database
 Keep a reference to our database to stop it being deleted.
FlintCursorcursor
 A cursor which runs through the postlist table reading termnames from the keys.
string current_term
 The termname at the current position.
string prefix
 The prefix to restrict the terms to.
Xapian::termcount termfreq
 The term frequency of the term at the current position.
Xapian::termcount collfreq
 The collection frequency of the term at the current position.

Detailed Description

Definition at line 30 of file flint_alltermslist.h.


Constructor & Destructor Documentation

FlintAllTermsList::FlintAllTermsList ( const FlintAllTermsList  )  [private]

Copying is not allowed.

FlintAllTermsList::FlintAllTermsList ( Xapian::Internal::RefCntPtr< const FlintDatabase database_,
const string &  prefix_ 
) [inline]

Definition at line 66 of file flint_alltermslist.h.

References Assert, cursor, database, FlintCursor::find_entry_lt(), pack_string_preserving_sort(), and prefix.

FlintAllTermsList::~FlintAllTermsList (  ) 

Destructor.

Definition at line 44 of file flint_alltermslist.cc.

References cursor, and DEBUGCALL.


Member Function Documentation

void FlintAllTermsList::operator= ( const FlintAllTermsList  )  [private]

Assignment is not allowed.

void FlintAllTermsList::read_termfreq_and_collfreq (  )  const [private]

Read and cache the term frequency and collection frequency.

Definition at line 30 of file flint_alltermslist.cc.

References Assert, at_end(), collfreq, FlintCursor::current_tag, current_term, cursor, DEBUGCALL, FlintPostList::read_number_of_entries(), FlintCursor::read_tag(), and termfreq.

Referenced by get_collection_freq(), and get_termfreq().

string FlintAllTermsList::get_termname (  )  const [virtual]

Returns the current termname.

Either next() or skip_to() must have been called before this method can be called.

Implements AllTermsList.

Definition at line 51 of file flint_alltermslist.cc.

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

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

Returns the term frequency of the current term.

Either next() or skip_to() must have been called before this method can be called.

Implements AllTermsList.

Definition at line 60 of file flint_alltermslist.cc.

References Assert, at_end(), current_term, DEBUGCALL, read_termfreq_and_collfreq(), RETURN, and termfreq.

Xapian::termcount FlintAllTermsList::get_collection_freq (  )  const [virtual]

Returns the collection frequency of the current term.

Either next() or skip_to() must have been called before this method can be called.

Implements AllTermsList.

Definition at line 70 of file flint_alltermslist.cc.

References Assert, at_end(), collfreq, current_term, DEBUGCALL, read_termfreq_and_collfreq(), RETURN, and termfreq.

TermList * FlintAllTermsList::next (  )  [virtual]

Advance to the next term in the list.

Implements AllTermsList.

Definition at line 80 of file flint_alltermslist.cc.

References FlintCursor::after_end(), Assert, at_end(), FlintCursor::current_key, current_term, cursor, DEBUGCALL, FlintCursor::next(), prefix, RETURN, startswith(), termfreq, FlintCursor::to_end(), and unpack_string_preserving_sort().

TermList * FlintAllTermsList::skip_to ( const string &  tname  ) 

Advance to the first term which is >= tname.

Definition at line 117 of file flint_alltermslist.cc.

References FlintCursor::after_end(), Assert, at_end(), FlintCursor::current_key, current_term, cursor, DEBUGCALL, FlintCursor::find_entry_ge(), pack_string_preserving_sort(), prefix, RETURN, startswith(), termfreq, FlintCursor::to_end(), and unpack_string_preserving_sort().

bool FlintAllTermsList::at_end (  )  const [virtual]

True if we're off the end of the list.

Implements AllTermsList.

Definition at line 152 of file flint_alltermslist.cc.

References FlintCursor::after_end(), cursor, DEBUGCALL, and RETURN.

Referenced by get_collection_freq(), get_termfreq(), get_termname(), next(), read_termfreq_and_collfreq(), and skip_to().


Member Data Documentation

Xapian::Internal::RefCntPtr<const FlintDatabase> FlintAllTermsList::database [private]

Keep a reference to our database to stop it being deleted.

Definition at line 38 of file flint_alltermslist.h.

Referenced by FlintAllTermsList().

FlintCursor* FlintAllTermsList::cursor [private]

A cursor which runs through the postlist table reading termnames from the keys.

Definition at line 43 of file flint_alltermslist.h.

Referenced by at_end(), FlintAllTermsList(), next(), read_termfreq_and_collfreq(), skip_to(), and ~FlintAllTermsList().

string FlintAllTermsList::current_term [private]

The termname at the current position.

Definition at line 46 of file flint_alltermslist.h.

Referenced by get_collection_freq(), get_termfreq(), get_termname(), next(), read_termfreq_and_collfreq(), and skip_to().

string FlintAllTermsList::prefix [private]

The prefix to restrict the terms to.

Definition at line 49 of file flint_alltermslist.h.

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

Xapian::termcount FlintAllTermsList::termfreq [mutable, private]

The term frequency of the term at the current position.

If this value is zero, then we haven't read the term frequency or collection frequency for the current term yet. We need to call read_termfreq_and_collfreq() to read these.

Definition at line 57 of file flint_alltermslist.h.

Referenced by get_collection_freq(), get_termfreq(), next(), read_termfreq_and_collfreq(), and skip_to().

Xapian::termcount FlintAllTermsList::collfreq [mutable, private]

The collection frequency of the term at the current position.

Definition at line 60 of file flint_alltermslist.h.

Referenced by get_collection_freq(), and read_termfreq_and_collfreq().


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.