xapian-core  2.0.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Xapian::TermIterator::Internal Class Referenceabstract

Abstract base class for termlists. More...

#include <termlist.h>

+ Inheritance diagram for Xapian::TermIterator::Internal:
+ Collaboration diagram for Xapian::TermIterator::Internal:

Public Member Functions

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 Xapian::termcount get_approx_size () const =0
 Return approximate size of this termlist. 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 Xapian::termcount get_wdf () const =0
 Return the wdf for the term at the current position. More...
 
virtual Xapian::doccount get_termfreq () const =0
 Return the term frequency for the term at the current position. More...
 
virtual Internalnext ()=0
 Advance the current position to the next term in the termlist. More...
 
virtual Internalskip_to (std::string_view term)=0
 Skip forward to the specified term. More...
 
virtual Xapian::termcount positionlist_count () const =0
 Return the length of the position list for 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...
 
virtual PositionListpositionlist_begin () const =0
 Return PositionList for the current position. More...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Public Attributes

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

 Internal ()
 Only constructable as a base class for derived classes. More...
 

Protected Attributes

std::string current_term
 The current term. More...
 

Private Member Functions

void operator= (const Internal &)=delete
 Don't allow assignment. More...
 
 Internal (const Internal &)=delete
 Don't allow copying. More...
 

Detailed Description

Abstract base class for termlists.

Definition at line 42 of file termlist.h.

Constructor & Destructor Documentation

◆ Internal() [1/2]

Xapian::TermIterator::Internal::Internal ( const Internal )
privatedelete

Don't allow copying.

◆ Internal() [2/2]

Xapian::TermIterator::Internal::Internal ( )
inlineprotected

Only constructable as a base class for derived classes.

Definition at line 51 of file termlist.h.

◆ ~Internal()

Xapian::TermIterator::Internal::~Internal ( )
virtual

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.

Definition at line 31 of file termlist.cc.

Member Function Documentation

◆ accumulate_stats()

void Xapian::TermIterator::Internal::accumulate_stats ( Xapian::Internal::ExpandStats stats) const
virtual

Collate weighting information for the current term.

Reimplemented in OrTermList, RemoteTermList, InMemoryTermList, HoneyTermList, and GlassTermList.

Definition at line 34 of file termlist.cc.

References Assert.

Referenced by Xapian::Internal::ExpandWeight::collect_stats().

◆ get_approx_size()

virtual Xapian::termcount Xapian::TermIterator::Internal::get_approx_size ( ) const
pure virtual

◆ get_termfreq()

virtual Xapian::doccount Xapian::TermIterator::Internal::get_termfreq ( ) const
pure virtual

◆ get_termname()

const std::string& Xapian::TermIterator::Internal::get_termname ( ) const
inline

◆ get_vec_termpos()

const Xapian::VecCOW< Xapian::termpos > * Xapian::TermIterator::Internal::get_vec_termpos ( ) const
virtual

Get pointer to VecCOW<termpos> if that's the internal representation.

This avoids unnecessary copying of positions in the common cases - the case it doesn't help with is adding a document back with unmodified positions AND a different docid, which is an unusual thing to do.

Returns
Pointer to VecCOW<termpos> or NULL.

Reimplemented in DocumentTermList.

Definition at line 42 of file termlist.cc.

Referenced by HoneyInverter::set_positionlist().

◆ get_wdf()

virtual Xapian::termcount Xapian::TermIterator::Internal::get_wdf ( ) const
pure virtual

◆ next()

virtual Internal* Xapian::TermIterator::Internal::next ( )
pure virtual

Advance the current position to the next term in the termlist.

The list starts before the first term in the list, so next(), skip_to() or check() must be called before any methods which need the context of the current position.

Returns
Normally returns NULL to indicate success. If the end has been reached, returns this; if another non-NULL pointer is returned then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implemented in AllTermsList, OrTermList, RemoteTermList, RemoteKeyList, RemoteAllTermsList, MultiTermList, MultiAllTermsList, InMemoryTermList, InMemoryAllTermsList, HoneyTermList, HoneySynonymTermList, HoneySpellingWordsList, HoneySpellingTermList, HoneyMetadataTermList, HoneyAllTermsList, GlassTermList, GlassSynonymTermList, GlassSpellingWordsList, GlassSpellingTermList, GlassMetadataTermList, GlassAllTermsList, VectorTermList, StringAndFreqTermList, ValueCountTermList, and DocumentTermList.

Referenced by Xapian::ESet::Internal::expand(), Xapian::Internal::Context::expand_edit_distance(), Xapian::Internal::Context::expand_wildcard(), Xapian::Database::get_spelling_suggestion(), MultiAllTermsList::get_termfreq(), MultiAllTermsList::next(), MultiTermList::next(), OrTermList::next(), Xapian::TermIterator::operator++(), Xapian::reconstruct_open_poslists(), and Xapian::TermIterator::TermIterator().

◆ operator=()

void Xapian::TermIterator::Internal::operator= ( const Internal )
privatedelete

Don't allow assignment.

◆ positionlist_begin()

virtual PositionList* Xapian::TermIterator::Internal::positionlist_begin ( ) const
pure virtual

◆ positionlist_count()

virtual Xapian::termcount Xapian::TermIterator::Internal::positionlist_count ( ) const
pure virtual

◆ skip_to()

virtual Internal* Xapian::TermIterator::Internal::skip_to ( std::string_view  term)
pure virtual

Skip forward to the specified term.

If the specified term isn't in the list, position ourselves on the first term after term.

Returns
Normally returns NULL to indicate success. If no terms after term exist, returns this; if another non-NULL pointer is returned then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implemented in StringAndFreqTermList, ValueCountTermList, VectorTermList, InMemoryAllTermsList, GlassSynonymTermList, GlassSpellingWordsList, GlassAllTermsList, AllTermsList, OrTermList, RemoteTermList, RemoteKeyList, RemoteAllTermsList, MultiTermList, MultiAllTermsList, InMemoryTermList, HoneyTermList, HoneySynonymTermList, HoneySpellingWordsList, HoneySpellingTermList, HoneyAllTermsList, GlassTermList, GlassSpellingTermList, DocumentTermList, HoneyMetadataTermList, and GlassMetadataTermList.

Referenced by Xapian::Weight::Internal::accumulate_stats(), Xapian::Internal::Context::expand_edit_distance(), Xapian::Internal::Context::expand_wildcard(), MultiTermList::skip_to(), OrTermList::skip_to(), and Xapian::TermIterator::skip_to().

Member Data Documentation

◆ current_term

std::string Xapian::TermIterator::Internal::current_term
protected

◆ shard_index

size_t Xapian::TermIterator::Internal::shard_index = 0

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