xapian-core  1.4.21
valuelist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008 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_VALUELIST_H
22 #define XAPIAN_INCLUDED_VALUELIST_H
23 
24 #include <string>
25 
26 #include "xapian/intrusive_ptr.h"
27 #include <xapian/types.h>
28 #include <xapian/valueiterator.h>
29 
33  void operator=(const Internal &);
34 
36  Internal(const Internal &);
37 
38  protected:
40  Internal() { }
41 
42  public:
46  virtual ~Internal();
47 
49  virtual Xapian::docid get_docid() const = 0;
50 
52  virtual std::string get_value() const = 0;
53 
55  virtual Xapian::valueno get_valueno() const = 0;
56 
58  virtual bool at_end() const = 0;
59 
66  virtual void next() = 0;
67 
73  virtual void skip_to(Xapian::docid) = 0;
74 
93  virtual bool check(Xapian::docid did);
94 
96  virtual std::string get_description() const = 0;
97 };
98 
99 // In the external API headers, this class is Xapian::ValueIterator::Internal,
100 // but in the library code it's known as "ValueList" in most places.
102 
103 #endif // XAPIAN_INCLUDED_VALUELIST_H
virtual std::string get_description() const =0
Return a string description of this object.
typedefs for Xapian
virtual bool at_end() const =0
Return true if the current position is past the last entry in this list.
virtual Xapian::valueno get_valueno() const =0
Return the value slot for the current position/this iterator.
Class for iterating over document values.
Xapian::ValueIterator::Internal ValueList
Definition: valuelist.h:101
void operator=(const Internal &)
Don&#39;t allow assignment.
virtual Xapian::docid get_docid() const =0
Return the docid at the current position.
Base class for objects managed by intrusive_ptr.
Definition: intrusive_ptr.h:49
virtual void next()=0
Advance the current position to the next document in the value stream.
Abstract base class for value streams.
Definition: valuelist.h:31
virtual std::string get_value() const =0
Return the value at the current position.
unsigned valueno
The number for a value slot in a document.
Definition: types.h:108
virtual bool check(Xapian::docid did)
Check if the specified docid occurs in this valuestream.
Definition: valuelist.cc:30
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
virtual ~Internal()
We have virtual methods and want to be able to delete derived classes using a pointer to the base cla...
Definition: valuelist.cc:27
virtual void skip_to(Xapian::docid)=0
Skip forward to the specified docid.
Internal()
Only constructable as a base class for derived classes.
Definition: valuelist.h:40