xapian-core  1.4.25
chert_alltermslist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2005,2007,2008,2009,2010,2011 Olly Betts
5  *
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.
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
19  * USA
20  */
21 
22 #ifndef XAPIAN_INCLUDED_CHERT_ALLTERMSLIST_H
23 #define XAPIAN_INCLUDED_CHERT_ALLTERMSLIST_H
24 
25 #include "backends/alltermslist.h"
26 #include "chert_database.h"
27 #include "chert_postlist.h"
28 
29 class ChertCursor;
30 
34 
36  void operator=(const ChertAllTermsList &);
37 
40 
45 
47  std::string current_term;
48 
50  std::string prefix;
51 
58 
60  void read_termfreq() const;
61 
62  public:
64  const std::string & prefix_)
65  : database(database_), cursor(NULL), prefix(prefix_), termfreq(0) { }
66 
69 
75  std::string get_termname() const;
76 
83 
85  TermList * next();
86 
88  TermList * skip_to(const std::string &tname);
89 
91  bool at_end() const;
92 };
93 
94 #endif /* XAPIAN_INCLUDED_CHERT_ALLTERMSLIST_H */
ChertAllTermsList(const ChertAllTermsList &)
Copying is not allowed.
bool at_end() const
True if we're off the end of the list.
void read_termfreq() const
Read and cache the term frequency.
A cursor pointing to a position in a Btree table, for reading several entries in order, or finding approximate matches.
Definition: chert_cursor.h:66
Xapian::doccount termfreq
The term frequency of the term at the current position.
std::string current_term
The termname at the current position.
TermList * next()
Advance to the next term in the list.
std::string prefix
The prefix to restrict the terms to.
Abstract base class for termlists.
Definition: termlist.h:39
ChertAllTermsList(Xapian::Internal::intrusive_ptr< const ChertDatabase > database_, const std::string &prefix_)
~ChertAllTermsList()
Destructor.
Xapian::Internal::intrusive_ptr< const ChertDatabase > database
Keep a reference to our database to stop it being deleted.
TermList * skip_to(const std::string &tname)
Advance to the first term which is >= tname.
Abstract base class for iterating all terms in a database.
C++ class definition for chert database.
void operator=(const ChertAllTermsList &)
Assignment is not allowed.
ChertCursor * cursor
A cursor which runs through the postlist table reading termnames from the keys.
Xapian::doccount get_termfreq() const
Returns the term frequency of the current term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Postlists in chert databases.
Abstract base class for iterating all terms in a database.
Definition: alltermslist.h:27
std::string get_termname() const
Returns the current termname.