libwordring
|
basic_trie のイテレータ [詳解]
#include <trie_iterator.hpp>
公開型 | |
using | difference_type = std::ptrdiff_t |
using | value_type = Label |
using | pointer = value_type * |
using | reference = value_type & |
using | iterator_category = std::input_iterator_tag |
公開メンバ関数 | |
value_type | operator* () const |
const_trie_iterator | operator[] (value_type label) const |
ラベルで遷移できる子を返す [詳解] | |
const_trie_iterator & | operator++ () |
const_trie_iterator | operator++ (int) |
template<typename String > | |
void | string (String &result) const |
根からイテレータが指すノードまでのラベル列を返す [詳解] | |
const_trie_iterator | parent () const |
親を取得する [詳解] | |
const_trie_iterator | begin () const |
const_trie_iterator | end () const |
静的公開変数類 | |
static constexpr std::uint16_t | null_value = 256u |
static constexpr std::uint32_t | coefficient = sizeof(value_type) / sizeof(typename base_type::value_type) |
限定公開型 | |
using | base_type = Base |
using | unsigned_type = std::make_unsigned_t< Label > |
限定公開メンバ関数 | |
const_trie_iterator (container &c, index_type index) | |
const_trie_iterator (base_type const &it) | |
フレンド | |
template<typename Label1 , typename Base1 > | |
class | wordring::basic_trie |
template<typename Label1 , typename Base1 > | |
bool | operator== (const_trie_iterator< Label1, Base1 > const &, const_trie_iterator< Label1, Base1 > const &) |
template<typename Label1 , typename Base1 > | |
bool | operator!= (const_trie_iterator< Label1, Base1 > const &, const_trie_iterator< Label1, Base1 > const &) |
basic_trie のイテレータ
Label | ラベルとして使用する任意の整数型 |
Base | 元となる trie_base::const_iterator あるいは stable_trie_base::const_iterator |
ダブル・アレイのイテレータを任意の整数型に拡張する。
バイト単位の遷移から複数バイト単位の遷移にするために、いくつかのアルゴリズムを実装する。
|
inline |
ラベルで遷移できる子を返す
[in] | label | 遷移ラベル |
イテレータを使ってノード間を移動する場合、この関数と parent() が最速。 operator++() は若干の探索が発生する。
|
inline |
根からイテレータが指すノードまでのラベル列を返す
[out] | result | ラベル列を出力する先のコンテナ |
出力先を使いまわすために引数でコンテナへの参照を受け取るよう設計した。 コンテナはBidirectionalIteratorを持つ必要がある。
|
inline |
親を取得する