xapian-core  1.4.27
documentvaluelist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2009,2011 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_DOCUMENTVALUELIST_H
22 #define XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
23 
24 #include "backends/valuelist.h"
25 
26 #include "backends/document.h"
27 
29 class DocumentValueList final : public ValueList {
31  void operator=(const DocumentValueList &);
32 
35 
38 
43  Xapian::Document::Internal::document_values::const_iterator it;
44 
45  public:
47  : doc(doc_), it(doc->values.end()) { }
48 
49  Xapian::docid get_docid() const;
50 
51  std::string get_value() const;
52 
54 
55  bool at_end() const;
56 
57  void next();
58 
60  void skip_to(Xapian::docid slot);
61 
62  std::string get_description() const;
63 };
64 
65 #endif // XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
Xapian::docid get_docid() const
Return the docid at the current position.
Xapian::Document::Internal::document_values::const_iterator it
Iterator over the map inside doc.
bool at_end() const
Return true if the current position is past the last entry in this list.
DocumentValueList(const Xapian::Internal::intrusive_ptr< Xapian::Document::Internal > &doc_)
void next()
Advance the current position to the next document in the value stream.
Iteration over values in a document.
std::string get_value() const
Return the value at the current position.
Xapian::valueno get_valueno() const
Return the value slot for the current position/this iterator.
void skip_to(Xapian::docid slot)
The parameter is actually a Xapian::valueno for this subclass.
Xapian::Internal::intrusive_ptr< const Xapian::Document::Internal > doc
Document internals we&#39;re iterating over.
std::string get_description() const
Return a string description of this object.
void operator=(const DocumentValueList &)
Don&#39;t allow assignment.
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
DocumentValueList(const DocumentValueList &)
Don&#39;t allow copying.
Abstract base class for value streams.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52