xapian-core  1.4.20
Public Member Functions | Public Attributes | Protected Member Functions | 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...
 
virtual std::string get_termname () const =0
 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 (const std::string &term)=0
 Skip forward to the specified term. More...
 
virtual bool at_end () const =0
 Return true if the current position is past the last term in this list. More...
 
virtual Xapian::termcount positionlist_count () const =0
 Return the length of the position list for the current position. More...
 
virtual const std::vector< Xapian::termpos > * get_vector_termpos () const
 Get pointer to vector<termpos> if that's the internal representation. More...
 
virtual Xapian::PositionIterator positionlist_begin () const =0
 Return a PositionIterator 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...
 

Private Member Functions

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

Detailed Description

Abstract base class for termlists.

Definition at line 39 of file termlist.h.

Constructor & Destructor Documentation

◆ Internal() [1/2]

Xapian::TermIterator::Internal::Internal ( const Internal )
private

Don't allow copying.

◆ Internal() [2/2]

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

Only constructable as a base class for derived classes.

Definition at line 48 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 InMemoryTermList, GlassTermList, NetworkTermList, ChertTermList, OrTermList, and MultiTermList.

Definition at line 34 of file termlist.cc.

References Assert.

Referenced by MultiTermList::accumulate_stats(), and Xapian::Internal::ExpandWeight::collect_stats().

◆ at_end()

virtual bool Xapian::TermIterator::Internal::at_end ( ) const
pure virtual

◆ 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()

virtual std::string Xapian::TermIterator::Internal::get_termname ( ) const
pure virtual

◆ get_vector_termpos()

const std::vector< Xapian::termpos > * Xapian::TermIterator::Internal::get_vector_termpos ( ) const
virtual

Get pointer to vector<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 vector<termpos> or NULL.

Reimplemented in MapTermList.

Definition at line 42 of file termlist.cc.

Referenced by Inverter::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
If a 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 InMemoryTermList, StringAndFreqTermList, GlassSpellingTermList, GlassSynonymTermList, ChertSynonymTermList, ChertSpellingTermList, GlassTermList, ChertTermList, ValueCountTermList, NetworkTermList, VectorTermList, MapTermList, ChertAllTermsList, GlassAllTermsList, ChertSpellingWordsList, GlassSpellingWordsList, ChertMetadataTermList, GlassMetadataTermList, InMemoryAllTermsList, OrTermList, MultiAllTermsList, AllTermsList, and MultiTermList.

Referenced by Xapian::ESet::Internal::expand(), Xapian::Database::get_spelling_suggestion(), MultiTermList::next(), MultiAllTermsList::next(), Xapian::TermIterator::operator++(), and Xapian::TermIterator::TermIterator().

◆ operator=()

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

Don't allow assignment.

◆ positionlist_begin()

virtual Xapian::PositionIterator 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 ( const std::string &  term)
pure virtual

Member Data Documentation

◆ shard_index

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

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