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

Adapter class for a TermList in a multidatabase. More...

#include <multi_termlist.h>

+ Inheritance diagram for MultiTermList:
+ Collaboration diagram for MultiTermList:

Public Member Functions

 MultiTermList (const Xapian::Database::Internal *db_, TermList *real_termlist_)
 Constructor. More...
 
 ~MultiTermList ()
 Destructor. More...
 
Xapian::termcount get_approx_size () const
 Return approximate size of this termlist. More...
 
Xapian::termcount get_wdf () const
 Return the wdf for the term at the current position. More...
 
Xapian::doccount get_termfreq () const
 Return the term frequency for the term at the current position. More...
 
Internalnext ()
 Advance the current position to the next term in the termlist. More...
 
Internalskip_to (std::string_view term)
 Skip forward to the specified term. More...
 
Xapian::termcount positionlist_count () const
 Return the length of the position list for the current position. More...
 
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

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

Private Attributes

TermListreal_termlist
 The TermList in the subdatabase. More...
 
intrusive_ptr_nonnull< const Xapian::Database::Internaldb
 The multidatabase. 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 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

Adapter class for a TermList in a multidatabase.

Most methods just forward to real_termlist, but get_termfreq() fetches the combined term frequency from the multidatabase.

Definition at line 35 of file multi_termlist.h.

Constructor & Destructor Documentation

◆ MultiTermList() [1/2]

MultiTermList::MultiTermList ( const MultiTermList )
privatedelete

Don't allow copying.

◆ MultiTermList() [2/2]

MultiTermList::MultiTermList ( const Xapian::Database::Internal db_,
TermList real_termlist_ 
)

Constructor.

Definition at line 33 of file multi_termlist.cc.

◆ ~MultiTermList()

MultiTermList::~MultiTermList ( )

Destructor.

Definition at line 39 of file multi_termlist.cc.

References real_termlist.

Member Function Documentation

◆ get_approx_size()

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

Return approximate size of this termlist.

Implements Xapian::TermIterator::Internal.

Definition at line 45 of file multi_termlist.cc.

References Xapian::TermIterator::Internal::get_approx_size(), and real_termlist.

◆ get_termfreq()

Xapian::doccount MultiTermList::get_termfreq ( ) const
virtual

Return the term frequency for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 57 of file multi_termlist.cc.

References db, Xapian::Database::Internal::get_freqs(), Xapian::TermIterator::Internal::get_termname(), and real_termlist.

◆ get_wdf()

Xapian::termcount MultiTermList::get_wdf ( ) const
virtual

Return the wdf for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 51 of file multi_termlist.cc.

References Xapian::TermIterator::Internal::get_wdf(), and real_termlist.

◆ next()

TermList * MultiTermList::next ( )
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.

Implements Xapian::TermIterator::Internal.

Definition at line 65 of file multi_termlist.cc.

References Assert, Xapian::TermIterator::Internal::current_term, Xapian::TermIterator::Internal::get_termname(), Xapian::TermIterator::Internal::next(), and real_termlist.

◆ operator=()

void MultiTermList::operator= ( const MultiTermList )
privatedelete

Don't allow assignment.

◆ positionlist_begin()

PositionList * MultiTermList::positionlist_begin ( ) const
virtual

Return a PositionIterator for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 97 of file multi_termlist.cc.

References Xapian::TermIterator::Internal::positionlist_begin(), and real_termlist.

◆ positionlist_count()

Xapian::termcount MultiTermList::positionlist_count ( ) const
virtual

Return the length of the position list for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 91 of file multi_termlist.cc.

References Xapian::TermIterator::Internal::positionlist_count(), and real_termlist.

◆ skip_to()

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

Skip forward to the specified term.

If the specified term isn't in the list, position ourselves on the first term after tname (or at_end() if no terms after tname exist).

Implements Xapian::TermIterator::Internal.

Definition at line 78 of file multi_termlist.cc.

References Assert, Xapian::TermIterator::Internal::current_term, Xapian::TermIterator::Internal::get_termname(), real_termlist, Xapian::TermIterator::Internal::skip_to(), and term.

Member Data Documentation

◆ db

intrusive_ptr_nonnull<const Xapian::Database::Internal> MultiTermList::db
private

The multidatabase.

Definition at line 46 of file multi_termlist.h.

Referenced by get_termfreq().

◆ real_termlist

TermList* MultiTermList::real_termlist
private

The TermList in the subdatabase.

Definition at line 43 of file multi_termlist.h.

Referenced by get_approx_size(), get_termfreq(), get_wdf(), next(), positionlist_begin(), positionlist_count(), skip_to(), and ~MultiTermList().


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