Sleipnir
|
Iterator for inorder traversal of trie keys. More...
#include <trie.h>
Public Member Functions | |
CTrieIterator (const CTrieIterator &Iter) | |
Copy constructor. | |
CTrieIterator (const CTrie< tType > &Trie) | |
Construct a new iterator for the given trie. | |
bool | IsDone () const |
Return true if the iterator has completed its traversal. | |
const std::vector< unsigned char > & | GetPosition () const |
Return the key at the current iterator position. | |
const tType & | Get () const |
Return the value at the current iterator position. | |
tType & | Set () const |
Return a writable value at the current iterator position. | |
bool | Next () |
Advance the iterator to the next key/value position. |
Iterator for inorder traversal of trie keys.
tType | Type of element contained by the trie. |
A trie iterator provides inorder access to each key in the trie. Given a trie, a new iterator will subsequently provide read/write access to the value for each key in the dictionary. Sample usage might be:
for( TTrieData::iterator SomeIterator( SomeTrie ); !SomeIterator.IsDone( ); SomeIterator.Next( ) ) {
cout << SomeIterator.Get( ) << endl; }
Sleipnir::CTrieIterator< tType >::CTrieIterator | ( | const CTrieIterator< tType > & | Iter | ) | [inline] |
Sleipnir::CTrieIterator< tType >::CTrieIterator | ( | const CTrie< tType > & | Trie | ) | [inline] |
const tType& Sleipnir::CTrieIterator< tType >::Get | ( | ) | const [inline] |
Return the value at the current iterator position.
Definition at line 307 of file trie.h.
References Sleipnir::CTrieIterator< tType >::Set().
const std::vector<unsigned char>& Sleipnir::CTrieIterator< tType >::GetPosition | ( | ) | const [inline] |
bool Sleipnir::CTrieIterator< tType >::IsDone | ( | ) | const [inline] |
Return true if the iterator has completed its traversal.
Definition at line 282 of file trie.h.
Referenced by Sleipnir::CTrieIterator< tType >::Next().
bool Sleipnir::CTrieIterator< tType >::Next | ( | ) | [inline] |
Advance the iterator to the next key/value position.
Definition at line 335 of file trie.h.
References Sleipnir::CTrieIterator< tType >::IsDone().
tType& Sleipnir::CTrieIterator< tType >::Set | ( | ) | const [inline] |
Return a writable value at the current iterator position.
Definition at line 321 of file trie.h.
Referenced by Sleipnir::CTrieIterator< tType >::Get().