xapian-core  2.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HoneyAllTermsList Class Reference

#include <honey_alltermslist.h>

+ Inheritance diagram for HoneyAllTermsList:
+ Collaboration diagram for HoneyAllTermsList:

Public Member Functions

 HoneyAllTermsList (const HoneyDatabase *database_, std::string_view prefix_)
 
 ~HoneyAllTermsList ()
 Destructor. More...
 
Xapian::termcount get_approx_size () const
 Return approximate size of this termlist. More...
 
Xapian::doccount get_termfreq () const
 Returns the term frequency of the current term. More...
 
TermListnext ()
 Advance to the next term in the list. More...
 
TermListskip_to (std::string_view term)
 Advance to the first term which is >= term. More...
 
- Public Member Functions inherited from AllTermsList
virtual Xapian::termcount get_wdf () const
 Return the wdf for the term at the current position. More...
 
virtual Xapian::termcount positionlist_count () const
 Return true if the current position is past the last term in this list. More...
 
virtual PositionListpositionlist_begin () const
 Return a PositionIterator for the current position. More...
 
- Public Member Functions inherited from Xapian::TermIterator::Internal
virtual ~Internal ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More...
 
virtual void accumulate_stats (Xapian::Internal::ExpandStats &stats) const
 Collate weighting information for the current term. More...
 
const std::string & get_termname () const
 Return the termname at the current position. More...
 
virtual const Xapian::VecCOW< Xapian::termpos > * get_vec_termpos () const
 Get pointer to VecCOW<termpos> if that's the internal representation. More...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Private Member Functions

 HoneyAllTermsList (const HoneyAllTermsList &)=delete
 Copying is not allowed. More...
 
HoneyAllTermsListoperator= (const HoneyAllTermsList &)=delete
 Assignment is not allowed. More...
 
void read_termfreq () const
 Read and cache the term frequency. More...
 

Private Attributes

Xapian::Internal::intrusive_ptr< const HoneyDatabasedatabase
 Reference to our database. More...
 
HoneyCursorcursor = NULL
 A cursor which runs through the postlist table reading termnames from the keys. More...
 
std::string prefix
 The prefix to restrict the terms to. More...
 
Xapian::doccount termfreq = 0
 The term frequency of the term at the current position. More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::TermIterator::Internal
size_t shard_index = 0
 Which shard of a multidatabase this is from. More...
 
- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from AllTermsList
 AllTermsList ()
 Only constructable as a base class for derived classes. More...
 
- Protected Member Functions inherited from Xapian::TermIterator::Internal
 Internal ()
 Only constructable as a base class for derived classes. More...
 
- Protected Attributes inherited from Xapian::TermIterator::Internal
std::string current_term
 The current term. More...
 

Detailed Description

Definition at line 32 of file honey_alltermslist.h.

Constructor & Destructor Documentation

◆ HoneyAllTermsList() [1/2]

HoneyAllTermsList::HoneyAllTermsList ( const HoneyAllTermsList )
privatedelete

Copying is not allowed.

◆ HoneyAllTermsList() [2/2]

HoneyAllTermsList::HoneyAllTermsList ( const HoneyDatabase database_,
std::string_view  prefix_ 
)
inline

Definition at line 73 of file honey_alltermslist.h.

◆ ~HoneyAllTermsList()

HoneyAllTermsList::~HoneyAllTermsList ( )

Destructor.

Definition at line 56 of file honey_alltermslist.cc.

References LOGCALL_DTOR.

Member Function Documentation

◆ get_approx_size()

Xapian::termcount HoneyAllTermsList::get_approx_size ( ) const
virtual

Return approximate size of this termlist.

Implements AllTermsList.

Definition at line 63 of file honey_alltermslist.cc.

◆ get_termfreq()

Xapian::doccount HoneyAllTermsList::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 72 of file honey_alltermslist.cc.

References Assert, LOGCALL, and RETURN.

◆ next()

TermList * HoneyAllTermsList::next ( )
virtual

Advance to the next term in the list.

Implements AllTermsList.

Definition at line 81 of file honey_alltermslist.cc.

References Assert, LOGCALL, p, pack_honey_postlist_key(), rare, RETURN, startswith(), and unpack_string_preserving_sort().

◆ operator=()

HoneyAllTermsList& HoneyAllTermsList::operator= ( const HoneyAllTermsList )
privatedelete

Assignment is not allowed.

◆ read_termfreq()

void HoneyAllTermsList::read_termfreq ( ) const
private

Read and cache the term frequency.

Definition at line 37 of file honey_alltermslist.cc.

References Assert, decode_initial_chunk_header_freqs(), LOGCALL_VOID, and p.

◆ skip_to()

TermList * HoneyAllTermsList::skip_to ( std::string_view  term)
virtual

Advance to the first term which is >= term.

Implements AllTermsList.

Definition at line 149 of file honey_alltermslist.cc.

References Assert, LOGCALL, p, pack_honey_postlist_key(), rare, RETURN, startswith(), term, and unpack_string_preserving_sort().

Member Data Documentation

◆ cursor

HoneyCursor* HoneyAllTermsList::cursor = NULL
private

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

The cursor is lazily initialised so that we can avoid the initial positioning if skip_to() is the first action, and also so we can avoid having to seek to the item before the first matching prefix just so that the first next() advances us to where we want to start.

We also set this to NULL to signal the iterator has reached the end - in this case database will also be NULL.

Definition at line 57 of file honey_alltermslist.h.

◆ database

Xapian::Internal::intrusive_ptr<const HoneyDatabase> HoneyAllTermsList::database
private

Reference to our database.

We need this to stop it being deleted, and so we can lazily initialise cursor.

Definition at line 44 of file honey_alltermslist.h.

◆ prefix

std::string HoneyAllTermsList::prefix
private

The prefix to restrict the terms to.

Definition at line 60 of file honey_alltermslist.h.

◆ termfreq

Xapian::doccount HoneyAllTermsList::termfreq = 0
mutableprivate

The term frequency of the term at the current position.

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

Definition at line 67 of file honey_alltermslist.h.


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