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

PositionList from an InMemory DB or a Document object. More...

#include <inmemory_positionlist.h>

+ Inheritance diagram for InMemoryPositionList:
+ Collaboration diagram for InMemoryPositionList:

Public Member Functions

 InMemoryPositionList ()
 Construct with an empty position list. More...
 
 InMemoryPositionList (Xapian::VecCOW< Xapian::termpos > &&positions_)
 Move construct with positional data. More...
 
 InMemoryPositionList (const Xapian::VecCOW< Xapian::termpos > &positions_)
 Construct with copied positional data. More...
 
void assign (Xapian::VecCOW< Xapian::termpos > &&positions_)
 Move assign positional data. More...
 
void assign (const Xapian::VecCOW< Xapian::termpos > &positions_)
 Assign copied positional data. More...
 
Xapian::termcount get_approx_size () const
 Return approximate size of this positionlist. More...
 
Xapian::termpos back () const
 Return the final entry in this positionlist. More...
 
Xapian::termpos get_position () const
 Return the current position. More...
 
bool next ()
 Advance to the next entry in the positionlist. More...
 
bool skip_to (Xapian::termpos termpos)
 Skip forward to the specified position. 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

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

Private Attributes

Xapian::VecCOW< Xapian::termpospositions
 Sorted list of term positions. More...
 
size_t index = size_t(-1)
 Current index into positions. 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

PositionList from an InMemory DB or a Document object.

Definition at line 28 of file inmemory_positionlist.h.

Constructor & Destructor Documentation

◆ InMemoryPositionList() [1/4]

InMemoryPositionList::InMemoryPositionList ( const InMemoryPositionList )
privatedelete

Don't allow copying.

◆ InMemoryPositionList() [2/4]

InMemoryPositionList::InMemoryPositionList ( )
inline

Construct with an empty position list.

Used to construct the InMemoryPositionList embedded in each InMemoryPostList.

Definition at line 50 of file inmemory_positionlist.h.

◆ InMemoryPositionList() [3/4]

InMemoryPositionList::InMemoryPositionList ( Xapian::VecCOW< Xapian::termpos > &&  positions_)
inlineexplicit

Move construct with positional data.

Definition at line 54 of file inmemory_positionlist.h.

◆ InMemoryPositionList() [4/4]

InMemoryPositionList::InMemoryPositionList ( const Xapian::VecCOW< Xapian::termpos > &  positions_)
inlineexplicit

Construct with copied positional data.

Definition at line 59 of file inmemory_positionlist.h.

Member Function Documentation

◆ assign() [1/2]

void InMemoryPositionList::assign ( const Xapian::VecCOW< Xapian::termpos > &  positions_)
inline

Assign copied positional data.

Definition at line 69 of file inmemory_positionlist.h.

References Xapian::Vec< T, COW, UNIQUEPTR, typename >::copy(), index, and positions.

◆ assign() [2/2]

void InMemoryPositionList::assign ( Xapian::VecCOW< Xapian::termpos > &&  positions_)
inline

Move assign positional data.

Definition at line 63 of file inmemory_positionlist.h.

References index, and positions.

Referenced by InMemoryPostList::read_position_list().

◆ back()

Xapian::termpos InMemoryPositionList::back ( ) const
virtual

Return the final entry in this positionlist.

Implements Xapian::PositionIterator::Internal.

Definition at line 38 of file inmemory_positionlist.cc.

◆ get_approx_size()

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

Return approximate size of this positionlist.

Implements Xapian::PositionIterator::Internal.

Definition at line 32 of file inmemory_positionlist.cc.

◆ get_position()

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

Return the current position.

Implements Xapian::PositionIterator::Internal.

Definition at line 44 of file inmemory_positionlist.cc.

References AssertRel.

◆ next()

bool InMemoryPositionList::next ( )
virtual

Advance to the next entry in the positionlist.

The list starts before the first entry, so next() or skip_to() must be called before get_position().

Returns
true if we're on a valid entry; false if we've reached the end of the list.

Implements Xapian::PositionIterator::Internal.

Definition at line 51 of file inmemory_positionlist.cc.

References AssertRel, and UNSIGNED_OVERFLOW_OK.

◆ operator=()

void InMemoryPositionList::operator= ( const InMemoryPositionList )
privatedelete

Don't allow assignment.

◆ skip_to()

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

Skip forward to the specified position.

If the specified position isn't in the list, position ourselves on the first entry after it.

Returns
true if we're on a valid entry; false if we've reached the end of the list.

Implements Xapian::PositionIterator::Internal.

Definition at line 60 of file inmemory_positionlist.cc.

Member Data Documentation

◆ index

size_t InMemoryPositionList::index = size_t(-1)
private

Current index into positions.

Or size_t(-1) if we've not yet started.

Definition at line 36 of file inmemory_positionlist.h.

Referenced by assign().

◆ positions

Xapian::VecCOW<Xapian::termpos> InMemoryPositionList::positions
private

Sorted list of term positions.

Definition at line 30 of file inmemory_positionlist.h.

Referenced by assign().


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