xapian-core  1.4.21
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlassPositionList Class Reference

A position list in a glass database. More...

#include <glass_positionlist.h>

+ Inheritance diagram for GlassPositionList:
+ Collaboration diagram for GlassPositionList:

Public Member Functions

 GlassPositionList ()
 Default constructor. More...
 
 GlassPositionList (const string &data)
 Construct and initialise with data. More...
 
 GlassPositionList (const GlassTable *table, Xapian::docid did, const string &tname)
 Construct and initialise with data. More...
 
bool read_data (const string &data)
 Fill list with data, and move the position to the start. More...
 
bool read_data (const GlassTable *table, Xapian::docid did, const string &tname)
 Fill list with data, and move the position to the start. More...
 
Xapian::termcount get_approx_size () const
 Returns size of position list. More...
 
Xapian::termpos get_position () const
 Returns current position. More...
 
bool next ()
 Advance to the next term position in the list. More...
 
bool skip_to (Xapian::termpos termpos)
 Advance to the first term position which is at least termpos. More...
 
- Public Member Functions inherited from Xapian::PositionIterator::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...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Private Member Functions

 GlassPositionList (const GlassPositionList &)
 Copying is not allowed. More...
 
void operator= (const GlassPositionList &)
 Assignment is not allowed. More...
 

Private Attributes

BitReader rd
 Interpolative decoder. More...
 
Xapian::termpos current_pos
 Current entry. More...
 
Xapian::termpos last
 Last entry. More...
 
Xapian::termcount size
 Number of entries. More...
 
AutoPtr< GlassCursorcursor
 Cursor for locating multiple entries efficiently. More...
 
bool have_started
 Have we started iterating yet? More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::PositionIterator::Internal
 Internal ()
 Only constructable as a base class for derived classes. More...
 

Detailed Description

A position list in a glass database.

Definition at line 87 of file glass_positionlist.h.

Constructor & Destructor Documentation

◆ GlassPositionList() [1/4]

GlassPositionList::GlassPositionList ( const GlassPositionList )
private

Copying is not allowed.

◆ GlassPositionList() [2/4]

GlassPositionList::GlassPositionList ( )
inline

Default constructor.

Definition at line 114 of file glass_positionlist.h.

◆ GlassPositionList() [3/4]

GlassPositionList::GlassPositionList ( const string &  data)
inlineexplicit

Construct and initialise with data.

Definition at line 118 of file glass_positionlist.h.

◆ GlassPositionList() [4/4]

GlassPositionList::GlassPositionList ( const GlassTable table,
Xapian::docid  did,
const string &  tname 
)
inline

Construct and initialise with data.

Definition at line 123 of file glass_positionlist.h.

Member Function Documentation

◆ get_approx_size()

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

Returns size of position list.

Implements Xapian::PositionIterator::Internal.

Definition at line 150 of file glass_positionlist.cc.

References LOGCALL, and RETURN.

◆ get_position()

Xapian::termpos GlassPositionList::get_position ( ) const
virtual

Returns current position.

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

Implements Xapian::PositionIterator::Internal.

Definition at line 157 of file glass_positionlist.cc.

References Assert, LOGCALL, and RETURN.

◆ next()

bool GlassPositionList::next ( )
virtual

Advance to the next term position in the list.

Implements Xapian::PositionIterator::Internal.

Definition at line 165 of file glass_positionlist.cc.

References LOGCALL, and rare.

◆ operator=()

void GlassPositionList::operator= ( const GlassPositionList )
private

Assignment is not allowed.

◆ read_data() [1/2]

bool GlassPositionList::read_data ( const string &  data)

Fill list with data, and move the position to the start.

Returns
true if position data was read.

Definition at line 97 of file glass_positionlist.cc.

References LOGCALL, RETURN, and unpack_uint().

Referenced by GlassDatabase::read_position_list(), and GlassWritableDatabase::read_position_list().

◆ read_data() [2/2]

bool GlassPositionList::read_data ( const GlassTable table,
Xapian::docid  did,
const string &  tname 
)

Fill list with data, and move the position to the start.

Returns
true if position data was read.

Definition at line 135 of file glass_positionlist.cc.

References GlassTable::cursor_get(), LOGCALL, GlassPositionListTable::make_key(), and RETURN.

◆ skip_to()

bool GlassPositionList::skip_to ( Xapian::termpos  termpos)
virtual

Advance to the first term position which is at least termpos.

Implements Xapian::PositionIterator::Internal.

Definition at line 180 of file glass_positionlist.cc.

References LOGCALL.

Member Data Documentation

◆ current_pos

Xapian::termpos GlassPositionList::current_pos
private

Current entry.

Definition at line 92 of file glass_positionlist.h.

◆ cursor

AutoPtr<GlassCursor> GlassPositionList::cursor
private

Cursor for locating multiple entries efficiently.

Definition at line 101 of file glass_positionlist.h.

◆ have_started

bool GlassPositionList::have_started
private

Have we started iterating yet?

Definition at line 104 of file glass_positionlist.h.

◆ last

Xapian::termpos GlassPositionList::last
private

Last entry.

Definition at line 95 of file glass_positionlist.h.

◆ rd

BitReader GlassPositionList::rd
private

Interpolative decoder.

Definition at line 89 of file glass_positionlist.h.

◆ size

Xapian::termcount GlassPositionList::size
private

Number of entries.

Definition at line 98 of file glass_positionlist.h.


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