xapian-core  2.0.0
positionlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2010,2017 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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_POSITIONLIST_H
22 #define XAPIAN_INCLUDED_POSITIONLIST_H
23 
24 #include <xapian/intrusive_ptr.h>
26 #include <xapian/types.h>
27 
28 namespace Xapian {
29 
32 {
34  void operator=(const Internal &) = delete;
35 
37  Internal(const Internal &) = delete;
38 
39  protected:
41  Internal() { }
42 
43  public:
47  virtual ~Internal() { }
48 
50  virtual Xapian::termcount get_approx_size() const = 0;
51 
53  virtual Xapian::termpos back() const = 0;
54 
56  virtual Xapian::termpos get_position() const = 0;
57 
66  virtual bool next() = 0;
67 
76  virtual bool skip_to(Xapian::termpos termpos) = 0;
77 };
78 
79 }
80 
82 
83 #endif // XAPIAN_INCLUDED_POSITIONLIST_H
Base class for objects managed by intrusive_ptr.
Definition: intrusive_ptr.h:50
Abstract base class for iterating term positions in a document.
Definition: positionlist.h:32
virtual bool next()=0
Advance to the next entry in the positionlist.
virtual Xapian::termpos back() const =0
Return the final entry in this positionlist.
Internal(const Internal &)=delete
Don't allow copying.
virtual bool skip_to(Xapian::termpos termpos)=0
Skip forward to the specified position.
void operator=(const Internal &)=delete
Don't allow assignment.
virtual Xapian::termpos get_position() const =0
Return the current position.
virtual ~Internal()
We have virtual methods and want to be able to delete derived classes using a pointer to the base cla...
Definition: positionlist.h:47
virtual Xapian::termcount get_approx_size() const =0
Return approximate size of this positionlist.
Internal()
Only constructable as a base class for derived classes.
Definition: positionlist.h:41
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:64
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Definition: types.h:75
Class for iterating over term positions.
Xapian::PositionIterator::Internal PositionList
Definition: positionlist.h:81
typedefs for Xapian