39 : valuelist(vl), db_idx(db_idx_) { }
47 did = (did - 1) / multiplier + 1 + ((did - 1) % multiplier > db_idx);
56 return (valuelist->
get_docid() - 1) * multiplier + db_idx + 1;
74 if (did_a > did_b)
return true;
75 if (did_a < did_b)
return false;
86 : current_docid(0), slot(slot_), multiplier(dbs.size())
93 vector<intrusive_ptr<Xapian::Database::Internal> >::const_iterator i;
94 for (i = dbs.begin(); i != dbs.end(); ++i) {
142 vector<SubValueList *>::iterator i =
valuelists.begin();
145 if ((*i)->at_end()) {
183 vector<SubValueList*>::iterator i =
valuelists.begin();
186 if ((*i)->at_end()) {
214 return "MultiValueList()";
bool check(Xapian::docid did)
Check if the specified docid occurs in this valuestream.
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.
std::string get_description() const
Return a string description of this object.
Xapian::docid current_docid
Current docid (or 0 if we haven't started yet).
Xapian::valueno slot
The value slot we're iterating over.
void next()
Advance the current position to the next document in the value stream.
std::vector< SubValueList * > valuelists
Vector of sub-valuelists which we use as a heap.
~MultiValueList()
Destructor.
MultiValueList(const MultiValueList &)
Don't allow copying.
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::docid get_docid() const
Return the docid at the current position.
void skip_to(Xapian::docid)
Skip forward to the specified docid.
A smart pointer that uses intrusive reference counting.
Abstract base class for value streams.
virtual void next()=0
Advance the current position to the next document in the value stream.
virtual Xapian::docid get_docid() const =0
Return the docid at the current position.
virtual bool at_end() const =0
Return true if the current position is past the last entry in this list.
virtual void skip_to(Xapian::docid)=0
Skip forward to the specified docid.
virtual std::string get_value() const =0
Return the value at the current position.
Hierarchy of classes which Xapian can throw as exceptions.
Class for merging ValueList objects from subdatabases.
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Various assertion macros.
#define AssertRel(A, REL, B)
Comparison functor which orders SubValueList* by ascending docid.
bool operator()(const SubValueList *a, const SubValueList *b) const
Order by ascending docid.
Xapian::docid get_docid() const
SubValueList(ValueList *vl, unsigned db_idx_)
std::string get_value() const
void skip_to(Xapian::docid did, size_t multiplier)
Xapian::docid get_merged_docid(unsigned multiplier) const
void operator()(CLASS *p) const