xapian-core  2.0.0
inmemory_alltermslist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2003,2008,2009,2011,2017,2024 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see
19  * <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef XAPIAN_INCLUDED_INMEMORY_ALLTERMSLIST_H
23 #define XAPIAN_INCLUDED_INMEMORY_ALLTERMSLIST_H
24 
25 #include "backends/alltermslist.h"
26 #include "inmemory_database.h"
27 
30 {
31  private:
34 
37 
38  const std::map<std::string,
40  std::less<>>* tmap;
41 
42  std::map<std::string, InMemoryTerm, std::less<>>::const_iterator it;
43 
45 
46  std::string prefix;
47 
48  public:
50  InMemoryAllTermsList(const std::map<std::string,
52  std::less<>>* tmap_,
54  std::string_view prefix_)
55  : tmap(tmap_), it(tmap->begin()), database(database_),
56  prefix(prefix_)
57  {
58  }
59 
61 
62  // Get num of docs indexed by term
64 
65  TermList* skip_to(std::string_view tname);
66 
69  TermList * next();
70 };
71 
72 #ifdef DISABLE_GPL_LIBXAPIAN
73 # error GPL source we cannot relicense included in libxapian
74 #endif
75 
76 #endif /* XAPIAN_INCLUDED_INMEMORY_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
class for alltermslists over several databases
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::Internal::intrusive_ptr< const InMemoryDatabase > database
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
void operator=(const InMemoryAllTermsList &)
Assignment is not allowed.
TermList * skip_to(std::string_view tname)
Skip forward to the specified term.
InMemoryAllTermsList(const InMemoryAllTermsList &)
Copying is not allowed.
InMemoryAllTermsList(const std::map< std::string, InMemoryTerm, std::less<>> *tmap_, Xapian::Internal::intrusive_ptr< const InMemoryDatabase > database_, std::string_view prefix_)
Constructor.
TermList * next()
next() causes the AllTermsList to move to the next term in the list.
const std::map< std::string, InMemoryTerm, std::less<> > * tmap
std::map< std::string, InMemoryTerm, std::less<> >::const_iterator it
Abstract base class for termlists.
Definition: termlist.h:42
C++ class definition for inmemory database access.
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