|
xapian-core
2.0.0
|
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... | |
| PositionIterator & | operator= (const PositionIterator &o) |
| Assignment. More... | |
| PositionIterator (PositionIterator &&o) | |
| Move constructor. More... | |
| PositionIterator & | operator= (PositionIterator &&o) |
| Move assignment operator. More... | |
| PositionIterator () noexcept | |
| Default constructor. More... | |
| ~PositionIterator () | |
| Destructor. More... | |
| Xapian::termpos | operator* () const |
| Return the term position at the current iterator position. More... | |
| PositionIterator & | operator++ () |
| Advance the iterator to the next position. More... | |
| DerefWrapper_< Xapian::termpos > | operator++ (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 value_type * | pointer |
| typedef value_type | reference |
Private Member Functions | |
| void | decref () |
| PositionIterator (Internal *internal_) | |
Private Attributes | |
| Internal * | internal |
Class for iterating over term positions.
Definition at line 39 of file positioniterator.h.
|
private |
Definition at line 127 of file positioniterator.h.
|
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 123 of file positioniterator.h.
|
private |
Definition at line 129 of file positioniterator.h.
|
private |
Definition at line 131 of file positioniterator.h.
|
private |
Definition at line 125 of file positioniterator.h.
|
explicitprivate |
Wrap an existing Internal.
Definition at line 41 of file positioniterator.cc.
References decref(), internal, LOGCALL_CTOR, and Xapian::PositionIterator::Internal::next().
| Xapian::PositionIterator::PositionIterator | ( | const PositionIterator & | o | ) |
|
inline |
Move constructor.
Definition at line 59 of file positioniterator.h.
|
inlinenoexcept |
Default constructor.
Creates an uninitialised iterator, which can't be used before being assigned to, but is sometimes syntactically convenient.
Definition at line 79 of file positioniterator.h.
|
inline |
Destructor.
Definition at line 83 of file positioniterator.h.
|
private |
Definition at line 34 of file positioniterator.cc.
References Assert.
Referenced by operator++(), operator=(), PositionIterator(), and skip_to().
| std::string Xapian::PositionIterator::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 112 of file positioniterator.cc.
Referenced by DEFINE_TESTCASE().
| 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.
| 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.
|
inline |
Advance the iterator to the next position (postfix version).
Definition at line 94 of file positioniterator.h.
References pos.
| 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.
|
inline |
Move assignment operator.
Definition at line 65 of file positioniterator.h.
| void Xapian::PositionIterator::skip_to | ( | Xapian::termpos | termpos | ) |
Advance the iterator to term position termpos.
| termpos | The 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, pos, and Xapian::PositionIterator::Internal::skip_to().
Referenced by DEFINE_TESTCASE(), and main().
|
private |
Reference counted internals.
Definition at line 46 of file positioniterator.h.
Referenced by Xapian::iterator_valid(), operator*(), operator++(), operator=(), PositionIterator(), and skip_to().