Groonga 3.0.9 Source Code Document
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
groonga
lib
dat
predictive-cursor.hpp
Go to the documentation of this file.
1
/* -*- c-basic-offset: 2 -*- */
2
/* Copyright(C) 2011 Brazil
3
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License version 2.1 as published by the Free Software Foundation.
7
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Lesser General Public License for more details.
12
13
You should have received a copy of the GNU Lesser General Public
14
License along with this library; if not, write to the Free Software
15
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
*/
17
18
#ifndef GRN_DAT_PREDICTIVE_CURSOR_HPP_
19
#define GRN_DAT_PREDICTIVE_CURSOR_HPP_
20
21
#include "
cursor.hpp
"
22
#include "
vector.hpp
"
23
24
namespace
grn {
25
namespace
dat {
26
27
class
Trie;
28
29
class
GRN_DAT_API
PredictiveCursor
:
public
Cursor
{
30
public
:
31
PredictiveCursor
();
32
~
PredictiveCursor
();
33
34
void
open(
const
Trie
&trie,
35
const
String
&str,
36
UInt32
offset = 0,
37
UInt32
limit =
MAX_UINT32
,
38
UInt32
flags = 0);
39
40
void
close();
41
42
const
Key
&next();
43
44
UInt32
offset
()
const
{
45
return
offset_;
46
}
47
UInt32
limit
()
const
{
48
return
limit_;
49
}
50
UInt32
flags
()
const
{
51
return
flags_;
52
}
53
54
private
:
55
const
Trie
*trie_;
56
UInt32
offset_;
57
UInt32
limit_;
58
UInt32
flags_;
59
60
Vector<UInt32>
buf_;
61
UInt32
cur_;
62
UInt32
end_;
63
UInt32
min_length_;
64
65
PredictiveCursor
(
const
Trie
&trie,
66
UInt32
offset,
UInt32
limit,
UInt32
flags);
67
68
UInt32
fix_flags(
UInt32
flags)
const
;
69
void
init(
const
String
&str);
70
void
swap(
PredictiveCursor
*cursor);
71
72
const
Key
&ascending_next();
73
const
Key
&descending_next();
74
75
static
const
UInt32
IS_ROOT_FLAG = 0x80000000U;
76
static
const
UInt32
POST_ORDER_FLAG = 0x80000000U;
77
78
// Disallows copy and assignment.
79
PredictiveCursor
(
const
PredictiveCursor
&);
80
PredictiveCursor
&operator=(
const
PredictiveCursor
&);
81
};
82
83
}
// namespace dat
84
}
// namespace grn
85
86
#endif // GRN_DAT_PREDICTIVE_CURSOR_HPP_
Generated on Sun Nov 10 2013 09:49:02 for Groonga 3.0.9 Source Code Document by
1.8.1.2