xorp

TriePostOrderIterator< A, Payload > Class Template Reference

Postorder Iterator on a trie. More...

#include <trie.hh>

List of all members.

Public Types

typedef IPNet< A > Key
typedef TrieNode< A, Payload > Node

Public Member Functions

 TriePostOrderIterator ()
 Constructors.
 TriePostOrderIterator (Node *n)
 constructor for exact searches: both the current node and the search key are taken from n, so the iterator will only loop once.
 TriePostOrderIterator (Node *n, const Key &k)
 construct for subtree scanning: the root key is set explicitly, and the current node is set according to the search order.
TriePostOrderIteratorbegin ()
 move to the starting position according to the visiting order
TriePostOrderIterator operator++ (int)
 Postfix increment.
TriePostOrderIteratoroperator++ ()
 Prefix increment.
Nodecur () const
bool operator== (const TriePostOrderIterator &x) const
bool has_payload () const
Payload & payload ()
const Keykey () const

Private Member Functions

bool node_is_left (Node *n) const
void next ()

Private Attributes

Node_cur
Key _root

Detailed Description

template<class A, class Payload>
class TriePostOrderIterator< A, Payload >

Postorder 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 skips over empty nodes, and visits the subtree in depth-first, left-to-right order. The keys returned by this iterator are not sorted by prefix length.


Member Function Documentation

template<class A, class Payload>
TriePostOrderIterator TriePostOrderIterator< A, Payload >::operator++ ( int  ) [inline]

Postfix increment.

Updates position of iterator in tree.

Returns:
position of iterator before increment.
template<class A, class Payload>
TriePostOrderIterator& TriePostOrderIterator< A, Payload >::operator++ ( ) [inline]

Prefix increment.

Updates position of iterator in tree.

Returns:
position of iterator after increment.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations