xapian-core  1.4.21
slowvaluelist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2011,2014 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 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_SLOWVALUELIST_H
22 #define XAPIAN_INCLUDED_SLOWVALUELIST_H
23 
24 #include "valuelist.h"
25 
26 #include "database.h"
27 
32 class SlowValueList : public ValueList {
34  void operator=(const SlowValueList &);
35 
38 
41 
44 
47 
49  std::string current_value;
50 
53 
54  public:
56  : db(db_), last_docid(db_->get_lastdocid()), slot(slot_), current_did(0)
57  { }
58 
59  Xapian::docid get_docid() const;
60 
61  std::string get_value() const;
62 
64 
65  bool at_end() const;
66 
67  void next();
68 
69  void skip_to(Xapian::docid);
70 
71  bool check(Xapian::docid did);
72 
73  std::string get_description() const;
74 };
75 
76 #endif // XAPIAN_INCLUDED_SLOWVALUELIST_H
Base class for databases.
Definition: database.h:56
SlowValueList(const SlowValueList &)
Don't allow copying.
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::docid get_docid() const
Return the docid at the current position.
std::string current_value
The value at the current position.
Definition: slowvaluelist.h:49
bool check(Xapian::docid did)
Check if the specified docid occurs in this valuestream.
void operator=(const SlowValueList &)
Don't allow assignment.
Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > db
The subdatabase.
Definition: slowvaluelist.h:40
SlowValueList(const Xapian::Database::Internal *db_, Xapian::valueno slot_)
Definition: slowvaluelist.h:55
std::string get_description() const
Return a string description of this object.
Xapian::docid current_did
The document id at the current position.
Definition: slowvaluelist.h:52
Xapian::docid last_docid
The last docid in the database, or 0 if we&#39;re at_end.
Definition: slowvaluelist.h:43
Xapian::valueno slot
The value slot we&#39;re iterating over.
Definition: slowvaluelist.h:46
std::string get_value() const
Return the value at the current position.
Abstract base class for value streams.
Definition: valuelist.h:31
unsigned valueno
The number for a value slot in a document.
Definition: types.h:108
Abstract base class for value streams.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
void next()
Advance the current position to the next document in the value stream.
void skip_to(Xapian::docid)
Skip forward to the specified docid.
Xapian::valueno get_valueno() const
Return the value slot for the current position/this iterator.
Slow implementation for backends which don&#39;t streamed values.
Definition: slowvaluelist.h:32