Split PostList and PostingIterator::Internal
[xapian.git] / xapian-core / api / postlist.cc
blobdfb699b6c494260ed398ebe6e1a884595998ea7a
1 /** @file postlist.cc
2 * @brief Abstract base class for postlists.
3 */
4 /* Copyright (C) 2007,2009,2011,2015,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 #include <config.h>
23 #include "postlist.h"
25 #include <xapian/error.h>
27 #include "omassert.h"
29 using namespace std;
31 PostList::~PostList() {}
33 TermFreqs
34 PostList::get_termfreq_est_using_stats(const Xapian::Weight::Internal &) const
36 throw Xapian::InvalidOperationError(
37 "get_termfreq_est_using_stats() not meaningful for this PostingIterator");
40 Xapian::termcount
41 PostList::get_doclength() const
43 throw Xapian::InvalidOperationError("get_doclength() not meaningful for this PostingIterator");
46 Xapian::termcount
47 PostList::get_unique_terms() const
49 throw Xapian::InvalidOperationError("get_unique_terms() not meaningful for this PostingIterator");
52 Xapian::termcount
53 PostList::get_wdf() const
55 throw Xapian::InvalidOperationError("get_wdf() not meaningful for this PostingIterator");
58 PositionList *
59 PostList::read_position_list()
61 throw Xapian::UnimplementedError("OP_NEAR and OP_PHRASE only currently support leaf subqueries");
64 PositionList *
65 PostList::open_position_list() const
67 throw Xapian::InvalidOperationError("open_position_list() not meaningful for this PostingIterator");
70 PostList *
71 PostList::check(Xapian::docid did, double w_min, bool &valid)
73 valid = true;
74 return skip_to(did, w_min);
77 Xapian::termcount
78 PostList::count_matching_subqs() const
80 Assert(false);
81 return 0;
84 void
85 PostList::gather_position_lists(OrPositionList*)
87 Assert(false);