Fix whitespace irregularities in code
[xapian.git] / xapian-core / backends / slowvaluelist.h
blob0725776be631d15bca2e508fd1404e9cb33f3845
1 /** @file slowvaluelist.h
2 * @brief Slow implementation for backends which don't streamed values.
3 */
4 /* Copyright (C) 2007,2008,2011,2014 Olly Betts
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.
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.
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
21 #ifndef XAPIAN_INCLUDED_SLOWVALUELIST_H
22 #define XAPIAN_INCLUDED_SLOWVALUELIST_H
24 #include "valuelist.h"
26 #include "database.h"
28 /** Slow implementation for backends which don't streamed values.
30 * Used by inmemory and remote backends.
32 class SlowValueList : public ValueList {
33 /// Don't allow assignment.
34 void operator=(const SlowValueList &);
36 /// Don't allow copying.
37 SlowValueList(const SlowValueList &);
39 /// The subdatabase.
40 Xapian::Internal::intrusive_ptr<const Xapian::Database::Internal> db;
42 /// The last docid in the database, or 0 if we're at_end.
43 Xapian::docid last_docid;
45 /// The value slot we're iterating over.
46 Xapian::valueno slot;
48 /// The value at the current position.
49 std::string current_value;
51 /// The document id at the current position.
52 Xapian::docid current_did;
54 public:
55 SlowValueList(const Xapian::Database::Internal * db_, Xapian::valueno slot_)
56 : db(db_), last_docid(db_->get_lastdocid()), slot(slot_), current_did(0)
57 { }
59 Xapian::docid get_docid() const;
61 std::string get_value() const;
63 Xapian::valueno get_valueno() const;
65 bool at_end() const;
67 void next();
69 void skip_to(Xapian::docid);
71 bool check(Xapian::docid did);
73 std::string get_description() const;
76 #endif // XAPIAN_INCLUDED_SLOWVALUELIST_H