[ci] Try to get .gitignore check to work
[xapian.git] / xapian-core / matcher / extraweightpostlist.h
blob1b7da2b349c954fac1d369f7d9e5d79ef2eb8df5
1 /** @file extraweightpostlist.h
2 * @brief PostList which adds on a term-independent weight contribution
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_EXTRAWEIGHTPOSTLIST_H
22 #define XAPIAN_INCLUDED_EXTRAWEIGHTPOSTLIST_H
24 #include "wrapperpostlist.h"
26 namespace Xapian {
27 class Weight;
30 class PostListTree;
32 /// PostList which adds on a term-independent weight contribution
33 class ExtraWeightPostList : public WrapperPostList {
34 /// Don't allow assignment.
35 void operator=(const ExtraWeightPostList&) = delete;
37 /// Don't allow copying.
38 ExtraWeightPostList(const ExtraWeightPostList&) = delete;
40 Xapian::Weight* weight;
42 PostListTree* pltree;
44 double max_extra;
46 public:
47 ExtraWeightPostList(PostList* pl_,
48 Xapian::Weight* weight_,
49 PostListTree* pltree_)
50 : WrapperPostList(pl_),
51 weight(weight_),
52 pltree(pltree_),
53 max_extra(weight->get_maxextra()) {}
55 ~ExtraWeightPostList() {
56 delete weight;
59 double get_weight(Xapian::termcount doclen,
60 Xapian::termcount unique_terms) const;
62 double recalc_maxweight();
64 PostList* next(double w_min);
66 PostList* skip_to(Xapian::docid, double w_min);
68 std::string get_description() const;
71 #endif // XAPIAN_INCLUDED_EXTRAWEIGHTPOSTLIST_H