xapian-core
1.4.27
|
Class for iterating over a list of terms. More...
#include <termiterator.h>
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 () | |
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 |
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 (const std::string &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 std::string * | pointer |
typedef std::string & | 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 |
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 154 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 150 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 156 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 158 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 152 of file termiterator.h.
|
explicitprivate |
Construct given internals.
Definition at line 56 of file termiterator.cc.
References decref(), internal, LOGCALL_CTOR, Xapian::TermIterator::Internal::next(), and post_advance().
Xapian::TermIterator::TermIterator | ( | const TermIterator & | o | ) |
|
inline |
Default constructor.
Creates an uninitialised iterator, which can't be used before being assigned to, but is sometimes syntactically convenient.
Definition at line 80 of file termiterator.h.
|
inline |
|
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 149 of file termiterator.cc.
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 117 of file termiterator.cc.
References Assert, Xapian::TermIterator::Internal::get_termfreq(), internal, LOGCALL, and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), main(), closedb1_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 109 of file termiterator.cc.
References Assert, Xapian::TermIterator::Internal::get_wdf(), internal, LOGCALL, and RETURN.
Referenced by GlassWritableDatabase::add_document_(), ChertWritableDatabase::add_document_(), dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), closedb1_iterators::perform(), GlassWritableDatabase::replace_document(), ChertWritableDatabase::replace_document(), serialise_document(), ChertTermListTable::set_termlist(), GlassTermListTable::set_termlist(), and show_termlist().
string Xapian::TermIterator::operator* | ( | ) | const |
Return the term at the current position.
Definition at line 92 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 100 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 118 of file termiterator.h.
TermIterator & Xapian::TermIterator::operator= | ( | const TermIterator & | o | ) |
Assignment.
Definition at line 80 of file termiterator.cc.
References Xapian::Internal::intrusive_base::_refs, decref(), internal, LOGCALL, and RETURN.
PositionIterator Xapian::TermIterator::positionlist_begin | ( | ) | const |
Return a PositionIterator for the current term.
Definition at line 133 of file termiterator.cc.
References Assert, internal, LOGCALL, Xapian::TermIterator::Internal::positionlist_begin(), and RETURN.
Referenced by ChertWritableDatabase::add_document_(), dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), ChertWritableDatabase::replace_document(), serialise_document(), and Inverter::set_positionlist().
Xapian::termcount Xapian::TermIterator::positionlist_count | ( | ) | const |
Return the length of the position list for the current position.
Definition at line 125 of file termiterator.cc.
References Assert, internal, LOGCALL, Xapian::TermIterator::Internal::positionlist_count(), and RETURN.
Referenced by dbcheck(), DEFINE_TESTCASE(), format_doc_termlist(), and serialise_document().
|
inline |
Return an end PositionIterator for the current term.
Definition at line 110 of file termiterator.h.
Referenced by ChertWritableDatabase::add_document_(), dbcheck(), DEFINE_TESTCASE(), InMemoryDatabase::finish_add_doc(), format_doc_termlist(), ChertWritableDatabase::replace_document(), serialise_document(), and Inverter::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 | ( | const std::string & | 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 141 of file termiterator.cc.
References internal, LOGCALL_VOID, post_advance(), and Xapian::TermIterator::Internal::skip_to().
Referenced by DEFINE_TESTCASE().
|
private |
Reference counted internals.
Definition at line 44 of file termiterator.h.
Referenced by get_termfreq(), get_wdf(), Xapian::iterator_valid(), operator*(), operator++(), operator=(), positionlist_begin(), positionlist_count(), Inverter::set_positionlist(), skip_to(), and TermIterator().