ResultsIteratorImpl.hpp
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* File: ResultsIteratorImpl.hpp
* Author: mlenart
*
* Created on 26 czerwiec 2014, 14:37
*/
#ifndef RESULTSITERATORIMPL_HPP
#define RESULTSITERATORIMPL_HPP
#include <string>
#include <vector>
#include "morfeusz2.h"
#include "MorfeuszImpl.hpp"
#include "charset/TextReader.hpp"
namespace morfeusz {
class MorfeuszImpl;
class ResultsIteratorImpl: public ResultsIterator {
public:
ResultsIteratorImpl(const MorfeuszImpl& morfeusz, const char* text, const char* textEnd, bool isOwnerOfText);
~ResultsIteratorImpl();
bool hasNext();
const MorphInterpretation& peek();
MorphInterpretation next();
private:
const MorfeuszImpl& morfeusz;
const char* text;
bool isOwnerOfText;
TextReader reader;
std::vector<MorphInterpretation> buffer;
std::vector<MorphInterpretation>::iterator bufferIterator;
bool tryToReadIntoBuffer();
void ensureHasNext();
};
}
#endif /* RESULTSITERATORIMPL_HPP */