| 1 | /* |
| 2 | Copyright(C) 2011-2016 Brazil |
| 3 | Copyright(C) 2022 Sutou Kouhei <[email protected]> |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "array.hpp"cxx . . $ `<file>/lib/dat/array.hpp`/ |
| 23 | #include "header.hpp"cxx . . $ `<file>/lib/dat/header.hpp`/ |
| 24 | #include "node.hpp"cxx . . $ `<file>/lib/dat/node.hpp`/ |
| 25 | #include "block.hpp"cxx . . $ `<file>/lib/dat/block.hpp`/ |
| 26 | #include "entry.hpp"cxx . . $ `<file>/lib/dat/entry.hpp`/ |
| 27 | #include "key.hpp"cxx . . $ `<file>/lib/dat/key.hpp`/ |
| 28 | #include "file.hpp"cxx . . $ `<file>/lib/dat/file.hpp`/ |
| 29 | |
| 30 | namespace grncxx . . $ grn/ { |
| 31 | namespace datcxx . . $ grn/dat/ { |
| 32 | |
| 33 | class GRN_DAT_APIcxx . . $ `lib/dat/dat.hpp:44:12`! Triecxx . . $ grn/dat/Trie# { |
| 34 | public: |
| 35 | Triecxx . . $ grn/dat/Trie#Trie(49f6e7a06ebc5aa8).(); |
| 36 | ~cxx . . $ grn/dat/Trie#`~Trie`(49f6e7a06ebc5aa8).Triecxx . . $ grn/dat/Trie#(); |
| 37 | |
| 38 | void createcxx . . $ grn/dat/Trie#create(effadf6d9e160e1f).(const char *file_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!, |
| 39 | UInt64cxx . . $ grn/dat/UInt64# file_size = 0, |
| 40 | UInt32cxx . . $ grn/dat/UInt32# max_num_keys = 0, |
| 41 | double num_nodes_per_key = 0.0, |
| 42 | double average_key_length = 0.0); |
| 43 | |
| 44 | void createcxx . . $ grn/dat/Trie#create(f9e26080e2580924).(const Triecxx . . $ grn/dat/Trie# &trie, |
| 45 | const char *file_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!, |
| 46 | UInt64cxx . . $ grn/dat/UInt64# file_size = 0, |
| 47 | UInt32cxx . . $ grn/dat/UInt32# max_num_keys = 0, |
| 48 | double num_nodes_per_key = 0.0, |
| 49 | double average_key_length = 0.0); |
| 50 | |
| 51 | void repaircxx . . $ grn/dat/Trie#repair(747e891cfe89c583).(const Triecxx . . $ grn/dat/Trie# &trie, const char *file_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!); |
| 52 | |
| 53 | void opencxx . . $ grn/dat/Trie#open(85c52e162fed56f9).(const char *file_name); |
| 54 | void closecxx . . $ grn/dat/Trie#close(49f6e7a06ebc5aa8).(); |
| 55 | |
| 56 | void swapcxx . . $ grn/dat/Trie#swap(e01dee0d6759772e).(Triecxx . . $ grn/dat/Trie# *trie); |
| 57 | |
| 58 | // Users can access a key by its position or ID. |
| 59 | const Keycxx . . $ grn/dat/Key# &get_keycxx . . $ grn/dat/Trie#get_key(ac1ad672cda84f14).(UInt32cxx . . $ grn/dat/UInt32# key_pos) const { |
| 60 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(key_pos >= next_key_pos()); |
| 61 | return *reinterpret_cast<const Keycxx . . $ grn/dat/Key# *>(key_buf_cxx . . $ grn/dat/Trie#key_buf_..ptrcxx . . $ grn/dat/Array#ptr(5a2a78a048fb49a8).() + key_pos); |
| 62 | } |
| 63 | // If a specified ID is invalid, e.g. the key is already deleted, this |
| 64 | // function returns a reference to an invalid key object whose id() returns |
| 65 | // INVALID_KEY_ID. |
| 66 | const Keycxx . . $ grn/dat/Key# &ith_keycxx . . $ grn/dat/Trie#ith_key(ac1ad672cda84f14).(UInt32cxx . . $ grn/dat/UInt32# key_id) const { |
| 67 | if ((key_id >= min_key_idcxx . . $ grn/dat/Trie#min_key_id(ddd8539a2fcdd4ce).()) && (key_id <= max_key_idcxx . . $ grn/dat/Trie#max_key_id(ddd8539a2fcdd4ce).()) && |
| 68 | ith_entrycxx . . $ grn/dat/Trie#ith_entry(4fe644a8fcf4134d).(key_id).is_validcxx . . $ grn/dat/Entry#is_valid(50ce9a9e25b4a850).()) { |
| 69 | return get_keycxx . . $ grn/dat/Trie#get_key(ac1ad672cda84f14).(ith_entrycxx . . $ grn/dat/Trie#ith_entry(4fe644a8fcf4134d).(key_id).key_poscxx . . $ grn/dat/Entry#key_pos(ddd8539a2fcdd4ce).()); |
| 70 | } |
| 71 | return Keycxx . . $ grn/dat/Key#::invalid_keycxx . . $ grn/dat/Key#invalid_key(741ea5814372790).(); |
| 72 | } |
| 73 | |
| 74 | bool searchcxx . . $ grn/dat/Trie#search(7a1a0c33e94d66be).(const void *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# *key_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!) const { |
| 75 | return search_keycxx . . $ grn/dat/Trie#search_key(6e3e087186c1b682).(static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(ptr), length, key_pos); |
| 76 | } |
| 77 | // Longest prefix match search. |
| 78 | bool lcp_searchcxx . . $ grn/dat/Trie#lcp_search(7a1a0c33e94d66be).(const void *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 79 | UInt32cxx . . $ grn/dat/UInt32# *key_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!) const { |
| 80 | return lcp_search_keycxx . . $ grn/dat/Trie#lcp_search_key(6e3e087186c1b682).(static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(ptr), length, key_pos); |
| 81 | } |
| 82 | |
| 83 | bool removecxx . . $ grn/dat/Trie#remove(dfa6e707f7696010).(UInt32cxx . . $ grn/dat/UInt32# key_id) { |
| 84 | const Keycxx . . $ grn/dat/Key# &key = ith_keycxx . . $ grn/dat/Trie#ith_key(ac1ad672cda84f14).(key_id); |
| 85 | if (key.is_validcxx . . $ grn/dat/Key#is_valid(50ce9a9e25b4a850).()) { |
| 86 | return removecxx . . $ grn/dat/Trie#remove(d56749dd304d51d2).(key.ptrcxx . . $ grn/dat/Key#ptr(3a8ef3fdc6e817ef).(), key.lengthcxx . . $ grn/dat/Key#length(ddd8539a2fcdd4ce).()); |
| 87 | } |
| 88 | return false; |
| 89 | } |
| 90 | bool removecxx . . $ grn/dat/Trie#remove(d56749dd304d51d2).(const void *ptr, UInt32cxx . . $ grn/dat/UInt32# length) { |
| 91 | return remove_keycxx . . $ grn/dat/Trie#remove_key(41ee87f0602ae969).(static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(ptr), length); |
| 92 | } |
| 93 | |
| 94 | bool insertcxx . . $ grn/dat/Trie#insert(ae4305a9e007baab).(const void *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# *key_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!) { |
| 95 | return insert_keycxx . . $ grn/dat/Trie#insert_key(72b38b1922c13078).(static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(ptr), length, key_pos); |
| 96 | } |
| 97 | |
| 98 | bool updatecxx . . $ grn/dat/Trie#update(79b99470cec845e1).(UInt32cxx . . $ grn/dat/UInt32# key_id, const void *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 99 | UInt32cxx . . $ grn/dat/UInt32# *key_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!) { |
| 100 | return update_keycxx . . $ grn/dat/Trie#update_key(e88d0583c9a0e46c).(ith_keycxx . . $ grn/dat/Trie#ith_key(ac1ad672cda84f14).(key_id), static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(ptr), |
| 101 | length, key_pos); |
| 102 | } |
| 103 | bool updatecxx . . $ grn/dat/Trie#update(f81369781b5607b4).(const void *src_ptr, UInt32cxx . . $ grn/dat/UInt32# src_length, |
| 104 | const void *dest_ptr, UInt32cxx . . $ grn/dat/UInt32# dest_length, |
| 105 | UInt32cxx . . $ grn/dat/UInt32# *key_pos = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!) { |
| 106 | UInt32cxx . . $ grn/dat/UInt32# src_key_pos; |
| 107 | if (!searchcxx . . $ grn/dat/Trie#search(7a1a0c33e94d66be).(src_ptr, src_length, &src_key_pos)) { |
| 108 | return false; |
| 109 | } |
| 110 | const Keycxx . . $ grn/dat/Key# &src_key = get_keycxx . . $ grn/dat/Trie#get_key(ac1ad672cda84f14).(src_key_pos); |
| 111 | return update_keycxx . . $ grn/dat/Trie#update_key(e88d0583c9a0e46c).(src_key, static_cast<const UInt8cxx . . $ grn/dat/UInt8# *>(dest_ptr), |
| 112 | dest_length, key_pos); |
| 113 | } |
| 114 | |
| 115 | const Nodecxx . . $ grn/dat/Node# &ith_nodecxx . . $ grn/dat/Trie#ith_node(cc2414b1dc013100).(UInt32cxx . . $ grn/dat/UInt32# i) const { |
| 116 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i >= num_nodes()); |
| 117 | return nodes_cxx . . $ grn/dat/Trie#nodes_.[cxx . . $ grn/dat/Array#`operator[]`(324713ecd9036b86).i]; |
| 118 | } |
| 119 | const Blockcxx . . $ grn/dat/Block# &ith_blockcxx . . $ grn/dat/Trie#ith_block(f32ad7510a8dec00).(UInt32cxx . . $ grn/dat/UInt32# i) const { |
| 120 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i >= num_blocks()); |
| 121 | return blocks_cxx . . $ grn/dat/Trie#blocks_.[cxx . . $ grn/dat/Array#`operator[]`(324713ecd9036b86).i]; |
| 122 | } |
| 123 | const Entrycxx . . $ grn/dat/Entry# &ith_entrycxx . . $ grn/dat/Trie#ith_entry(4fe644a8fcf4134d).(UInt32cxx . . $ grn/dat/UInt32# i) const { |
| 124 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i < min_key_id()); |
| 125 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i > max_key_id()); |
| 126 | return entries_cxx . . $ grn/dat/Trie#entries_.[cxx . . $ grn/dat/Array#`operator[]`(324713ecd9036b86).i]; |
| 127 | } |
| 128 | |
| 129 | const Headercxx . . $ grn/dat/Header# &headercxx . . $ grn/dat/Trie#header(6078b5dde486d212).() const { |
| 130 | return *header_cxx . . $ grn/dat/Trie#header_.; |
| 131 | } |
| 132 | |
| 133 | UInt64cxx . . $ grn/dat/UInt64# file_sizecxx . . $ grn/dat/Trie#file_size(fe4d2d262d4164a8).() const { |
| 134 | return header_cxx . . $ grn/dat/Trie#header_.->file_sizecxx . . $ grn/dat/Header#file_size(fe4d2d262d4164a8).(); |
| 135 | } |
| 136 | UInt64cxx . . $ grn/dat/UInt64# virtual_sizecxx . . $ grn/dat/Trie#virtual_size(fe4d2d262d4164a8).() const { |
| 137 | return sizeof(Headercxx . . $ grn/dat/Header#) |
| 138 | + (sizeof(Entrycxx . . $ grn/dat/Entry#) * num_keyscxx . . $ grn/dat/Trie#num_keys(ddd8539a2fcdd4ce).()) |
| 139 | + (sizeof(Blockcxx . . $ grn/dat/Block#) * num_blockscxx . . $ grn/dat/Trie#num_blocks(ddd8539a2fcdd4ce).()) |
| 140 | + (sizeof(Nodecxx . . $ grn/dat/Node#) * num_nodescxx . . $ grn/dat/Trie#num_nodes(ddd8539a2fcdd4ce).()) |
| 141 | + total_key_lengthcxx . . $ grn/dat/Trie#total_key_length(ddd8539a2fcdd4ce).(); |
| 142 | } |
| 143 | UInt32cxx . . $ grn/dat/UInt32# total_key_lengthcxx . . $ grn/dat/Trie#total_key_length(ddd8539a2fcdd4ce).() const { |
| 144 | return header_cxx . . $ grn/dat/Trie#header_.->total_key_lengthcxx . . $ grn/dat/Header#total_key_length(ddd8539a2fcdd4ce).(); |
| 145 | } |
| 146 | UInt32cxx . . $ grn/dat/UInt32# num_keyscxx . . $ grn/dat/Trie#num_keys(ddd8539a2fcdd4ce).() const { |
| 147 | return header_cxx . . $ grn/dat/Trie#header_.->num_keyscxx . . $ grn/dat/Header#num_keys(ddd8539a2fcdd4ce).(); |
| 148 | } |
| 149 | UInt32cxx . . $ grn/dat/UInt32# min_key_idcxx . . $ grn/dat/Trie#min_key_id(ddd8539a2fcdd4ce).() const { |
| 150 | return header_cxx . . $ grn/dat/Trie#header_.->min_key_idcxx . . $ grn/dat/Header#min_key_id(ddd8539a2fcdd4ce).(); |
| 151 | } |
| 152 | UInt32cxx . . $ grn/dat/UInt32# next_key_idcxx . . $ grn/dat/Trie#next_key_id(ddd8539a2fcdd4ce).() const { |
| 153 | return header_cxx . . $ grn/dat/Trie#header_.->next_key_idcxx . . $ grn/dat/Header#next_key_id(ddd8539a2fcdd4ce).(); |
| 154 | } |
| 155 | UInt32cxx . . $ grn/dat/UInt32# max_key_idcxx . . $ grn/dat/Trie#max_key_id(ddd8539a2fcdd4ce).() const { |
| 156 | return header_cxx . . $ grn/dat/Trie#header_.->max_key_idcxx . . $ grn/dat/Header#max_key_id(ddd8539a2fcdd4ce).(); |
| 157 | } |
| 158 | UInt32cxx . . $ grn/dat/UInt32# max_num_keyscxx . . $ grn/dat/Trie#max_num_keys(ddd8539a2fcdd4ce).() const { |
| 159 | return header_cxx . . $ grn/dat/Trie#header_.->max_num_keyscxx . . $ grn/dat/Header#max_num_keys(ddd8539a2fcdd4ce).(); |
| 160 | } |
| 161 | UInt32cxx . . $ grn/dat/UInt32# num_nodescxx . . $ grn/dat/Trie#num_nodes(ddd8539a2fcdd4ce).() const { |
| 162 | return header_cxx . . $ grn/dat/Trie#header_.->num_nodescxx . . $ grn/dat/Header#num_nodes(ddd8539a2fcdd4ce).(); |
| 163 | } |
| 164 | UInt32cxx . . $ grn/dat/UInt32# num_phantomscxx . . $ grn/dat/Trie#num_phantoms(ddd8539a2fcdd4ce).() const { |
| 165 | return header_cxx . . $ grn/dat/Trie#header_.->num_phantomscxx . . $ grn/dat/Header#num_phantoms(ddd8539a2fcdd4ce).(); |
| 166 | } |
| 167 | UInt32cxx . . $ grn/dat/UInt32# num_zombiescxx . . $ grn/dat/Trie#num_zombies(ddd8539a2fcdd4ce).() const { |
| 168 | return header_cxx . . $ grn/dat/Trie#header_.->num_zombiescxx . . $ grn/dat/Header#num_zombies(ddd8539a2fcdd4ce).(); |
| 169 | } |
| 170 | UInt32cxx . . $ grn/dat/UInt32# max_num_nodescxx . . $ grn/dat/Trie#max_num_nodes(ddd8539a2fcdd4ce).() const { |
| 171 | return header_cxx . . $ grn/dat/Trie#header_.->max_num_nodescxx . . $ grn/dat/Header#max_num_nodes(ddd8539a2fcdd4ce).(); |
| 172 | } |
| 173 | UInt32cxx . . $ grn/dat/UInt32# num_blockscxx . . $ grn/dat/Trie#num_blocks(ddd8539a2fcdd4ce).() const { |
| 174 | return header_cxx . . $ grn/dat/Trie#header_.->num_blockscxx . . $ grn/dat/Header#num_blocks(ddd8539a2fcdd4ce).(); |
| 175 | } |
| 176 | UInt32cxx . . $ grn/dat/UInt32# max_num_blockscxx . . $ grn/dat/Trie#max_num_blocks(ddd8539a2fcdd4ce).() const { |
| 177 | return header_cxx . . $ grn/dat/Trie#header_.->max_num_blockscxx . . $ grn/dat/Header#max_num_blocks(ddd8539a2fcdd4ce).(); |
| 178 | } |
| 179 | UInt32cxx . . $ grn/dat/UInt32# next_key_poscxx . . $ grn/dat/Trie#next_key_pos(ddd8539a2fcdd4ce).() const { |
| 180 | return header_cxx . . $ grn/dat/Trie#header_.->next_key_poscxx . . $ grn/dat/Header#next_key_pos(ddd8539a2fcdd4ce).(); |
| 181 | } |
| 182 | UInt32cxx . . $ grn/dat/UInt32# key_buf_sizecxx . . $ grn/dat/Trie#key_buf_size(ddd8539a2fcdd4ce).() const { |
| 183 | return header_cxx . . $ grn/dat/Trie#header_.->key_buf_sizecxx . . $ grn/dat/Header#key_buf_size(ddd8539a2fcdd4ce).(); |
| 184 | } |
| 185 | UInt32cxx . . $ grn/dat/UInt32# status_flagscxx . . $ grn/dat/Trie#status_flags(ddd8539a2fcdd4ce).() const { |
| 186 | return header_cxx . . $ grn/dat/Trie#header_.->status_flagscxx . . $ grn/dat/Header#status_flags(ddd8539a2fcdd4ce).(); |
| 187 | } |
| 188 | |
| 189 | bool is_changingcxx . . $ grn/dat/Trie#is_changing(c9857a73d68e59ba).() { |
| 190 | return (status_flagscxx . . $ grn/dat/Trie#status_flags(ddd8539a2fcdd4ce).() & CHANGING_MASKcxx . . $ grn/dat/CHANGING_MASK.) == 0; |
| 191 | } |
| 192 | void clear_status_flagscxx . . $ grn/dat/Trie#clear_status_flags(49f6e7a06ebc5aa8).() { |
| 193 | header_cxx . . $ grn/dat/Trie#header_.->set_status_flagscxx . . $ grn/dat/Header#set_status_flags(cb2f890c2fdad230).(status_flagscxx . . $ grn/dat/Trie#status_flags(ddd8539a2fcdd4ce).() & ~CHANGING_MASKcxx . . $ grn/dat/CHANGING_MASK.); |
| 194 | } |
| 195 | |
| 196 | void flushcxx . . $ grn/dat/Trie#flush(49f6e7a06ebc5aa8).(); |
| 197 | |
| 198 | private: |
| 199 | Filecxx . . $ grn/dat/File# file_cxx . . $ grn/dat/Trie#file_.; |
| 200 | Headercxx . . $ grn/dat/Header# *header_cxx . . $ grn/dat/Trie#header_.; |
| 201 | Arraycxx . . $ grn/dat/Array#<Nodecxx . . $ grn/dat/Node#> nodes_cxx . . $ grn/dat/Trie#nodes_.; |
| 202 | Arraycxx . . $ grn/dat/Array#<Blockcxx . . $ grn/dat/Block#> blocks_cxx . . $ grn/dat/Trie#blocks_.; |
| 203 | Arraycxx . . $ grn/dat/Array#<Entrycxx . . $ grn/dat/Entry#> entries_cxx . . $ grn/dat/Trie#entries_.; |
| 204 | Arraycxx . . $ grn/dat/Array#<UInt32cxx . . $ grn/dat/UInt32#> key_buf_cxx . . $ grn/dat/Trie#key_buf_.; |
| 205 | |
| 206 | void create_filecxx . . $ grn/dat/Trie#create_file(effadf6d9e160e1f).(const char *file_name, |
| 207 | UInt64cxx . . $ grn/dat/UInt64# file_size, |
| 208 | UInt32cxx . . $ grn/dat/UInt32# max_num_keys, |
| 209 | double num_nodes_per_key, |
| 210 | double average_key_length); |
| 211 | void create_filecxx . . $ grn/dat/Trie#create_file(9790cea5b3a5c247).(const char *file_name, |
| 212 | UInt64cxx . . $ grn/dat/UInt64# file_size, |
| 213 | UInt32cxx . . $ grn/dat/UInt32# max_num_keys, |
| 214 | UInt32cxx . . $ grn/dat/UInt32# max_num_blocks, |
| 215 | UInt32cxx . . $ grn/dat/UInt32# key_buf_size); |
| 216 | |
| 217 | void open_filecxx . . $ grn/dat/Trie#open_file(85c52e162fed56f9).(const char *file_name); |
| 218 | |
| 219 | void map_addresscxx . . $ grn/dat/Trie#map_address(5d22bdacc48458e8).(void *address); |
| 220 | |
| 221 | void build_from_triecxx . . $ grn/dat/Trie#build_from_trie(47c3eab575beacb0).(const Triecxx . . $ grn/dat/Trie# &trie); |
| 222 | void build_from_triecxx . . $ grn/dat/Trie#build_from_trie(a88efb538d233dc2).(const Triecxx . . $ grn/dat/Trie# &trie, UInt32cxx . . $ grn/dat/UInt32# src, UInt32cxx . . $ grn/dat/UInt32# dest); |
| 223 | |
| 224 | void repair_triecxx . . $ grn/dat/Trie#repair_trie(47c3eab575beacb0).(const Triecxx . . $ grn/dat/Trie# &trie); |
| 225 | void build_from_keyscxx . . $ grn/dat/Trie#build_from_keys(4517b282e5acf643).(const UInt32cxx . . $ grn/dat/UInt32# *begin, const UInt32cxx . . $ grn/dat/UInt32# *end, |
| 226 | UInt32cxx . . $ grn/dat/UInt32# depth, UInt32cxx . . $ grn/dat/UInt32# node_id); |
| 227 | |
| 228 | void mkq_sortcxx . . $ grn/dat/Trie#mkq_sort(1b48257950641a0d).(UInt32cxx . . $ grn/dat/UInt32# *l, UInt32cxx . . $ grn/dat/UInt32# *r, UInt32cxx . . $ grn/dat/UInt32# depth); |
| 229 | void insertion_sortcxx . . $ grn/dat/Trie#insertion_sort(1b48257950641a0d).(UInt32cxx . . $ grn/dat/UInt32# *l, UInt32cxx . . $ grn/dat/UInt32# *r, UInt32cxx . . $ grn/dat/UInt32# depth); |
| 230 | |
| 231 | inline int get_labelcxx . . $ grn/dat/Trie#get_label(f3c4abd0428a43c1).(UInt32cxx . . $ grn/dat/UInt32# key_id, UInt32cxx . . $ grn/dat/UInt32# depth) const; |
| 232 | inline int get_mediancxx . . $ grn/dat/Trie#get_median(63a5c3b276ccf2c0).(UInt32cxx . . $ grn/dat/UInt32# a, UInt32cxx . . $ grn/dat/UInt32# b, UInt32cxx . . $ grn/dat/UInt32# c, UInt32cxx . . $ grn/dat/UInt32# depth) const; |
| 233 | inline bool less_thancxx . . $ grn/dat/Trie#less_than(971ac2092be9c647).(UInt32cxx . . $ grn/dat/UInt32# lhs, UInt32cxx . . $ grn/dat/UInt32# rhs, UInt32cxx . . $ grn/dat/UInt32# depth) const; |
| 234 | inline static void swap_idscxx . . $ grn/dat/Trie#swap_ids(ce04c39653c001b6).(UInt32cxx . . $ grn/dat/UInt32# *lhs, UInt32cxx . . $ grn/dat/UInt32# *rhs); |
| 235 | |
| 236 | bool search_keycxx . . $ grn/dat/Trie#search_key(6e3e087186c1b682).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# *key_pos) const; |
| 237 | bool search_linkercxx . . $ grn/dat/Trie#search_linker(fcb4dcaf17b413c9).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 238 | UInt32cxx . . $ grn/dat/UInt32# &node_id, UInt32cxx . . $ grn/dat/UInt32# &query_pos) const; |
| 239 | |
| 240 | bool lcp_search_keycxx . . $ grn/dat/Trie#lcp_search_key(6e3e087186c1b682).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# *key_pos) const; |
| 241 | |
| 242 | bool remove_keycxx . . $ grn/dat/Trie#remove_key(41ee87f0602ae969).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length); |
| 243 | |
| 244 | bool insert_keycxx . . $ grn/dat/Trie#insert_key(72b38b1922c13078).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# *key_pos); |
| 245 | bool insert_linkercxx . . $ grn/dat/Trie#insert_linker(4a6d4260483f12ab).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 246 | UInt32cxx . . $ grn/dat/UInt32# &node_id, UInt32cxx . . $ grn/dat/UInt32# query_pos); |
| 247 | |
| 248 | bool update_keycxx . . $ grn/dat/Trie#update_key(e88d0583c9a0e46c).(const Keycxx . . $ grn/dat/Key# &key, const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 249 | UInt32cxx . . $ grn/dat/UInt32# *key_pos); |
| 250 | |
| 251 | UInt32cxx . . $ grn/dat/UInt32# insert_nodecxx . . $ grn/dat/Trie#insert_node(d18a354f71bab922).(UInt32cxx . . $ grn/dat/UInt32# node_id, UInt16cxx . . $ grn/dat/UInt16# label); |
| 252 | UInt32cxx . . $ grn/dat/UInt32# append_keycxx . . $ grn/dat/Trie#append_key(173b885284429e69).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, UInt32cxx . . $ grn/dat/UInt32# key_id); |
| 253 | |
| 254 | UInt32cxx . . $ grn/dat/UInt32# separatecxx . . $ grn/dat/Trie#separate(16fef09ca7e23a84).(const UInt8cxx . . $ grn/dat/UInt8# *ptr, UInt32cxx . . $ grn/dat/UInt32# length, |
| 255 | UInt32cxx . . $ grn/dat/UInt32# node_id, UInt32cxx . . $ grn/dat/UInt32# i); |
| 256 | void resolvecxx . . $ grn/dat/Trie#resolve(272d193675e92631).(UInt32cxx . . $ grn/dat/UInt32# node_id, UInt16cxx . . $ grn/dat/UInt16# label); |
| 257 | void migrate_nodescxx . . $ grn/dat/Trie#migrate_nodes(5a50487d8a975787).(UInt32cxx . . $ grn/dat/UInt32# node_id, UInt32cxx . . $ grn/dat/UInt32# dest_offset, |
| 258 | const UInt16cxx . . $ grn/dat/UInt16# *labels, UInt32cxx . . $ grn/dat/UInt32# num_labels); |
| 259 | |
| 260 | UInt32cxx . . $ grn/dat/UInt32# find_offsetcxx . . $ grn/dat/Trie#find_offset(d1a687133290a15f).(const UInt16cxx . . $ grn/dat/UInt16# *labels, UInt32cxx . . $ grn/dat/UInt32# num_labels); |
| 261 | |
| 262 | void reserve_nodecxx . . $ grn/dat/Trie#reserve_node(cb2f890c2fdad230).(UInt32cxx . . $ grn/dat/UInt32# node_id); |
| 263 | void reserve_blockcxx . . $ grn/dat/Trie#reserve_block(cb2f890c2fdad230).(UInt32cxx . . $ grn/dat/UInt32# block_id); |
| 264 | |
| 265 | void update_block_levelcxx . . $ grn/dat/Trie#update_block_level(b4d55b1286ff73e8).(UInt32cxx . . $ grn/dat/UInt32# block_id, UInt32cxx . . $ grn/dat/UInt32# level); |
| 266 | void set_block_levelcxx . . $ grn/dat/Trie#set_block_level(b4d55b1286ff73e8).(UInt32cxx . . $ grn/dat/UInt32# block_id, UInt32cxx . . $ grn/dat/UInt32# level); |
| 267 | void unset_block_levelcxx . . $ grn/dat/Trie#unset_block_level(cb2f890c2fdad230).(UInt32cxx . . $ grn/dat/UInt32# block_id); |
| 268 | |
| 269 | Nodecxx . . $ grn/dat/Node# &ith_nodecxx . . $ grn/dat/Trie#ith_node(945db613494e192f).(UInt32cxx . . $ grn/dat/UInt32# i) { |
| 270 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i >= num_nodes()); |
| 271 | return nodes_cxx . . $ grn/dat/Trie#nodes_.[cxx . . $ grn/dat/Array#`operator[]`(cbb7c2c208bf2972).i]; |
| 272 | } |
| 273 | Blockcxx . . $ grn/dat/Block# &ith_blockcxx . . $ grn/dat/Trie#ith_block(95549d8a1402ec44).(UInt32cxx . . $ grn/dat/UInt32# i) { |
| 274 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i >= num_blocks()); |
| 275 | return blocks_cxx . . $ grn/dat/Trie#blocks_.[cxx . . $ grn/dat/Array#`operator[]`(cbb7c2c208bf2972).i]; |
| 276 | } |
| 277 | Entrycxx . . $ grn/dat/Entry# &ith_entrycxx . . $ grn/dat/Trie#ith_entry(23ff61182d9f5125).(UInt32cxx . . $ grn/dat/UInt32# i) { |
| 278 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i < min_key_id()); |
| 279 | GRN_DAT_DEBUG_THROW_IFcxx . . $ `lib/dat/dat.hpp:242:10`!(i > (max_key_id() + 1)); |
| 280 | return entries_cxx . . $ grn/dat/Trie#entries_.[cxx . . $ grn/dat/Array#`operator[]`(cbb7c2c208bf2972).i]; |
| 281 | } |
| 282 | |
| 283 | // Disallows copy and assignment. |
| 284 | Triecxx . . $ grn/dat/Trie#Trie(47c3eab575beacb0).(const Triecxx . . $ grn/dat/Trie# &); |
| 285 | Triecxx . . $ grn/dat/Trie# &operatorcxx . . $ grn/dat/Trie#`operator=`(8362e5fa6c35e643).=(const Triecxx . . $ grn/dat/Trie# &); |
| 286 | }; |
| 287 | |
| 288 | } // namespace dat |
| 289 | } // namespace grn |