00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XAPIAN_INCLUDED_MULTIXORPOSTLIST_H
00023 #define XAPIAN_INCLUDED_MULTIXORPOSTLIST_H
00024
00025 #include "multimatch.h"
00026 #include "postlist.h"
00027 #include <algorithm>
00028
00029 using namespace std;
00030
00031 class MultiMatch;
00032
00034 class MultiXorPostList : public PostList {
00036 void operator=(const MultiXorPostList &);
00037
00039 MultiXorPostList(const MultiXorPostList &);
00040
00042 Xapian::docid did;
00043
00045 size_t n_kids;
00046
00048 PostList ** plist;
00049
00051 Xapian::weight max_total;
00052
00054 Xapian::doccount db_size;
00055
00057 MultiMatch *matcher;
00058
00060 void erase_sublist(size_t i) {
00061 delete plist[i];
00062 --n_kids;
00063 for (size_t j = i; j < n_kids; ++j) {
00064 plist[j] = plist[j + 1];
00065 }
00066 matcher->recalc_maxweight();
00067 }
00068
00069 public:
00073 template <class RandomItor>
00074 MultiXorPostList(RandomItor pl_begin, RandomItor pl_end,
00075 MultiMatch * matcher_, Xapian::doccount db_size_)
00076 : did(0), n_kids(pl_end - pl_begin), plist(NULL),
00077 max_total(0), db_size(db_size_), matcher(matcher_)
00078 {
00079 plist = new PostList * [n_kids];
00080 std::copy(pl_begin, pl_end, plist);
00081 }
00082
00083 ~MultiXorPostList();
00084
00085 Xapian::doccount get_termfreq_min() const;
00086
00087 Xapian::doccount get_termfreq_max() const;
00088
00089 Xapian::doccount get_termfreq_est() const;
00090
00091 TermFreqs get_termfreq_est_using_stats(
00092 const Xapian::Weight::Internal & stats) const;
00093
00094 Xapian::weight get_maxweight() const;
00095
00096 Xapian::docid get_docid() const;
00097
00098 Xapian::termcount get_doclength() const;
00099
00100 Xapian::weight get_weight() const;
00101
00102 bool at_end() const;
00103
00104 Xapian::weight recalc_maxweight();
00105
00106 Internal *next(Xapian::weight w_min);
00107
00108 Internal *skip_to(Xapian::docid, Xapian::weight w_min);
00109
00110 std::string get_description() const;
00111
00119 Xapian::termcount get_wdf() const;
00120
00121 Xapian::termcount count_matching_subqs() const;
00122 };
00123
00124 #endif // XAPIAN_INCLUDED_MULTIXORPOSTLIST_H