xapian-core  1.4.26
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Xapian::PositionIterator Class Reference

Class for iterating over term positions. More...

#include <positioniterator.h>

+ Collaboration diagram for Xapian::PositionIterator:

Classes

class  Internal
 Abstract base class for iterating term positions in a document. More...
 

Public Member Functions

 PositionIterator (const PositionIterator &o)
 Copy constructor. More...
 
PositionIteratoroperator= (const PositionIterator &o)
 Assignment. More...
 
 PositionIterator ()
 Default constructor. More...
 
 ~PositionIterator ()
 Destructor. More...
 
Xapian::termpos operator* () const
 Return the term position at the current iterator position. More...
 
PositionIteratoroperator++ ()
 Advance the iterator to the next position. More...
 
DerefWrapper_< Xapian::termposoperator++ (int)
 Advance the iterator to the next position (postfix version). More...
 
void skip_to (Xapian::termpos termpos)
 Advance the iterator to term position termpos. More...
 
std::string get_description () const
 Return a string describing this object. More...
 

Private Types

typedef std::input_iterator_tag iterator_category
 
typedef Xapian::termpos value_type
 
typedef Xapian::termpos_diff difference_type
 
typedef Xapian::termpospointer
 
typedef Xapian::termposreference
 

Private Member Functions

void decref ()
 
 PositionIterator (Internal *internal_)
 

Private Attributes

Internalinternal
 

Detailed Description

Class for iterating over term positions.

Definition at line 40 of file positioniterator.h.

Member Typedef Documentation

◆ difference_type

PositionIterator is what the C++ STL calls an input_iterator.

The following typedefs allow std::iterator_traits<> to work so that this iterator can be used with the STL.

These are deliberately hidden from the Doxygen-generated docs, as the machinery here isn't interesting to API users. They just need to know that Xapian iterator classes are compatible with the STL.

Definition at line 129 of file positioniterator.h.

◆ iterator_category

typedef std::input_iterator_tag Xapian::PositionIterator::iterator_category
private

PositionIterator is what the C++ STL calls an input_iterator.

The following typedefs allow std::iterator_traits<> to work so that this iterator can be used with the STL.

These are deliberately hidden from the Doxygen-generated docs, as the machinery here isn't interesting to API users. They just need to know that Xapian iterator classes are compatible with the STL.

Definition at line 125 of file positioniterator.h.

◆ pointer

PositionIterator is what the C++ STL calls an input_iterator.

The following typedefs allow std::iterator_traits<> to work so that this iterator can be used with the STL.

These are deliberately hidden from the Doxygen-generated docs, as the machinery here isn't interesting to API users. They just need to know that Xapian iterator classes are compatible with the STL.

Definition at line 131 of file positioniterator.h.

◆ reference

PositionIterator is what the C++ STL calls an input_iterator.

The following typedefs allow std::iterator_traits<> to work so that this iterator can be used with the STL.

These are deliberately hidden from the Doxygen-generated docs, as the machinery here isn't interesting to API users. They just need to know that Xapian iterator classes are compatible with the STL.

Definition at line 133 of file positioniterator.h.

◆ value_type

PositionIterator is what the C++ STL calls an input_iterator.

The following typedefs allow std::iterator_traits<> to work so that this iterator can be used with the STL.

These are deliberately hidden from the Doxygen-generated docs, as the machinery here isn't interesting to API users. They just need to know that Xapian iterator classes are compatible with the STL.

Definition at line 127 of file positioniterator.h.

Constructor & Destructor Documentation

◆ PositionIterator() [1/3]

Xapian::PositionIterator::PositionIterator ( Internal internal_)
explicitprivate

Construct given internals.

Definition at line 41 of file positioniterator.cc.

References Assert, decref(), internal, LOGCALL_CTOR, and Xapian::PositionIterator::Internal::next().

◆ PositionIterator() [2/3]

Xapian::PositionIterator::PositionIterator ( const PositionIterator o)

Copy constructor.

Definition at line 59 of file positioniterator.cc.

References LOGCALL_CTOR.

◆ PositionIterator() [3/3]

Xapian::PositionIterator::PositionIterator ( )
inline

Default constructor.

Creates an uninitialised iterator, which can't be used before being assigned to, but is sometimes syntactically convenient.

Definition at line 81 of file positioniterator.h.

◆ ~PositionIterator()

Xapian::PositionIterator::~PositionIterator ( )
inline

Destructor.

Definition at line 85 of file positioniterator.h.

References Xapian::operator*().

Member Function Documentation

◆ decref()

void Xapian::PositionIterator::decref ( )
private

Definition at line 34 of file positioniterator.cc.

References Assert.

Referenced by operator++(), operator=(), PositionIterator(), and skip_to().

◆ get_description()

std::string Xapian::PositionIterator::get_description ( ) const

Return a string describing this object.

Definition at line 112 of file positioniterator.cc.

◆ operator*()

Xapian::termpos Xapian::PositionIterator::operator* ( ) const

Return the term position at the current iterator position.

Definition at line 80 of file positioniterator.cc.

References Assert, Xapian::PositionIterator::Internal::get_position(), internal, LOGCALL, and RETURN.

◆ operator++() [1/2]

PositionIterator & Xapian::PositionIterator::operator++ ( )

Advance the iterator to the next position.

Definition at line 88 of file positioniterator.cc.

References Assert, decref(), internal, LOGCALL, Xapian::PositionIterator::Internal::next(), and RETURN.

◆ operator++() [2/2]

DerefWrapper_<Xapian::termpos> Xapian::PositionIterator::operator++ ( int  )
inline

Advance the iterator to the next position (postfix version).

Definition at line 96 of file positioniterator.h.

◆ operator=()

PositionIterator & Xapian::PositionIterator::operator= ( const PositionIterator o)

Assignment.

Definition at line 68 of file positioniterator.cc.

References Xapian::Internal::intrusive_base::_refs, decref(), internal, LOGCALL, and RETURN.

◆ skip_to()

void Xapian::PositionIterator::skip_to ( Xapian::termpos  termpos)

Advance the iterator to term position termpos.

Parameters
termposThe position to advance to. If this position isn't in the stream being iterated, then the iterator is moved to the next term position after it which is.

Definition at line 100 of file positioniterator.cc.

References decref(), internal, LOGCALL_VOID, and Xapian::PositionIterator::Internal::skip_to().

Referenced by DEFINE_TESTCASE(), and main().

Member Data Documentation

◆ internal

Internal* Xapian::PositionIterator::internal
private

Reference counted internals.

Definition at line 45 of file positioniterator.h.

Referenced by Xapian::iterator_valid(), operator*(), operator++(), operator=(), PositionIterator(), and skip_to().


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