xapian-core  2.0.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Xapian::ESetIterator Class Reference

Iterator over a Xapian::ESet. More...

#include <eset.h>

+ Collaboration diagram for Xapian::ESetIterator:

Public Member Functions

 ESetIterator ()
 Create an unpositioned ESetIterator. More...
 
std::string operator* () const
 Get the term at the current position. More...
 
ESetIteratoroperator++ ()
 Advance the iterator to the next position. More...
 
ESetIterator operator++ (int)
 Advance the iterator to the next position (postfix version). More...
 
ESetIteratoroperator-- ()
 Move the iterator to the previous position. More...
 
ESetIterator operator-- (int)
 Move the iterator to the previous position (postfix version). More...
 
ESetIteratoroperator+= (difference_type n)
 Move the iterator forwards by n positions. More...
 
ESetIteratoroperator-= (difference_type n)
 Move the iterator back by n positions. More...
 
ESetIterator operator+ (difference_type n) const
 Return the iterator incremented by n positions. More...
 
ESetIterator operator- (difference_type n) const
 Return the iterator decremented by n positions. More...
 
difference_type operator- (const ESetIterator &o) const
 Return the number of positions between o and this iterator. More...
 
double get_weight () const
 Get the weight for the current position. More...
 
std::string get_description () const
 Return a string describing this object. More...
 

Private Types

typedef std::random_access_iterator_tag iterator_category
 
typedef std::string value_type
 
typedef Xapian::termcount_diff difference_type
 
typedef value_typepointer
 
typedef value_type reference
 

Private Member Functions

 ESetIterator (const Xapian::ESet &eset_, Xapian::termcount off_from_end_)
 

Private Attributes

Xapian::ESet eset
 
Xapian::ESet::size_type off_from_end
 

Friends

class ESet
 

Detailed Description

Iterator over a Xapian::ESet.

Definition at line 157 of file eset.h.

Member Typedef Documentation

◆ difference_type

Definition at line 222 of file eset.h.

◆ iterator_category

typedef std::random_access_iterator_tag Xapian::ESetIterator::iterator_category
private

ESetIterator is what the C++ STL calls an random_access_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 218 of file eset.h.

◆ pointer

Definition at line 224 of file eset.h.

◆ reference

Definition at line 226 of file eset.h.

◆ value_type

typedef std::string Xapian::ESetIterator::value_type
private

Definition at line 220 of file eset.h.

Constructor & Destructor Documentation

◆ ESetIterator() [1/2]

Xapian::ESetIterator::ESetIterator ( const Xapian::ESet eset_,
Xapian::termcount  off_from_end_ 
)
inlineprivate

Definition at line 160 of file eset.h.

◆ ESetIterator() [2/2]

Xapian::ESetIterator::ESetIterator ( )
inline

Create an unpositioned ESetIterator.

Definition at line 175 of file eset.h.

Member Function Documentation

◆ get_description()

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

Return a string describing this object.

Definition at line 236 of file esetinternal.cc.

References eset, Xapian::ESet::internal, off_from_end, and Xapian::Internal::str().

Referenced by DEFINE_TESTCASE().

◆ get_weight()

double Xapian::ESetIterator::get_weight ( ) const

Get the weight for the current position.

Definition at line 228 of file esetinternal.cc.

References Assert, AssertRel, eset, Xapian::ESet::internal, and off_from_end.

Referenced by DEFINE_TESTCASE(), and main().

◆ operator*()

std::string Xapian::ESetIterator::operator* ( ) const

Get the term at the current position.

Definition at line 220 of file esetinternal.cc.

References Assert, AssertRel, eset, Xapian::ESet::internal, and off_from_end.

◆ operator+()

ESetIterator Xapian::ESetIterator::operator+ ( difference_type  n) const
inline

Return the iterator incremented by n positions.

If n is negative, decrements by (-n) positions.

Definition at line 245 of file eset.h.

◆ operator++() [1/2]

ESetIterator& Xapian::ESetIterator::operator++ ( )
inline

Advance the iterator to the next position.

Definition at line 181 of file eset.h.

◆ operator++() [2/2]

ESetIterator Xapian::ESetIterator::operator++ ( int  )
inline

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

Definition at line 187 of file eset.h.

◆ operator+=()

ESetIterator& Xapian::ESetIterator::operator+= ( difference_type  n)
inline

Move the iterator forwards by n positions.

Definition at line 230 of file eset.h.

◆ operator-() [1/2]

difference_type Xapian::ESetIterator::operator- ( const ESetIterator o) const
inline

Return the number of positions between o and this iterator.

Definition at line 258 of file eset.h.

References off_from_end.

◆ operator-() [2/2]

ESetIterator Xapian::ESetIterator::operator- ( difference_type  n) const
inline

Return the iterator decremented by n positions.

If n is negative, increments by (-n) positions.

Definition at line 253 of file eset.h.

◆ operator--() [1/2]

ESetIterator& Xapian::ESetIterator::operator-- ( )
inline

Move the iterator to the previous position.

Definition at line 194 of file eset.h.

◆ operator--() [2/2]

ESetIterator Xapian::ESetIterator::operator-- ( int  )
inline

Move the iterator to the previous position (postfix version).

Definition at line 200 of file eset.h.

◆ operator-=()

ESetIterator& Xapian::ESetIterator::operator-= ( difference_type  n)
inline

Move the iterator back by n positions.

Definition at line 236 of file eset.h.

Friends And Related Function Documentation

◆ ESet

friend class ESet
friend

Definition at line 158 of file eset.h.

Member Data Documentation

◆ eset

Xapian::ESet Xapian::ESetIterator::eset
private

The ESet we are iterating over.

Definition at line 165 of file eset.h.

Referenced by get_description(), get_weight(), Xapian::iterator_rewind(), Xapian::iterator_rewound(), and operator*().

◆ off_from_end

Xapian::ESet::size_type Xapian::ESetIterator::off_from_end
private

The current position of the iterator.

We store the offset from the end of eset, since that means ESet::end() just needs to set this member to 0.

Definition at line 172 of file eset.h.

Referenced by get_description(), get_weight(), Xapian::iterator_rewind(), Xapian::iterator_rewound(), Xapian::iterator_valid(), operator*(), and operator-().


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