|
xapian-core
2.0.0
|
Class for iterating over a list of terms. More...
#include <termiterator.h>
Collaboration diagram for Xapian::TermIterator:Classes | |
| class | Internal |
| Abstract base class for termlists. More... | |
Public Member Functions | |
| TermIterator (const TermIterator &o) | |
| Copy constructor. More... | |
| TermIterator & | operator= (const TermIterator &o) |
| Assignment. More... | |
| TermIterator (TermIterator &&o) | |
| Move constructor. More... | |
| TermIterator & | operator= (TermIterator &&o) |
| Move assignment operator. More... | |
| TermIterator () noexcept | |
| Default constructor. More... | |
| ~TermIterator () | |
| Destructor. More... | |
| std::string | operator* () const |
| Return the term at the current position. More... | |
| Xapian::termcount | get_wdf () const |
| Return the wdf for the term at the current position. More... | |
| Xapian::doccount | get_termfreq () const |
| Return the term frequency for the term at the current position. More... | |
| Xapian::termcount | positionlist_count () const |
| Return the length of the position list for the current position. More... | |
| PositionIterator | positionlist_begin () const |
| Return a PositionIterator for the current term. More... | |
| PositionIterator | positionlist_end () const noexcept |
| Return an end PositionIterator for the current term. More... | |
| TermIterator & | operator++ () |
| Advance the iterator to the next position. More... | |
| DerefWrapper_< std::string > | operator++ (int) |
| Advance the iterator to the next position (postfix version). More... | |
| void | skip_to (std::string_view term) |
| Advance the iterator to term term. More... | |
| std::string | get_description () const |
| Return a string describing this object. More... | |
Private Types | |
| typedef std::input_iterator_tag | iterator_category |
| typedef std::string | value_type |
| typedef Xapian::termcount_diff | difference_type |
| typedef value_type * | pointer |
| typedef value_type | reference |
Private Member Functions | |
| TermIterator (Internal *internal_) | |
| void | decref () |
| void | post_advance (Internal *res) |
Private Attributes | |
| Internal * | internal |
Class for iterating over a list of terms.
Definition at line 41 of file termiterator.h.
|
private |
Definition at line 153 of file termiterator.h.
|
private |
TermIterator 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 149 of file termiterator.h.
|
private |
Definition at line 155 of file termiterator.h.
|
private |
Definition at line 157 of file termiterator.h.
|
private |
Definition at line 151 of file termiterator.h.
|
explicitprivate |
Wrap an existing Internal.
Definition at line 58 of file termiterator.cc.
References decref(), internal, LOGCALL_CTOR, Xapian::TermIterator::Internal::next(), and post_advance().
| Xapian::TermIterator::TermIterator | ( | const TermIterator & | o | ) |
|
inline |
Move constructor.
Definition at line 59 of file termiterator.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 termiterator.h.
|
inline |
Destructor.
Definition at line 83 of file termiterator.h.
|
private |
Definition at line 34 of file termiterator.cc.
References Assert.
Referenced by operator=(), and TermIterator().
| std::string Xapian::TermIterator::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 151 of file termiterator.cc.
Referenced by DEFINE_TESTCASE().
| Xapian::doccount Xapian::TermIterator::get_termfreq | ( | ) | const |
Return the term frequency for the term at the current position.
Note that for a TermIterator returned by calling termlist_begin() on a Document object obtained from a sharded database, this method will return the term frequency from the shard that the document is in rather than for the combined database.
Definition at line 119 of file termiterator.cc.
References Assert, Xapian::TermIterator::Internal::get_termfreq(), internal, LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), main(), RemoteServer::msg_termlist(), closedb1_iterators::perform(), remotefailure1_iterators::perform(), and show_termlist().
| Xapian::termcount Xapian::TermIterator::get_wdf | ( | ) | const |
Return the wdf for the term at the current position.
Definition at line 111 of file termiterator.cc.
References Assert, Xapian::TermIterator::Internal::get_wdf(), internal, LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), RemoteServer::msg_termlist(), closedb1_iterators::perform(), remotefailure1_iterators::perform(), GlassTermListTable::set_termlist(), HoneyTermListTable::set_termlist(), and show_termlist().
| string Xapian::TermIterator::operator* | ( | ) | const |
Return the term at the current position.
Definition at line 94 of file termiterator.cc.
References Assert, Xapian::TermIterator::Internal::get_termname(), internal, LOGCALL, and RETURN.
| TermIterator & Xapian::TermIterator::operator++ | ( | ) |
Advance the iterator to the next position.
Definition at line 102 of file termiterator.cc.
References Assert, internal, LOGCALL, Xapian::TermIterator::Internal::next(), post_advance(), and RETURN.
|
inline |
Advance the iterator to the next position (postfix version).
Definition at line 117 of file termiterator.h.
References term.
| TermIterator & Xapian::TermIterator::operator= | ( | const TermIterator & | o | ) |
Assignment.
Definition at line 82 of file termiterator.cc.
References Xapian::Internal::intrusive_base::_refs, decref(), internal, LOGCALL, and RETURN.
|
inline |
Move assignment operator.
Definition at line 65 of file termiterator.h.
| PositionIterator Xapian::TermIterator::positionlist_begin | ( | ) | const |
Return a PositionIterator for the current term.
Definition at line 135 of file termiterator.cc.
References Assert, internal, LOGCALL, Xapian::TermIterator::Internal::positionlist_begin(), and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), and HoneyInverter::set_positionlist().
| Xapian::termcount Xapian::TermIterator::positionlist_count | ( | ) | const |
Return the length of the position list for the current position.
Definition at line 127 of file termiterator.cc.
References Assert, internal, LOGCALL, Xapian::TermIterator::Internal::positionlist_count(), and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), format_doc_termlist(), RemoteServer::msg_positionlistcount(), and HoneyInverter::set_positionlist().
|
inlinenoexcept |
Return an end PositionIterator for the current term.
Definition at line 109 of file termiterator.h.
Referenced by dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), and HoneyInverter::set_positionlist().
|
private |
Definition at line 42 of file termiterator.cc.
References Xapian::Internal::intrusive_base::_refs.
Referenced by operator++(), skip_to(), and TermIterator().
| void Xapian::TermIterator::skip_to | ( | std::string_view | term | ) |
Advance the iterator to term term.
If the iteration is over an unsorted list of terms, then this method will throw Xapian::InvalidOperationError.
| term | The term to advance to. If this term isn't in the stream being iterated, then the iterator is moved to the next term after it which is. |
Definition at line 143 of file termiterator.cc.
References internal, LOGCALL_VOID, post_advance(), Xapian::TermIterator::Internal::skip_to(), and term.
Referenced by TermGroup::as_group(), DEFINE_TESTCASE(), and RemoteServer::msg_positionlistcount().
|
private |
Reference counted internals.
Definition at line 46 of file termiterator.h.
Referenced by get_termfreq(), get_wdf(), Xapian::iterator_valid(), RemoteServer::msg_termlist(), operator*(), operator++(), operator=(), positionlist_begin(), positionlist_count(), HoneyInverter::set_positionlist(), skip_to(), and TermIterator().