Branch data Line data Source code
1 : : /** @file brass_valuelist.h
2 : : * @brief Brass class for value streams.
3 : : */
4 : : /* Copyright (C) 2007,2008,2009 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_BRASS_VALUELIST_H
22 : : #define XAPIAN_INCLUDED_BRASS_VALUELIST_H
23 : :
24 : : #include "valuelist.h"
25 : : #include "brass_values.h"
26 : :
27 : : class BrassCursor;
28 : : class BrassDatabase;
29 : :
30 : : /// Brass class for value streams.
31 : : class BrassValueList : public Xapian::ValueIterator::Internal {
32 : : /// Don't allow assignment.
33 : : void operator=(const BrassValueList &);
34 : :
35 : : /// Don't allow copying.
36 : : BrassValueList(const BrassValueList &);
37 : :
38 : : BrassCursor * cursor;
39 : :
40 : : Brass::ValueChunkReader reader;
41 : :
42 : : Xapian::valueno slot;
43 : :
44 : : Xapian::Internal::RefCntPtr<const BrassDatabase> db;
45 : :
46 : : /// Update @a reader to use the chunk currently pointed to by @a cursor.
47 : : bool update_reader();
48 : :
49 : : public:
50 : 2682 : BrassValueList(Xapian::valueno slot_,
51 : : Xapian::Internal::RefCntPtr<const BrassDatabase> db_)
52 : 2682 : : cursor(NULL), slot(slot_), db(db_) { }
53 : :
54 : : ~BrassValueList();
55 : :
56 : : Xapian::docid get_docid() const;
57 : :
58 : : Xapian::valueno get_valueno() const;
59 : :
60 : : std::string get_value() const;
61 : :
62 : : bool at_end() const;
63 : :
64 : : void next();
65 : :
66 : : void skip_to(Xapian::docid);
67 : :
68 : : bool check(Xapian::docid did);
69 : :
70 : : std::string get_description() const;
71 : : };
72 : :
73 : : #endif // XAPIAN_INCLUDED_BRASS_VALUELIST_H
|