root / tags / 1.0.8 / xapian-core / backends / flint / flint_modifiedpostlist.h
| Revision 9256, 2.3 kB (checked in by olly, 16 months ago) |
|---|
| Line | |
|---|---|
| 1 | /** @file flint_modifiedpostlist.h |
| 2 | * @brief A FlintPostList plus pending modifications |
| 3 | */ |
| 4 | /* Copyright (C) 2006,2007 Olly Betts |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef XAPIAN_INCLUDED_FLINT_MODIFIEDPOSTLIST_H |
| 22 | #define XAPIAN_INCLUDED_FLINT_MODIFIEDPOSTLIST_H |
| 23 | |
| 24 | #include <map> |
| 25 | #include <string> |
| 26 | |
| 27 | using namespace std; |
| 28 | |
| 29 | #include "flint_postlist.h" |
| 30 | |
| 31 | class FlintModifiedPostList : public FlintPostList { |
| 32 | /// Modifications to apply to the FlintPostList. |
| 33 | //@{ |
| 34 | map<Xapian::docid, pair<char, Xapian::termcount> > mods; |
| 35 | map<Xapian::docid, pair<char, Xapian::termcount> >::const_iterator it; |
| 36 | //@} |
| 37 | |
| 38 | /// Pointer to PositionList returned from read_position_list to be deleted. |
| 39 | PositionList * poslist; |
| 40 | |
| 41 | /// Skip over deleted documents after a next() or skip_to(). |
| 42 | void skip_deletes(Xapian::weight w_min); |
| 43 | |
| 44 | public: |
| 45 | /// Constructor. |
| 46 | FlintModifiedPostList(Xapian::Internal::RefCntPtr<const FlintDatabase> this_db_, |
| 47 | const string & tname_, |
| 48 | const map<Xapian::docid, pair<char, Xapian::termcount> > & mods_) |
| 49 | : FlintPostList(this_db_, tname_), |
| 50 | mods(mods_), it(mods.begin()), poslist(0) |
| 51 | { } |
| 52 | |
| 53 | ~FlintModifiedPostList(); |
| 54 | |
| 55 | Xapian::doccount get_termfreq() const; |
| 56 | |
| 57 | Xapian::docid get_docid() const; |
| 58 | |
| 59 | Xapian::doclength get_doclength() const; |
| 60 | |
| 61 | Xapian::termcount get_wdf() const; |
| 62 | |
| 63 | PositionList *read_position_list(); |
| 64 | |
| 65 | PositionList *open_position_list() const; |
| 66 | |
| 67 | PostList * next(Xapian::weight w_min); |
| 68 | |
| 69 | PostList * skip_to(Xapian::docid desired_did, Xapian::weight w_min); |
| 70 | |
| 71 | bool at_end() const; |
| 72 | |
| 73 | std::string get_description() const; |
| 74 | }; |
| 75 | |
| 76 | #endif // XAPIAN_INCLUDED_FLINT_MODIFIEDPOSTLIST_H |
Note: See TracBrowser
for help on using the browser.
