xapian-core  1.4.20
Public Member Functions | 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 std::string * pointer
 
typedef std::string & reference
 

Private Member Functions

 ESetIterator (const Xapian::ESet &eset_, Xapian::doccount 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 160 of file eset.h.

Member Typedef Documentation

◆ difference_type

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 225 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 221 of file eset.h.

◆ pointer

typedef std::string* Xapian::ESetIterator::pointer
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 227 of file eset.h.

◆ reference

typedef std::string& Xapian::ESetIterator::reference
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 229 of file eset.h.

◆ value_type

typedef std::string Xapian::ESetIterator::value_type
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 223 of file eset.h.

Constructor & Destructor Documentation

◆ ESetIterator() [1/2]

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

Definition at line 163 of file eset.h.

◆ ESetIterator() [2/2]

Xapian::ESetIterator::ESetIterator ( )
inline

Create an unpositioned ESetIterator.

Definition at line 178 of file eset.h.

References Xapian::operator*().

Member Function Documentation

◆ get_description()

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

Return a string describing this object.

Definition at line 284 of file esetinternal.cc.

References Xapian::Internal::str().

◆ get_weight()

double Xapian::ESetIterator::get_weight ( ) const

Get the weight for the current position.

Definition at line 278 of file esetinternal.cc.

Referenced by DEFINE_TESTCASE(), and main().

◆ operator*()

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

Get the term at the current position.

Definition at line 272 of file esetinternal.cc.

◆ 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 248 of file eset.h.

◆ operator++() [1/2]

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

Advance the iterator to the next position.

Definition at line 184 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 190 of file eset.h.

◆ operator+=()

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

Move the iterator forwards by n positions.

Definition at line 233 of file eset.h.

◆ operator-() [1/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 256 of file eset.h.

◆ operator-() [2/2]

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

Return the number of positions between o and this iterator.

Definition at line 261 of file eset.h.

References off_from_end.

◆ operator--() [1/2]

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

Move the iterator to the previous position.

Definition at line 197 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 203 of file eset.h.

◆ operator-=()

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

Move the iterator back by n positions.

Definition at line 239 of file eset.h.

Friends And Related Function Documentation

◆ ESet

friend class ESet
friend

Definition at line 161 of file eset.h.

Member Data Documentation

◆ eset

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

The ESet we are iterating over.

Definition at line 168 of file eset.h.

Referenced by Xapian::iterator_rewind(), and Xapian::iterator_rewound().

◆ 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 175 of file eset.h.

Referenced by Xapian::iterator_rewind(), Xapian::iterator_rewound(), Xapian::iterator_valid(), operator-(), Xapian::operator<(), and Xapian::operator==().


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