libwordring
|
プレ・オーダーあるいはレベル・オーダーで木を走査するイテレータ・アダプター [詳解]
#include <wordring/tree/tree_iterator.hpp>
公開メンバ関数 | |
basic_tree_iterator (allocator_type const &alloc=allocator_type()) | |
basic_tree_iterator (base_type const &it, allocator_type const &alloc=allocator_type()) | |
親を指すイテレータを指定して構築する [詳解] | |
basic_tree_iterator (base_type const &first, base_type const &last, allocator_type const &alloc=allocator_type()) | |
basic_tree_iterator (basic_tree_iterator const &)=default | |
basic_tree_iterator (basic_tree_iterator &&)=default | |
basic_tree_iterator & | operator= (basic_tree_iterator const &rhs)=default |
basic_tree_iterator & | operator= (basic_tree_iterator &&rhs)=default |
base_type | base () const |
現在の位置を指す、元となる木のイテレータを返す | |
reference | operator* () const |
要素の逆参照を返す | |
pointer | operator-> () const |
要素の参照を返す | |
basic_tree_iterator & | operator++ () |
イテレータを進める [詳解] | |
base_type | operator++ (int) |
イテレータを進める [詳解] | |
フレンド | |
template<typename Iterator1 , typename Container1 , typename Allocator1 > | |
bool | operator== (basic_tree_iterator< Iterator1, Container1, Allocator1 > const &, basic_tree_iterator< Iterator1, Container1, Allocator1 > const &) |
template<typename Iterator1 , typename Container1 , typename Allocator1 > | |
bool | operator!= (basic_tree_iterator< Iterator1, Container1, Allocator1 > const &, basic_tree_iterator< Iterator1, Container1, Allocator1 > const &) |
プレ・オーダーあるいはレベル・オーダーで木を走査するイテレータ・アダプター
Iterator | ベースとなる木のイテレータ |
Container | detail::tree_iterator_stack あるいは detail::tree_iterator_queue |
Allocator | アロケータ |
プレ・オーダー走査用の tree_iterator とレベル・オーダー走査用の level_order_tree_iterator が事前に定義されている。
このクラスは、道順の調査に、スタックあるいはキューを使う。 従って、コピーのコストは相応に高い。
operator++() によって、走査順に従い次の要素へ移動する。 operator*() によって、指している要素の逆参照を得る。 元となる木のイテレータを得るには、 base() を使う。
走査順のイメージを以下に示す。
※要素についている番号は移動順を示す。
|
inlineexplicit |
親を指すイテレータを指定して構築する
it | 親を指すイテレータ |
alloc | 内部コンテナ用のアロケータ |
親は任意の要素で十分であり、木の根である必要はない。
|
inline |
イテレータを進める
|
inline |