xapian-core  2.0.0
glass_alltermslist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2005,2007,2008,2009,2010,2011,2024 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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_GLASS_ALLTERMSLIST_H
22 #define XAPIAN_INCLUDED_GLASS_ALLTERMSLIST_H
23 
24 #include "backends/alltermslist.h"
25 #include "glass_database.h"
26 #include "glass_postlist.h"
27 
28 #include <string_view>
29 
30 class GlassCursor;
31 
35 
38 
41 
46 
48  std::string prefix;
49 
56 
58  void read_termfreq() const;
59 
60  public:
62  std::string_view prefix_)
63  : database(database_), cursor(NULL), prefix(prefix_), termfreq(0) { }
64 
67 
69 
76 
78  TermList * next();
79 
81  TermList* skip_to(std::string_view tname);
82 };
83 
84 #endif /* XAPIAN_INCLUDED_GLASS_ALLTERMSLIST_H */
Abstract base class for iterating all terms in a database.
Abstract base class for iterating all terms in a database.
Definition: alltermslist.h:27
void operator=(const GlassAllTermsList &)
Assignment is not allowed.
Xapian::doccount get_termfreq() const
Returns the term frequency of the current term.
GlassAllTermsList(const GlassAllTermsList &)
Copying is not allowed.
TermList * next()
Advance to the next term in the list.
TermList * skip_to(std::string_view tname)
Advance to the first term which is >= tname.
GlassCursor * cursor
A cursor which runs through the postlist table reading termnames from the keys.
void read_termfreq() const
Read and cache the term frequency.
Xapian::Internal::intrusive_ptr< const GlassDatabase > database
Keep a reference to our database to stop it being deleted.
GlassAllTermsList(Xapian::Internal::intrusive_ptr< const GlassDatabase > database_, std::string_view prefix_)
~GlassAllTermsList()
Destructor.
std::string prefix
The prefix to restrict the terms to.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::doccount termfreq
The term frequency of the term at the current position.
A cursor pointing to a position in a Btree table, for reading several entries in order,...
Definition: glass_cursor.h:148
Abstract base class for termlists.
Definition: termlist.h:42
C++ class definition for glass database.
Postlists in glass databases.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:64
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:37