#include <inmemory_database.h>
Inheritance diagram for InMemoryPostList:
Public Member Functions | |
Xapian::doccount | get_termfreq () const |
Return the exact term frequency. | |
Xapian::docid | get_docid () const |
Return the current docid. | |
Xapian::doclength | get_doclength () const |
Return the length of current document. | |
Xapian::termcount | get_wdf () const |
Return the wdf for the document at the current position. | |
PositionList * | read_position_list () |
Read the position list for the term in the current document and return a pointer to it (owned by the PostList). | |
PositionList * | open_position_list () const |
Read the position list for the term in the current document and return a pointer to it (not owned by the PostList). | |
PostList * | next (Xapian::weight w_min) |
Advance the current position to the next document in the postlist. | |
PostList * | skip_to (Xapian::docid did, Xapian::weight w_min) |
Skip forward to the specified docid. | |
bool | at_end () const |
Return true if the current position is past the last entry in this list. | |
string | get_description () const |
Return a string description of this object. | |
Private Member Functions | |
InMemoryPostList (Xapian::Internal::RefCntPtr< const InMemoryDatabase > db, const InMemoryTerm &term) | |
Private Attributes | |
vector< InMemoryPosting >::const_iterator | pos |
vector< InMemoryPosting >::const_iterator | end |
Xapian::doccount | termfreq |
bool | started |
InMemoryPositionList | mypositions |
List of positions of the current term. | |
Xapian::Internal::RefCntPtr< const InMemoryDatabase > | db |
Friends | |
class | InMemoryDatabase |
Definition at line 131 of file inmemory_database.h.
InMemoryPostList::InMemoryPostList | ( | Xapian::Internal::RefCntPtr< const InMemoryDatabase > | db, | |
const InMemoryTerm & | term | |||
) | [private] |
Xapian::doccount InMemoryPostList::get_termfreq | ( | ) | const [virtual] |
Return the exact term frequency.
Leaf postlists have an exact termfreq, which get_termfreq_min(), get_termfreq_max(), and get_termfreq_est() all report.
Implements LeafPostList.
Definition at line 94 of file inmemory_database.cc.
References termfreq.
Xapian::docid InMemoryPostList::get_docid | ( | ) | const [virtual] |
Return the current docid.
Implements Xapian::PostingIterator::Internal.
Definition at line 100 of file inmemory_database.cc.
References Assert, at_end(), and started.
Referenced by get_doclength().
Xapian::doclength InMemoryPostList::get_doclength | ( | ) | const [virtual] |
Return the length of current document.
Implements Xapian::PostingIterator::Internal.
Definition at line 153 of file inmemory_database.cc.
References db, and get_docid().
Xapian::termcount InMemoryPostList::get_wdf | ( | ) | const [virtual] |
Return the wdf for the document at the current position.
The default implementation throws Xapian::UnimplementedError.
Reimplemented from Xapian::PostingIterator::Internal.
Definition at line 172 of file inmemory_database.cc.
PositionList * InMemoryPostList::read_position_list | ( | ) | [virtual] |
Read the position list for the term in the current document and return a pointer to it (owned by the PostList).
The default implementation throws Xapian::UnimplementedError.
Reimplemented from Xapian::PostingIterator::Internal.
Definition at line 159 of file inmemory_database.cc.
References mypositions, pos, and InMemoryPositionList::set_data().
PositionList * InMemoryPostList::open_position_list | ( | ) | const [virtual] |
Read the position list for the term in the current document and return a pointer to it (not owned by the PostList).
The default implementation throws Xapian::UnimplementedError.
Reimplemented from Xapian::PostingIterator::Internal.
Definition at line 166 of file inmemory_database.cc.
References pos.
PostList * InMemoryPostList::next | ( | Xapian::weight | w_min | ) | [virtual] |
Advance the current position to the next document in the postlist.
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.
w_min | The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore). |
Implements Xapian::PostingIterator::Internal.
Definition at line 110 of file inmemory_database.cc.
PostList * InMemoryPostList::skip_to | ( | Xapian::docid | , | |
Xapian::weight | w_min | |||
) | [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).
w_min | The minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore). |
Implements Xapian::PostingIterator::Internal.
Definition at line 123 of file inmemory_database.cc.
References Assert, at_end(), Xapian::PostingIterator::Internal::next(), and started.
bool InMemoryPostList::at_end | ( | ) | const [virtual] |
Return true if the current position is past the last entry in this list.
Implements Xapian::PostingIterator::Internal.
Definition at line 141 of file inmemory_database.cc.
Referenced by get_docid(), next(), and skip_to().
string InMemoryPostList::get_description | ( | ) | const [virtual] |
Return a string description of this object.
Implements Xapian::PostingIterator::Internal.
Definition at line 147 of file inmemory_database.cc.
References om_tostring(), and termfreq.
friend class InMemoryDatabase [friend] |
Definition at line 132 of file inmemory_database.h.
vector<InMemoryPosting>::const_iterator InMemoryPostList::pos [private] |
Definition at line 134 of file inmemory_database.h.
Referenced by at_end(), InMemoryPostList(), next(), open_position_list(), and read_position_list().
vector<InMemoryPosting>::const_iterator InMemoryPostList::end [private] |
Definition at line 135 of file inmemory_database.h.
Referenced by at_end(), InMemoryPostList(), and next().
Xapian::doccount InMemoryPostList::termfreq [private] |
Definition at line 136 of file inmemory_database.h.
Referenced by get_description(), and get_termfreq().
bool InMemoryPostList::started [private] |
Definition at line 137 of file inmemory_database.h.
Referenced by get_docid(), next(), and skip_to().
List of positions of the current term.
This list is populated when read_position_list() is called.
Definition at line 142 of file inmemory_database.h.
Referenced by read_position_list().
Xapian::Internal::RefCntPtr<const InMemoryDatabase> InMemoryPostList::db [private] |