00001 00004 /* Copyright (C) 2007,2008 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_SLOWVALUELIST_H 00022 #define XAPIAN_INCLUDED_SLOWVALUELIST_H 00023 00024 #include "valuelist.h" 00025 00026 #include "xapian/database.h" 00027 00032 class SlowValueList : public ValueList { 00034 void operator=(const SlowValueList &); 00035 00037 SlowValueList(const SlowValueList &); 00038 00040 Xapian::Database db; 00041 00043 Xapian::docid last_docid; 00044 00046 Xapian::valueno slot; 00047 00049 std::string current_value; 00050 00052 Xapian::docid current_did; 00053 00054 public: 00055 SlowValueList(const Xapian::Database &db_, Xapian::valueno slot_) 00056 : db(db_), last_docid(db.get_lastdocid()), slot(slot_), current_did(0) 00057 { } 00058 00059 Xapian::docid get_docid() const; 00060 00061 std::string get_value() const; 00062 00063 Xapian::valueno get_valueno() const; 00064 00065 bool at_end() const; 00066 00067 void next(); 00068 00069 void skip_to(Xapian::docid); 00070 00071 bool check(Xapian::docid did); 00072 00073 std::string get_description() const; 00074 }; 00075 00076 #endif // XAPIAN_INCLUDED_SLOWVALUELIST_H