class TriePreOrderIterator

Preorder Iterator on a trie. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

Preorder Iterator on a trie.

_cur points to the current object, _root contains the search key for root of the subtree we want to scan. The iterator does preorder traversal, that is, current node first, then left then right. This guarantees that keys returned are sorted by prefix length.

typedef IPNet<A> Key

Key

typedef TrieNode<A, Payload> Node

Node

 TriePreOrderIterator ()

TriePreOrderIterator

Constructors

explicit  TriePreOrderIterator (Node *n)

TriePreOrderIterator

constructor for exact searches: both the current node and the search key are taken from n, so the iterator will only loop once.

 TriePreOrderIterator (Node *n, const Key &k)

TriePreOrderIterator

construct for subtree scanning: the root key is set explicitly, and the current node is set according to the search order.

TriePreOrderIterator *  begin ()

begin

move to the starting position according to the visiting order

TriePreOrderIterator  operator ++ (int)

operator ++

Postfix increment

Updates position of iterator in tree.

Returns: position of iterator before increment.

TriePreOrderIterator&  operator ++ ()

operator ++

Prefix increment

Updates position of iterator in tree.

Returns: position of iterator after increment.

Node * cur ()

cur

[const]

bool  operator== (const TriePreOrderIterator & x)

operator==

[const]

bool  has_payload ()

has_payload

[const]

Payload &  payload ()

payload

const Key &  key ()

key

[const]


Generated by: pavlin on possum.icir.org on Wed Aug 2 15:35:43 2006, using kdoc $.