#include <valueiterator.h>

Classes | |
| class | Internal |
| Abstract base class for value streams. More... | |
Public Member Functions | |
| ValueIterator (const ValueIterator &o) | |
| Copy constructor. | |
| ValueIterator (const ValueIteratorEnd_ &) | |
| ValueIterator & | operator= (const ValueIterator &o) |
| Assignment. | |
| ValueIterator & | operator= (const ValueIteratorEnd_ &) |
| ValueIterator () | |
| Default constructor. | |
| ~ValueIterator () | |
| Destructor. | |
| std::string | operator* () const |
| Return the value at the current position. | |
| ValueIterator & | operator++ () |
| Advance the iterator to the next position. | |
| DerefWrapper_< std::string > | operator++ (int) |
| Advance the iterator to the next position (postfix version). | |
| Xapian::docid | get_docid () const |
| Return the docid at the current position. | |
| Xapian::valueno | get_valueno () const |
| Return the value slot number for the current position. | |
| void | skip_to (Xapian::docid docid_or_slot) |
| Advance the iterator to document id or value slot docid_or_slot. | |
| bool | check (Xapian::docid docid) |
| Check if the specified docid occurs. | |
| std::string | get_description () const |
| Return a string describing this object. | |
Private Types | |
| typedef std::input_iterator_tag | iterator_category |
| typedef std::string | value_type |
| typedef Xapian::doccount_diff | difference_type |
| typedef std::string * | pointer |
| typedef std::string & | reference |
Private Member Functions | |
| ValueIterator (Internal *internal_) | |
Private Attributes | |
| Xapian::Internal::RefCntPtr < Internal > | internal |
Definition at line 39 of file valueiterator.h.
typedef Xapian::doccount_diff Xapian::ValueIterator::difference_type [private] |
For internal use only.
ValueIterator 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 with 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 164 of file valueiterator.h.
typedef std::input_iterator_tag Xapian::ValueIterator::iterator_category [private] |
For internal use only.
ValueIterator 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 with 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 160 of file valueiterator.h.
typedef std::string* Xapian::ValueIterator::pointer [private] |
For internal use only.
ValueIterator 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 with 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 166 of file valueiterator.h.
typedef std::string& Xapian::ValueIterator::reference [private] |
For internal use only.
ValueIterator 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 with 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 168 of file valueiterator.h.
typedef std::string Xapian::ValueIterator::value_type [private] |
For internal use only.
ValueIterator 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 with 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 162 of file valueiterator.h.
| Xapian::ValueIterator::ValueIterator | ( | Internal * | internal_ | ) | [explicit, private] |
For internal use only.
Construct given internals.
Definition at line 37 of file valueiterator.cc.
References internal.
| Xapian::ValueIterator::ValueIterator | ( | const ValueIterator & | o | ) |
| Xapian::ValueIterator::ValueIterator | ( | const ValueIteratorEnd_ & | ) |
For internal use only.
Copy from an end iterator proxy.
Definition at line 46 of file valueiterator.cc.
| Xapian::ValueIterator::ValueIterator | ( | ) |
Default constructor.
Creates an uninitialised iterator, which can't be used before being assigned to, but is sometimes syntactically convenient.
Definition at line 33 of file valueiterator.cc.
| Xapian::ValueIterator::~ValueIterator | ( | ) |
| bool Xapian::ValueIterator::check | ( | Xapian::docid | docid | ) |
Check if the specified docid occurs.
The caller is required to ensure that the specified document id did actually exists in the database.
This method acts like skip_to() if that can be done at little extra cost, in which case it then returns true. This is how brass and chert databases behave because they store values in streams which allow for an efficient implementation of skip_to().
Otherwise it simply checks if a particular docid is present. If it is, it returns true. If it isn't, it returns false, and leaves the position unspecified (and hence the result of calling methods which depends on the current position, such as get_docid(), are also unspecified). In this state, next() will advance to the first matching position after document did, and skip_to() will act as it would if the position was the first matching position after document did.
Currently the inmemory, flint, and remote backends behave in the latter way because they don't support streamed values and so skip_to() must check each document it skips over which is significantly slower.
| docid | The document id to check. |
Definition at line 107 of file valueiterator.cc.
References Assert, internal, and LOGCALL.
Referenced by Xapian::ValuePostingSource::check(), and DEFINE_TESTCASE().
| std::string Xapian::ValueIterator::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 117 of file valueiterator.cc.
Referenced by DEFINE_TESTCASE().
| Xapian::docid Xapian::ValueIterator::get_docid | ( | ) | const |
Return the docid at the current position.
If we're iterating over values of a document, this method will throw Xapian::InvalidOperationError.
Definition at line 82 of file valueiterator.cc.
References Assert, internal, LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), Xapian::ValuePostingSource::get_docid(), and main().
| Xapian::valueno Xapian::ValueIterator::get_valueno | ( | ) | const |
Return the value slot number for the current position.
If the iterator is over all values in a slot, this returns that slot's number. If the iterator is over the values in a particular document, it returns the number of each slot in turn.
Definition at line 90 of file valueiterator.cc.
References Assert, internal, LOGCALL, and RETURN.
Referenced by ChertValueManager::add_document(), BrassValueManager::add_document(), DEFINE_TESTCASE(), FlintValueTable::encode_values(), InMemoryDatabase::finish_add_doc(), serialise_document(), and show_values().
| string Xapian::ValueIterator::operator* | ( | ) | const |
| DerefWrapper_<std::string> Xapian::ValueIterator::operator++ | ( | int | ) | [inline] |
Advance the iterator to the next position (postfix version).
Definition at line 78 of file valueiterator.h.
| ValueIterator & Xapian::ValueIterator::operator++ | ( | ) |
| ValueIterator & Xapian::ValueIterator::operator= | ( | const ValueIteratorEnd_ & | ) |
For internal use only.
Assignment of an end iterator proxy.
Definition at line 57 of file valueiterator.cc.
| ValueIterator & Xapian::ValueIterator::operator= | ( | const ValueIterator & | o | ) |
| void Xapian::ValueIterator::skip_to | ( | Xapian::docid | docid_or_slot | ) |
Advance the iterator to document id or value slot docid_or_slot.
If this iterator is over values in a document, then this method advances the iterator to value slot docid_or_slot, or the first slot after it if there is no value in slot slot.
If this iterator is over values in a particular slot, then this method advances the iterator to document id docid_or_slot, or the first document id after it if there is no value in the slot we're iterating over for document docid_or_slot.
Note: The "two-faced" nature of this method is due to how C++ overloading works. Xapian::docid and Xapian::valueno are both typedefs for the same unsigned integer type, so overloading can't distinguish them.
| docid_or_slot | The docid/slot to advance to. |
Definition at line 98 of file valueiterator.cc.
References Assert, internal, and LOGCALL_VOID.
Referenced by DEFINE_TESTCASE(), Xapian::DecreasingValueWeightPostingSource::skip_if_in_range(), and Xapian::ValuePostingSource::skip_to().
For internal use only.
Reference counted internals.
Definition at line 42 of file valueiterator.h.
Referenced by check(), get_docid(), get_valueno(), operator*(), operator++(), operator=(), Xapian::operator==(), skip_to(), and ValueIterator().