xapian-core  1.4.27
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlassSpellingWordsList Class Reference

#include <glass_spellingwordslist.h>

+ Inheritance diagram for GlassSpellingWordsList:
+ Collaboration diagram for GlassSpellingWordsList:

Public Member Functions

 GlassSpellingWordsList (Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database_, GlassCursor *cursor_)
 
 ~GlassSpellingWordsList ()
 Destructor. More...
 
std::string get_termname () const
 Returns the current termname. 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 (const std::string &tname)
 Advance to the first term which is >= tname. More...
 
bool at_end () const
 True if we're off the end of the list. More...
 
- Public Member Functions inherited from AllTermsList
virtual Xapian::termcount get_approx_size () const
 Return approximate size of this termlist. More...
 
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 Xapian::PositionIterator positionlist_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...
 
virtual const std::vector< Xapian::termpos > * get_vector_termpos () const
 Get pointer to vector<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

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

Private Attributes

Xapian::Internal::intrusive_ptr< const Xapian::Database::Internaldatabase
 Keep a reference to our database to stop it being deleted. More...
 
GlassCursorcursor
 A cursor which runs through the spelling table reading termnames from the keys. More...
 
Xapian::termcount termfreq
 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...
 

Detailed Description

Definition at line 30 of file glass_spellingwordslist.h.

Constructor & Destructor Documentation

◆ GlassSpellingWordsList() [1/2]

GlassSpellingWordsList::GlassSpellingWordsList ( const GlassSpellingWordsList )
private

Copying is not allowed.

◆ GlassSpellingWordsList() [2/2]

GlassSpellingWordsList::GlassSpellingWordsList ( Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal database_,
GlassCursor cursor_ 
)
inline

◆ ~GlassSpellingWordsList()

GlassSpellingWordsList::~GlassSpellingWordsList ( )

Destructor.

Definition at line 33 of file glass_spellingwordslist.cc.

References cursor, and LOGCALL_DTOR.

Referenced by GlassSpellingWordsList().

Member Function Documentation

◆ at_end()

bool GlassSpellingWordsList::at_end ( ) const
virtual

True if we're off the end of the list.

Implements AllTermsList.

Definition at line 101 of file glass_spellingwordslist.cc.

References GlassCursor::after_end(), cursor, LOGCALL, and RETURN.

Referenced by get_termfreq(), get_termname(), GlassSpellingWordsList(), next(), and skip_to().

◆ get_termfreq()

Xapian::doccount GlassSpellingWordsList::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 51 of file glass_spellingwordslist.cc.

References Assert, at_end(), GlassCursor::current_key, GlassCursor::current_tag, cursor, LOGCALL, GlassCursor::read_tag(), RETURN, and unpack_uint_last().

Referenced by GlassSpellingWordsList().

◆ get_termname()

string GlassSpellingWordsList::get_termname ( ) const
virtual

Returns the current termname.

Either next() or skip_to() must have been called before this method can be called.

Implements AllTermsList.

Definition at line 40 of file glass_spellingwordslist.cc.

References Assert, at_end(), GlassCursor::current_key, cursor, LOGCALL, and RETURN.

Referenced by GlassSpellingWordsList().

◆ next()

TermList * GlassSpellingWordsList::next ( )
virtual

Advance to the next term in the list.

Implements AllTermsList.

Definition at line 69 of file glass_spellingwordslist.cc.

References GlassCursor::after_end(), Assert, at_end(), GlassCursor::current_key, cursor, LOGCALL, GlassCursor::next(), RETURN, startswith(), and GlassCursor::to_end().

Referenced by GlassSpellingWordsList().

◆ operator=()

void GlassSpellingWordsList::operator= ( const GlassSpellingWordsList )
private

Assignment is not allowed.

◆ read_termfreq()

void GlassSpellingWordsList::read_termfreq ( ) const
private

Read and cache the term frequency.

◆ skip_to()

TermList * GlassSpellingWordsList::skip_to ( const std::string &  tname)
virtual

Advance to the first term which is >= tname.

Implements AllTermsList.

Definition at line 84 of file glass_spellingwordslist.cc.

References GlassCursor::after_end(), Assert, at_end(), GlassCursor::current_key, cursor, GlassCursor::find_entry_ge(), LOGCALL, RETURN, startswith(), and GlassCursor::to_end().

Referenced by GlassSpellingWordsList().

Member Data Documentation

◆ cursor

GlassCursor* GlassSpellingWordsList::cursor
private

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

Definition at line 43 of file glass_spellingwordslist.h.

Referenced by at_end(), get_termfreq(), get_termname(), next(), skip_to(), and ~GlassSpellingWordsList().

◆ database

Xapian::Internal::intrusive_ptr<const Xapian::Database::Internal> GlassSpellingWordsList::database
private

Keep a reference to our database to stop it being deleted.

Definition at line 38 of file glass_spellingwordslist.h.

◆ termfreq

Xapian::termcount GlassSpellingWordsList::termfreq
mutableprivate

The term frequency of the term at the current position.

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

Definition at line 51 of file glass_spellingwordslist.h.


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