#include <chert_valuelist.h>


Public Member Functions | |
| ChertValueList (Xapian::valueno slot_, Xapian::Internal::RefCntPtr< const ChertDatabase > db_) | |
| ~ChertValueList () | |
| Xapian::docid | get_docid () const |
| Return the docid at the current position. | |
| Xapian::valueno | get_valueno () const |
| Return the value slot for the current position/this iterator. | |
| std::string | get_value () const |
| Return the value at the current position. | |
| bool | at_end () const |
| Return true if the current position is past the last entry in this list. | |
| void | next () |
| Advance the current position to the next document in the value stream. | |
| void | skip_to (Xapian::docid) |
| Skip forward to the specified docid. | |
| bool | check (Xapian::docid did) |
| Check if the specified docid occurs in this valuestream. | |
| std::string | get_description () const |
| Return a string description of this object. | |
Private Member Functions | |
| void | operator= (const ChertValueList &) |
| Don't allow assignment. | |
| ChertValueList (const ChertValueList &) | |
| Don't allow copying. | |
| bool | update_reader () |
| Update reader to use the chunk currently pointed to by cursor. | |
Private Attributes | |
| ChertCursor * | cursor |
| ValueChunkReader | reader |
| Xapian::valueno | slot |
| Xapian::Internal::RefCntPtr < const ChertDatabase > | db |
Definition at line 31 of file chert_valuelist.h.
| ChertValueList::ChertValueList | ( | const ChertValueList & | ) | [private] |
Don't allow copying.
| ChertValueList::ChertValueList | ( | Xapian::valueno | slot_, | |
| Xapian::Internal::RefCntPtr< const ChertDatabase > | db_ | |||
| ) | [inline] |
Definition at line 50 of file chert_valuelist.h.
| ChertValueList::~ChertValueList | ( | ) |
| bool ChertValueList::at_end | ( | ) | const [virtual] |
Return true if the current position is past the last entry in this list.
Implements Xapian::ValueIterator::Internal.
Definition at line 70 of file chert_valuelist.cc.
References cursor.
Referenced by get_docid(), and get_value().
| bool ChertValueList::check | ( | Xapian::docid | did | ) | [virtual] |
Check if the specified docid occurs in this valuestream.
The caller is required to ensure that the specified docid 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.
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 docid, and skip_to() will act as it would if the position was the first matching position after docid.
The default implementation calls skip_to().
Reimplemented from Xapian::ValueIterator::Internal.
Definition at line 132 of file chert_valuelist.cc.
References ChertCursor::after_end(), Assert, ValueChunkReader::at_end(), cursor, db, ChertCursor::find_entry(), make_valuechunk_key(), reader, ValueChunkReader::skip_to(), slot, and update_reader().
| string ChertValueList::get_description | ( | ) | const [virtual] |
Return a string description of this object.
Implements Xapian::ValueIterator::Internal.
Definition at line 165 of file chert_valuelist.cc.
References slot, and Xapian::Internal::str().
| Xapian::docid ChertValueList::get_docid | ( | ) | const [virtual] |
Return the docid at the current position.
Implements Xapian::ValueIterator::Internal.
Definition at line 50 of file chert_valuelist.cc.
References Assert, at_end(), ValueChunkReader::get_docid(), and reader.
| std::string ChertValueList::get_value | ( | ) | const [virtual] |
Return the value at the current position.
Implements Xapian::ValueIterator::Internal.
Definition at line 63 of file chert_valuelist.cc.
References Assert, at_end(), ValueChunkReader::get_value(), and reader.
| Xapian::valueno ChertValueList::get_valueno | ( | ) | const [virtual] |
Return the value slot for the current position/this iterator.
Implements Xapian::ValueIterator::Internal.
Definition at line 57 of file chert_valuelist.cc.
References slot.
| void ChertValueList::next | ( | ) | [virtual] |
Advance the current position to the next document in the value stream.
The list starts before the first entry in the list, so next() must be called before any methods which need the context of the current position.
Implements Xapian::ValueIterator::Internal.
Definition at line 76 of file chert_valuelist.cc.
References ChertCursor::after_end(), ValueChunkReader::at_end(), cursor, db, ChertCursor::find_entry_ge(), make_valuechunk_key(), ChertCursor::next(), ValueChunkReader::next(), reader, slot, and update_reader().
| void ChertValueList::operator= | ( | const ChertValueList & | ) | [private] |
Don't allow assignment.
| void ChertValueList::skip_to | ( | Xapian::docid | ) | [virtual] |
Skip forward to the specified docid.
If the specified docid isn't in the list, position ourselves on the first document after it (or at_end() if no greater docids are present).
Implements Xapian::ValueIterator::Internal.
Definition at line 100 of file chert_valuelist.cc.
References ChertCursor::after_end(), ValueChunkReader::at_end(), cursor, db, ChertCursor::find_entry(), make_valuechunk_key(), ChertCursor::next(), reader, ValueChunkReader::skip_to(), slot, and update_reader().
| bool ChertValueList::update_reader | ( | ) | [private] |
Update reader to use the chunk currently pointed to by cursor.
Definition at line 33 of file chert_valuelist.cc.
References ValueChunkReader::assign(), ChertCursor::current_key, ChertCursor::current_tag, cursor, docid_from_key(), ChertCursor::read_tag(), reader, and slot.
ChertCursor* ChertValueList::cursor [private] |
Definition at line 38 of file chert_valuelist.h.
Referenced by at_end(), check(), next(), skip_to(), update_reader(), and ~ChertValueList().
Xapian::Internal::RefCntPtr<const ChertDatabase> ChertValueList::db [private] |
ValueChunkReader ChertValueList::reader [private] |
Definition at line 40 of file chert_valuelist.h.
Referenced by check(), get_docid(), get_value(), next(), skip_to(), and update_reader().
Xapian::valueno ChertValueList::slot [private] |
Definition at line 42 of file chert_valuelist.h.
Referenced by check(), get_description(), get_valueno(), next(), skip_to(), and update_reader().