00001 00004 /* Copyright 2008,2009 Olly Betts 00005 * Copyright 2009 Lemur Consulting Ltd 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef XAPIAN_INCLUDED_EXTERNALPOSTLIST_H 00023 #define XAPIAN_INCLUDED_EXTERNALPOSTLIST_H 00024 00025 #include "postlist.h" 00026 00027 namespace Xapian { 00028 class PostingSource; 00029 } 00030 00031 class MultiMatch; 00032 00033 class ExternalPostList : public PostList { 00035 ExternalPostList(const ExternalPostList &); 00036 00038 void operator=(const ExternalPostList &); 00039 00040 Xapian::PostingSource * source; 00041 bool source_is_owned; 00042 00043 Xapian::docid current; 00044 00045 double factor; 00046 00047 PostList * update_after_advance(); 00048 00049 public: 00054 ExternalPostList(const Xapian::Database & db, 00055 Xapian::PostingSource *source_, 00056 double factor_, 00057 MultiMatch * matcher); 00058 00059 ~ExternalPostList(); 00060 00061 Xapian::doccount get_termfreq_min() const; 00062 00063 Xapian::doccount get_termfreq_est() const; 00064 00065 Xapian::doccount get_termfreq_max() const; 00066 00067 Xapian::weight get_maxweight() const; 00068 00069 Xapian::docid get_docid() const; 00070 00071 Xapian::weight get_weight() const; 00072 00073 Xapian::termcount get_doclength() const; 00074 00075 Xapian::weight recalc_maxweight(); 00076 00077 PositionList * read_position_list(); 00078 00079 PositionList * open_position_list() const; 00080 00081 PostList * next(Xapian::weight w_min); 00082 00083 PostList * skip_to(Xapian::docid, Xapian::weight w_min); 00084 00085 PostList * check(Xapian::docid did, Xapian::weight w_min, bool &valid); 00086 00087 bool at_end() const; 00088 00089 Xapian::termcount count_matching_subqs() const; 00090 00091 string get_description() const; 00092 }; 00093 00094 #endif /* XAPIAN_INCLUDED_EXTERNALPOSTLIST_H */