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

#include <inmemory_database.h>

+ Inheritance diagram for InMemoryTermList:
+ Collaboration diagram for InMemoryTermList:

Public Member Functions

Xapian::termcount get_approx_size () const
 Return approximate size of this termlist. More...
 
void accumulate_stats (Xapian::Internal::ExpandStats &stats) const
 Collate weighting information for the current term. 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...
 
TermListnext ()
 Advance the current position to the next term in the termlist. More...
 
TermListskip_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 PositionList 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...
 
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

 InMemoryTermList (Xapian::Internal::intrusive_ptr< const InMemoryDatabase > db, Xapian::docid did, const InMemoryDoc &doc, Xapian::termcount len)
 

Private Attributes

std::vector< InMemoryTermEntry >::const_iterator pos
 
std::vector< InMemoryTermEntry >::const_iterator end
 
Xapian::termcount terms
 
bool started
 
Xapian::Internal::intrusive_ptr< const InMemoryDatabasedb
 
Xapian::docid did
 
Xapian::termcount document_length
 

Friends

class InMemoryDatabase
 

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

Definition at line 211 of file inmemory_database.h.

Constructor & Destructor Documentation

◆ InMemoryTermList()

InMemoryTermList::InMemoryTermList ( Xapian::Internal::intrusive_ptr< const InMemoryDatabase db,
Xapian::docid  did,
const InMemoryDoc doc,
Xapian::termcount  len 
)
private

Definition at line 242 of file inmemory_database.cc.

References LOGLINE, pos, and terms.

Member Function Documentation

◆ accumulate_stats()

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

◆ get_approx_size()

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

Return approximate size of this termlist.

Implements Xapian::TermIterator::Internal.

Definition at line 275 of file inmemory_database.cc.

References db, InMemoryDatabase::is_closed(), terms, and InMemoryDatabase::throw_database_closed().

◆ get_termfreq()

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

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

Implements Xapian::TermIterator::Internal.

Definition at line 263 of file inmemory_database.cc.

References Assert, db, end, InMemoryDatabase::get_freqs(), InMemoryDatabase::is_closed(), pos, started, and InMemoryDatabase::throw_database_closed().

Referenced by accumulate_stats().

◆ get_wdf()

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

Return the wdf for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 254 of file inmemory_database.cc.

References Assert, db, end, InMemoryDatabase::is_closed(), pos, started, and InMemoryDatabase::throw_database_closed().

Referenced by accumulate_stats().

◆ next()

TermList * InMemoryTermList::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
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.

Implements Xapian::TermIterator::Internal.

Definition at line 294 of file inmemory_database.cc.

References Assert, Xapian::TermIterator::Internal::current_term, db, end, InMemoryDatabase::is_closed(), pos, started, and InMemoryDatabase::throw_database_closed().

◆ positionlist_begin()

PositionList * InMemoryTermList::positionlist_begin ( ) const
virtual

Return PositionList for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 334 of file inmemory_database.cc.

References db, did, InMemoryDatabase::is_closed(), InMemoryDatabase::open_position_list(), and InMemoryDatabase::throw_database_closed().

◆ positionlist_count()

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

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

Implements Xapian::TermIterator::Internal.

Definition at line 327 of file inmemory_database.cc.

References db, did, InMemoryDatabase::is_closed(), InMemoryDatabase::positionlist_count(), and InMemoryDatabase::throw_database_closed().

◆ skip_to()

TermList * InMemoryTermList::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 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.

Implements Xapian::TermIterator::Internal.

Definition at line 310 of file inmemory_database.cc.

References Xapian::TermIterator::Internal::current_term, db, end, InMemoryDatabase::is_closed(), pos, rare, started, term, and InMemoryDatabase::throw_database_closed().

Friends And Related Function Documentation

◆ InMemoryDatabase

friend class InMemoryDatabase
friend

Definition at line 212 of file inmemory_database.h.

Member Data Documentation

◆ db

Xapian::Internal::intrusive_ptr<const InMemoryDatabase> InMemoryTermList::db
private

◆ did

Xapian::docid InMemoryTermList::did
private

Definition at line 221 of file inmemory_database.h.

Referenced by positionlist_begin(), and positionlist_count().

◆ document_length

Xapian::termcount InMemoryTermList::document_length
private

Definition at line 222 of file inmemory_database.h.

Referenced by accumulate_stats().

◆ end

std::vector<InMemoryTermEntry>::const_iterator InMemoryTermList::end
private

Definition at line 216 of file inmemory_database.h.

Referenced by accumulate_stats(), get_termfreq(), get_wdf(), next(), and skip_to().

◆ pos

std::vector<InMemoryTermEntry>::const_iterator InMemoryTermList::pos
private

◆ started

bool InMemoryTermList::started
private

Definition at line 218 of file inmemory_database.h.

Referenced by accumulate_stats(), get_termfreq(), get_wdf(), next(), and skip_to().

◆ terms

Xapian::termcount InMemoryTermList::terms
private

Definition at line 217 of file inmemory_database.h.

Referenced by get_approx_size(), and InMemoryTermList().


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