00001 /* multi_postlist.h: C++ class definition for multiple database access 00002 * 00003 * Copyright 1999,2000,2001 BrightStation PLC 00004 * Copyright 2003,2005,2007,2009 Olly Betts 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License as 00008 * published by the Free Software Foundation; either version 2 of the 00009 * License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00019 * USA 00020 */ 00021 00022 #ifndef OM_HGUARD_MULTI_POSTLIST_H 00023 #define OM_HGUARD_MULTI_POSTLIST_H 00024 00025 #include "leafpostlist.h" 00026 #include <vector> 00027 00028 class MultiPostList : public PostList { 00029 friend class Xapian::Database; 00030 private: 00031 std::vector<LeafPostList *> postlists; 00032 00033 const Xapian::Database &this_db; 00034 00035 bool finished; 00036 Xapian::docid currdoc; 00037 00038 Xapian::doccount multiplier; 00039 00040 MultiPostList(std::vector<LeafPostList *> & pls, 00041 const Xapian::Database &this_db_); 00042 public: 00043 ~MultiPostList(); 00044 00045 Xapian::doccount get_termfreq_min() const; 00046 Xapian::doccount get_termfreq_max() const; 00047 Xapian::doccount get_termfreq_est() const; 00048 00049 Xapian::weight get_maxweight() const; 00050 Xapian::weight get_weight() const; 00051 Xapian::weight recalc_maxweight(); 00052 00053 Xapian::docid get_docid() const; // Gets current docid 00054 Xapian::termcount get_doclength() const; // Get length of current document 00055 Xapian::termcount get_wdf() const; // Within Document Frequency 00056 PositionList * open_position_list() const; 00057 PostList *next(Xapian::weight w_min); // Moves to next docid 00058 PostList *skip_to(Xapian::docid did, Xapian::weight w_min);// Moves to next docid >= specified docid 00059 bool at_end() const; // True if we're off the end of the list 00060 00061 std::string get_description() const; 00062 }; 00063 00064 #endif /* OM_HGUARD_MULTI_POSTLIST_H */