strus  0.17
postingIteratorInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_POSTING_ITERATOR_INTERFACE_HPP_INCLUDED
11 #define _STRUS_POSTING_ITERATOR_INTERFACE_HPP_INCLUDED
12 #include "strus/index.hpp"
13 #include <vector>
14 
15 namespace strus
16 {
17 
21 {
22 public:
24 
27  virtual Index skipDoc( const Index& docno)=0;
28 
32  virtual Index skipDocCandidate( const Index& docno)=0;
33 
36  virtual Index skipPos( const Index& firstpos)=0;
37 
40  virtual const char* featureid() const=0;
41 
45  virtual Index documentFrequency() const=0;
46 
49  virtual unsigned int frequency()=0;
50 
53  virtual Index docno() const=0;
54 
57  virtual Index posno() const=0;
58 
61  virtual Index length() const=0;
62 };
63 
64 }//namespace
65 #endif
66 
67 
virtual Index documentFrequency() const =0
Get the number of documents where the feature occurrs.
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
virtual const char * featureid() const =0
Unique id in the system for a feature expression used for debugging and tracing.
Numeric types used for local and global indices.
virtual Index skipDocCandidate(const Index &docno)=0
Return a candidate with a document number higher than or equal to a given document number without gua...
virtual Index length() const =0
Get the ordinal position length of the current match.
virtual ~PostingIteratorInterface()
Definition: postingIteratorInterface.hpp:23
virtual Index posno() const =0
Get the current position number.
Structure that represents a set of feature occurrencies (postings) as iterator.
Definition: postingIteratorInterface.hpp:20
virtual Index skipPos(const Index &firstpos)=0
Return the next matching position higher than or equal to firstpos in the current document...
virtual unsigned int frequency()=0
Get the frequency of the feature in the current document.
virtual Index docno() const =0
Get the current document number.
virtual Index skipDoc(const Index &docno)=0
Return the next document match with a document number higher than or equal to a given document number...