scriptindex: Fix weird error cases
[xapian.git] / xapian-core / matcher / orpospostlist.h
blobd0b0d3dcca640be61468159d68e102bacaba7eae
1 /** @file
2 * @brief Wrapper postlist providing positions for an OR
3 */
4 /* Copyright 2017 Olly Betts
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
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.
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
21 #ifndef XAPIAN_INCLUDED_ORPOSPOSTLIST_H
22 #define XAPIAN_INCLUDED_ORPOSPOSTLIST_H
24 #include "api/postlist.h"
25 #include "orpositionlist.h"
27 /** Wrapper postlist providing positions for an OR. */
28 class OrPosPostList : public PostList {
29 /// Don't allow assignment.
30 void operator=(const OrPosPostList &);
32 /// Don't allow copying.
33 OrPosPostList(const OrPosPostList &);
35 PostList* pl;
37 OrPositionList position_list;
39 public:
40 OrPosPostList(PostList* pl_)
41 : pl(pl_) { }
43 ~OrPosPostList();
45 Xapian::doccount get_termfreq_min() const;
47 Xapian::doccount get_termfreq_max() const;
49 Xapian::doccount get_termfreq_est() const;
51 TermFreqs get_termfreq_est_using_stats(
52 const Xapian::Weight::Internal & stats) const;
54 double get_maxweight() const;
56 Xapian::docid get_docid() const;
58 Xapian::termcount get_doclength() const;
60 Xapian::termcount get_unique_terms() const;
62 double get_weight() const;
64 bool at_end() const;
66 double recalc_maxweight();
68 PositionList * read_position_list();
70 Internal *next(double w_min);
72 Internal *skip_to(Xapian::docid, double w_min);
74 std::string get_description() const;
76 Xapian::termcount get_wdf() const;
78 Xapian::termcount count_matching_subqs() const;
81 #endif // XAPIAN_INCLUDED_ORPOSPOSTLIST_H