00001 00004 /* Copyright (C) 2007 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 USA 00019 */ 00020 00021 #ifndef XAPIAN_INCLUDED_ORTERMLIST_H 00022 #define XAPIAN_INCLUDED_ORTERMLIST_H 00023 00024 #include "termlist.h" 00025 00026 namespace Xapian { 00027 namespace Internal { 00028 class ExpandStats; 00029 } 00030 } 00031 00032 class OrTermList : public TermList { 00033 protected: 00035 TermList *left, *right; 00036 00043 std::string left_current, right_current; 00044 00046 void check_started() const; 00047 00048 public: 00049 OrTermList(TermList * left_, TermList * right_) 00050 : left(left_), right(right_) { } 00051 00052 ~OrTermList(); 00053 00054 Xapian::termcount get_approx_size() const; 00055 00056 void accumulate_stats(Xapian::Internal::ExpandStats & stats) const; 00057 00058 std::string get_termname() const; 00059 00060 Xapian::termcount get_wdf() const; 00061 00062 Xapian::doccount get_termfreq() const; 00063 00064 #if 0 // This method isn't actually used anywhere currently. 00065 Xapian::termcount get_collection_freq() const; 00066 #endif 00067 00068 TermList *next(); 00069 00070 bool at_end() const; 00071 00072 Xapian::termcount positionlist_count() const; 00073 00074 Xapian::PositionIterator positionlist_begin() const; 00075 }; 00076 00083 class FreqAdderOrTermList : public OrTermList { 00084 public: 00085 FreqAdderOrTermList(TermList * left_, TermList * right_) 00086 : OrTermList(left_, right_) 00087 { } 00088 00089 Xapian::doccount get_termfreq() const; 00090 }; 00091 00092 #endif // XAPIAN_INCLUDED_ORTERMLIST_H