xapian-core  1.4.26
inmemory_alltermslist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2003,2008,2009,2011 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, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef OM_HGUARD_INMEMORY_ALLTERMSLIST_H
24 #define OM_HGUARD_INMEMORY_ALLTERMSLIST_H
25 
26 #include "backends/alltermslist.h"
27 #include "inmemory_database.h"
28 
31 {
32  private:
35 
37  void operator=(const InMemoryAllTermsList &);
38 
39  const std::map<string, InMemoryTerm> *tmap;
40 
41  std::map<string, InMemoryTerm>::const_iterator it;
42 
44 
45  string prefix;
46 
47  public:
49  InMemoryAllTermsList(const std::map<string, InMemoryTerm>* tmap_,
51  const string& prefix_)
52  : tmap(tmap_), it(tmap->begin()), database(database_),
53  prefix(prefix_)
54  {
55  }
56 
57  // Gets current termname
58  string get_termname() const;
59 
60  // Get num of docs indexed by term
62 
63  TermList * skip_to(const string &tname);
64 
67  TermList * next();
68 
69  // True if we're off the end of the list
70  bool at_end() const;
71 };
72 
73 #endif /* OM_HGUARD_INMEMORY_ALLTERMSLIST_H */
std::map< string, InMemoryTerm >::const_iterator it
Abstract base class for termlists.
Definition: termlist.h:39
Xapian::Internal::intrusive_ptr< const InMemoryDatabase > database
void operator=(const InMemoryAllTermsList &)
Assignment is not allowed.
string get_termname() const
Return the termname at the current position.
bool at_end() const
Return true if the current position is past the last term in this list.
const std::map< string, InMemoryTerm > * tmap
C++ class definition for inmemory database access.
Abstract base class for iterating all terms in a database.
InMemoryAllTermsList(const InMemoryAllTermsList &)
Copying is not allowed.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * next()
next() causes the AllTermsList to move to the next term in the list.
class for alltermslists over several databases
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Abstract base class for iterating all terms in a database.
Definition: alltermslist.h:27
InMemoryAllTermsList(const std::map< string, InMemoryTerm > *tmap_, Xapian::Internal::intrusive_ptr< const InMemoryDatabase > database_, const string &prefix_)
Constructor.
TermList * skip_to(const string &tname)
Skip forward to the specified term.