00001 /* xorpostlist.h: XOR of two posting lists 00002 * 00003 * ----START-LICENCE---- 00004 * Copyright 1999,2000,2001 BrightStation PLC 00005 * Copyright 2002 Ananova Ltd 00006 * Copyright 2003,2004 Olly Betts 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of the 00011 * License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 * USA 00022 * -----END-LICENCE----- 00023 */ 00024 00025 #ifndef OM_HGUARD_XORPOSTLIST_H 00026 #define OM_HGUARD_XORPOSTLIST_H 00027 00028 #include "branchpostlist.h" 00029 00040 class XorPostList : public BranchPostList { 00041 private: 00042 Xapian::docid lhead, rhead; 00043 Xapian::weight lmax, rmax, minmax; 00044 00045 Xapian::doccount dbsize; 00046 00047 PostList *advance_to_next_match(Xapian::weight w_min); 00048 public: 00049 Xapian::doccount get_termfreq_max() const; 00050 Xapian::doccount get_termfreq_min() const; 00051 Xapian::doccount get_termfreq_est() const; 00052 00053 Xapian::docid get_docid() const; 00054 Xapian::weight get_weight() const; 00055 Xapian::weight get_maxweight() const; 00056 00057 Xapian::weight recalc_maxweight(); 00058 00059 PostList *next(Xapian::weight w_min); 00060 PostList *skip_to(Xapian::docid did, Xapian::weight w_min); 00061 bool at_end() const; 00062 00063 std::string get_description() const; 00064 00068 virtual Xapian::doclength get_doclength() const; 00069 00070 XorPostList(PostList * left_, 00071 PostList * right_, 00072 MultiMatch * matcher_, 00073 Xapian::doccount dbsize_); 00074 }; 00075 00076 #endif /* OM_HGUARD_XORPOSTLIST_H */