xapian-core
1.4.26
matcher
orpositionlist.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, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef XAPIAN_INCLUDED_ORPOSITIONLIST_H
22
#define XAPIAN_INCLUDED_ORPOSITIONLIST_H
23
24
#include "
backends/positionlist.h
"
25
#include "
api/postlist.h
"
26
27
#include "
xapian/error.h
"
28
#include <algorithm>
29
#include <vector>
30
31
class
OrPositionList
:
public
PositionList
{
33
std::vector<PositionList*>
pls
;
34
39
std::vector<Xapian::termpos>
current
;
40
42
Xapian::termpos
current_pos
;
43
44
public
:
45
OrPositionList
() { }
46
47
PositionList
*
gather
(
PostList
* pl) {
48
pls.clear();
49
current.clear();
50
pl->
gather_position_lists
(
this
);
51
if
(pls.size() == 1)
52
return
pls[0];
53
return
this
;
54
}
55
56
void
add_poslist
(
PositionList
* poslist) {
57
pls.push_back(poslist);
58
}
59
60
Xapian::termcount
get_approx_size
()
const
;
61
62
Xapian::termpos
get_position
()
const
;
63
64
bool
next
();
65
66
bool
skip_to
(
Xapian::termpos
termpos
);
67
};
68
69
#endif // XAPIAN_INCLUDED_ORPOSITIONLIST_H
OrPositionList
Definition:
orpositionlist.h:31
Xapian::PostingIterator::Internal
Abstract base class for postlists.
Definition:
postlist.h:37
OrPositionList::next
bool next()
Advance to the next entry in the positionlist.
Definition:
orpositionlist.cc:53
Xapian::PostingIterator::Internal::gather_position_lists
virtual void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
OrPositionList::skip_to
bool skip_to(Xapian::termpos termpos)
Skip forward to the specified position.
Definition:
orpositionlist.cc:85
positionlist.h
Abstract base class for iterating term positions in a document.
OrPositionList::current
std::vector< Xapian::termpos > current
Current positions of the subobjects.
Definition:
orpositionlist.h:39
OrPositionList::current_pos
Xapian::termpos current_pos
Current position of this object.
Definition:
orpositionlist.h:42
postlist.h
Abstract base class for postlists.
OrPositionList::get_position
Xapian::termpos get_position() const
Return the current position.
Definition:
orpositionlist.cc:41
error.h
Hierarchy of classes which Xapian can throw as exceptions.
Xapian::termcount
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition:
types.h:72
OrPositionList::get_approx_size
Xapian::termcount get_approx_size() const
Return approximate size of this positionlist.
Definition:
orpositionlist.cc:30
OrPositionList::gather
PositionList * gather(PostList *pl)
Definition:
orpositionlist.h:47
OrPositionList::add_poslist
void add_poslist(PositionList *poslist)
Definition:
orpositionlist.h:56
OrPositionList::OrPositionList
OrPositionList()
Definition:
orpositionlist.h:45
Xapian::termpos
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Definition:
types.h:83
OrPositionList::pls
std::vector< PositionList * > pls
The PositionList sub-objects.
Definition:
orpositionlist.h:33
Xapian::PositionIterator::Internal
Abstract base class for iterating term positions in a document.
Definition:
positionlist.h:31
Generated by
Doxygen 1.8.13