#include <brass_valuelist.h>


Public Member Functions | |
| BrassValueList (Xapian::valueno slot_, Xapian::Internal::RefCntPtr< const BrassDatabase > db_) | |
| ~BrassValueList () | |
| 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 BrassValueList &) |
| Don't allow assignment. | |
| BrassValueList (const BrassValueList &) | |
| Don't allow copying. | |
| bool | update_reader () |
| Update reader to use the chunk currently pointed to by cursor. | |
Private Attributes | |
| BrassCursor * | cursor |
| Brass::ValueChunkReader | reader |
| Xapian::valueno | slot |
| Xapian::Internal::RefCntPtr < const BrassDatabase > | db |
Definition at line 31 of file brass_valuelist.h.
| BrassValueList::BrassValueList | ( | const BrassValueList & | ) | [private] |
Don't allow copying.
| BrassValueList::BrassValueList | ( | Xapian::valueno | slot_, | |
| Xapian::Internal::RefCntPtr< const BrassDatabase > | db_ | |||
| ) | [inline] |
Definition at line 50 of file brass_valuelist.h.
| BrassValueList::~BrassValueList | ( | ) |
| bool BrassValueList::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 71 of file brass_valuelist.cc.
References cursor.
Referenced by get_docid(), and get_value().
| bool BrassValueList::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 133 of file brass_valuelist.cc.
References BrassCursor::after_end(), Assert, Brass::ValueChunkReader::at_end(), cursor, db, BrassCursor::find_entry(), make_valuechunk_key(), reader, Brass::ValueChunkReader::skip_to(), slot, and update_reader().
| string BrassValueList::get_description | ( | ) | const [virtual] |
Return a string description of this object.
Implements Xapian::ValueIterator::Internal.
Definition at line 166 of file brass_valuelist.cc.
References slot, and Xapian::Internal::str().
| Xapian::docid BrassValueList::get_docid | ( | ) | const [virtual] |
Return the docid at the current position.
Implements Xapian::ValueIterator::Internal.
Definition at line 51 of file brass_valuelist.cc.
References Assert, at_end(), Brass::ValueChunkReader::get_docid(), and reader.
| std::string BrassValueList::get_value | ( | ) | const [virtual] |
Return the value at the current position.
Implements Xapian::ValueIterator::Internal.
Definition at line 64 of file brass_valuelist.cc.
References Assert, at_end(), Brass::ValueChunkReader::get_value(), and reader.
| Xapian::valueno BrassValueList::get_valueno | ( | ) | const [virtual] |
Return the value slot for the current position/this iterator.
Implements Xapian::ValueIterator::Internal.
Definition at line 58 of file brass_valuelist.cc.
References slot.
| void BrassValueList::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 77 of file brass_valuelist.cc.
References BrassCursor::after_end(), Brass::ValueChunkReader::at_end(), cursor, db, BrassCursor::find_entry_ge(), make_valuechunk_key(), BrassCursor::next(), Brass::ValueChunkReader::next(), reader, slot, and update_reader().
| void BrassValueList::operator= | ( | const BrassValueList & | ) | [private] |
Don't allow assignment.
| void BrassValueList::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 101 of file brass_valuelist.cc.
References BrassCursor::after_end(), Brass::ValueChunkReader::at_end(), cursor, db, BrassCursor::find_entry(), make_valuechunk_key(), BrassCursor::next(), reader, Brass::ValueChunkReader::skip_to(), slot, and update_reader().
| bool BrassValueList::update_reader | ( | ) | [private] |
Update reader to use the chunk currently pointed to by cursor.
Definition at line 34 of file brass_valuelist.cc.
References Brass::ValueChunkReader::assign(), BrassCursor::current_key, BrassCursor::current_tag, cursor, docid_from_key(), BrassCursor::read_tag(), reader, and slot.
BrassCursor* BrassValueList::cursor [private] |
Definition at line 38 of file brass_valuelist.h.
Referenced by at_end(), check(), next(), skip_to(), update_reader(), and ~BrassValueList().
Xapian::Internal::RefCntPtr<const BrassDatabase> BrassValueList::db [private] |
Definition at line 40 of file brass_valuelist.h.
Referenced by check(), get_docid(), get_value(), next(), skip_to(), and update_reader().
Xapian::valueno BrassValueList::slot [private] |
Definition at line 42 of file brass_valuelist.h.
Referenced by check(), get_description(), get_valueno(), next(), skip_to(), and update_reader().