xapian-core  1.4.25
inmemory_positionlist.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2003,2008,2009,2011 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef OM_HGUARD_INMEMORY_POSITIONLIST_H
24 #define OM_HGUARD_INMEMORY_POSITIONLIST_H
25 
26 #include <xapian/types.h>
27 #include <xapian/error.h>
28 
29 #include <vector>
30 #include "backends/positionlist.h"
31 #include "api/documentterm.h"
32 
33 using namespace std;
34 
37 {
38  private:
40  vector<Xapian::termpos> positions;
41 
43  vector<Xapian::termpos>::const_iterator mypos;
44 
47 
50 
52  void operator=(const InMemoryPositionList &);
53 
54  public:
56  InMemoryPositionList() : iterating_in_progress(false) { }
57 
59  explicit InMemoryPositionList(bool)
60  : mypos(positions.begin()), iterating_in_progress(false) { }
61 
63  explicit
65 
67  void set_data(const OmDocumentTerm::term_positions & positions_);
68 
70  Xapian::termcount get_approx_size() const;
71 
73  Xapian::termpos get_position() const;
74 
79  bool next();
80 
85  bool skip_to(Xapian::termpos termpos);
86 };
87 
88 #endif /* OM_HGUARD_INMEMORY_POSITIONLIST_H */
typedefs for Xapian
InMemoryPositionList(bool)
Construct an empty InMemoryPositionList.
internal class representing a term in a modified document
Abstract base class for iterating term positions in a document.
STL namespace.
#define false
Definition: header.h:9
vector< Xapian::termpos >::const_iterator mypos
Position of iteration through positions.
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
A position list in a inmemory database.
vector< Xapian::termpos > term_positions
Definition: documentterm.h:77
bool iterating_in_progress
True if we have started iterating.
vector< Xapian::termpos > positions
The list of positions.
InMemoryPositionList()
Default constructor.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Definition: types.h:83
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:31