#include <brass_alltermslist.h>


Public Member Functions | |
| BrassAllTermsList (Xapian::Internal::RefCntPtr< const BrassDatabase > database_, const std::string &prefix_) | |
| ~BrassAllTermsList () | |
| Destructor. | |
| std::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. | |
| TermList * | next () |
| Advance to the next term in the list. | |
| TermList * | skip_to (const std::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 | |
| BrassAllTermsList (const BrassAllTermsList &) | |
| Copying is not allowed. | |
| void | operator= (const BrassAllTermsList &) |
| 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 BrassDatabase > | database |
| Keep a reference to our database to stop it being deleted. | |
| BrassCursor * | cursor |
| A cursor which runs through the postlist table reading termnames from the keys. | |
| std::string | current_term |
| The termname at the current position. | |
| std::string | prefix |
| The prefix to restrict the terms to. | |
| Xapian::doccount | termfreq |
| The term frequency of the term at the current position. | |
| Xapian::termcount | collfreq |
| The collection frequency of the term at the current position. | |
Definition at line 30 of file brass_alltermslist.h.
| BrassAllTermsList::BrassAllTermsList | ( | const BrassAllTermsList & | ) | [private] |
Copying is not allowed.
| BrassAllTermsList::BrassAllTermsList | ( | Xapian::Internal::RefCntPtr< const BrassDatabase > | database_, | |
| const std::string & | prefix_ | |||
| ) | [inline] |
Definition at line 66 of file brass_alltermslist.h.
| BrassAllTermsList::~BrassAllTermsList | ( | ) |
Destructor.
Definition at line 45 of file brass_alltermslist.cc.
References cursor, and LOGCALL_DTOR.
| bool BrassAllTermsList::at_end | ( | ) | const [virtual] |
True if we're off the end of the list.
Implements AllTermsList.
Definition at line 178 of file brass_alltermslist.cc.
References BrassCursor::after_end(), cursor, LOGCALL, and RETURN.
Referenced by get_collection_freq(), get_termfreq(), get_termname(), next(), read_termfreq_and_collfreq(), and skip_to().
| Xapian::termcount BrassAllTermsList::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 71 of file brass_alltermslist.cc.
References Assert, at_end(), collfreq, current_term, LOGCALL, read_termfreq_and_collfreq(), RETURN, and termfreq.
| Xapian::doccount BrassAllTermsList::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 61 of file brass_alltermslist.cc.
References Assert, at_end(), current_term, LOGCALL, read_termfreq_and_collfreq(), RETURN, and termfreq.
| string BrassAllTermsList::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 52 of file brass_alltermslist.cc.
References Assert, at_end(), current_term, LOGCALL, and RETURN.
| TermList * BrassAllTermsList::next | ( | ) | [virtual] |
Advance to the next term in the list.
Implements AllTermsList.
Definition at line 81 of file brass_alltermslist.cc.
References BrassCursor::after_end(), Assert, at_end(), BrassCursor::current_key, current_term, cursor, database, BrassCursor::find_entry_ge(), LOGCALL, BrassCursor::next(), pack_brass_postlist_key(), prefix, rare, RETURN, startswith(), termfreq, BrassCursor::to_end(), and unpack_string_preserving_sort().
| void BrassAllTermsList::operator= | ( | const BrassAllTermsList & | ) | [private] |
Assignment is not allowed.
| void BrassAllTermsList::read_termfreq_and_collfreq | ( | ) | const [private] |
Read and cache the term frequency and collection frequency.
Definition at line 31 of file brass_alltermslist.cc.
References Assert, at_end(), collfreq, BrassCursor::current_tag, current_term, cursor, LOGCALL_VOID, BrassPostList::read_number_of_entries(), BrassCursor::read_tag(), and termfreq.
Referenced by get_collection_freq(), and get_termfreq().
| TermList * BrassAllTermsList::skip_to | ( | const std::string & | tname | ) | [virtual] |
Advance to the first term which is >= tname.
Implements AllTermsList.
Definition at line 137 of file brass_alltermslist.cc.
References BrassCursor::after_end(), Assert, at_end(), BrassCursor::current_key, current_term, cursor, database, BrassCursor::find_entry_ge(), LOGCALL, pack_brass_postlist_key(), prefix, rare, RETURN, startswith(), termfreq, BrassCursor::to_end(), and unpack_string_preserving_sort().
Xapian::termcount BrassAllTermsList::collfreq [mutable, private] |
The collection frequency of the term at the current position.
Definition at line 60 of file brass_alltermslist.h.
Referenced by get_collection_freq(), and read_termfreq_and_collfreq().
std::string BrassAllTermsList::current_term [private] |
The termname at the current position.
Definition at line 46 of file brass_alltermslist.h.
Referenced by get_collection_freq(), get_termfreq(), get_termname(), next(), read_termfreq_and_collfreq(), and skip_to().
BrassCursor* BrassAllTermsList::cursor [private] |
A cursor which runs through the postlist table reading termnames from the keys.
Definition at line 43 of file brass_alltermslist.h.
Referenced by at_end(), next(), read_termfreq_and_collfreq(), skip_to(), and ~BrassAllTermsList().
Xapian::Internal::RefCntPtr<const BrassDatabase> BrassAllTermsList::database [private] |
Keep a reference to our database to stop it being deleted.
Definition at line 38 of file brass_alltermslist.h.
std::string BrassAllTermsList::prefix [private] |
Xapian::doccount BrassAllTermsList::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 brass_alltermslist.h.
Referenced by get_collection_freq(), get_termfreq(), next(), read_termfreq_and_collfreq(), and skip_to().