xapian-core  1.4.26
glass_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_GLASS_ALLTERMSLIST_H
23 #define XAPIAN_INCLUDED_GLASS_ALLTERMSLIST_H
24 
25 #include "backends/alltermslist.h"
26 #include "glass_database.h"
27 #include "glass_postlist.h"
28 
29 class GlassCursor;
30 
34 
36  void operator=(const GlassAllTermsList &);
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_GLASS_ALLTERMSLIST_H */
void read_termfreq() const
Read and cache the term frequency.
Abstract base class for termlists.
Definition: termlist.h:39
Postlists in glass databases.
GlassAllTermsList(const GlassAllTermsList &)
Copying is not allowed.
Xapian::Internal::intrusive_ptr< const GlassDatabase > database
Keep a reference to our database to stop it being deleted.
~GlassAllTermsList()
Destructor.
void operator=(const GlassAllTermsList &)
Assignment is not allowed.
TermList * skip_to(const std::string &tname)
Advance to the first term which is >= tname.
GlassCursor * cursor
A cursor which runs through the postlist table reading termnames from the keys.
Xapian::doccount termfreq
The term frequency of the term at the current position.
bool at_end() const
True if we&#39;re off the end of the list.
Xapian::doccount get_termfreq() const
Returns the term frequency of the current term.
std::string current_term
The termname at the current position.
C++ class definition for glass database.
Abstract base class for iterating all terms in a database.
A cursor pointing to a position in a Btree table, for reading several entries in order, or finding approximate matches.
Definition: glass_cursor.h:147
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
TermList * next()
Advance to the next term in the list.
std::string get_termname() const
Returns the current termname.
Abstract base class for iterating all terms in a database.
Definition: alltermslist.h:27
std::string prefix
The prefix to restrict the terms to.
GlassAllTermsList(Xapian::Internal::intrusive_ptr< const GlassDatabase > database_, const std::string &prefix_)