Public Member Functions | List of all members
ObjectTrie< T >::DepthIterator Class Reference

A depth first iterator for the trie. More...

#include <ObjectTrie.hpp>

Collaboration diagram for ObjectTrie< T >::DepthIterator:
[legend]

Public Member Functions

 DepthIterator (const DepthIterator &copy)
 Make a copy of the supplied iterator. More...
 
ObjectTrieNode< T > * getAncestor (size_t level)
 Get a pointer to the nth ancestor of the current node. More...
 
const ObjectTrieNode< T > * getAncestor (size_t level) const
 Get a const pointer to the nth ancestor of the current node. More...
 
void getAncestors (std::vector< const ObjectTrieNode< T > *> &output) const
 Populate the supplied const pointer vector with the node's ancestors and the current node. More...
 
bool operator!= (const DepthIterator &rhs) const
 Compare the current iterator and the supplied iterator for inequality. More...
 
ObjectTrieNode< T > & operator* ()
 Dereference the node pointed to by the iterator. More...
 
const ObjectTrieNode< T > & operator* () const
 Dereference the node pointed to by the iterator. More...
 
DepthIteratoroperator++ ()
 Increment the iterator. More...
 
ObjectTrieNode< T > * operator-> ()
 Dereference the node pointed to by the iterator. More...
 
const ObjectTrieNode< T > * operator-> () const
 Dereference the node pointed to by the iterator. More...
 
DepthIteratoroperator= (const DepthIterator &copy)
 Make a copy of the supplied iterator. More...
 
bool operator== (const DepthIterator &rhs) const
 Compare the current iterator and the supplied iterator for equality. More...
 

Detailed Description

template<typename T>
class Balau::Container::ObjectTrie< T >::DepthIterator

A depth first iterator for the trie.

Constructor & Destructor Documentation

◆ DepthIterator()

DepthIterator ( const DepthIterator copy)
inline

Make a copy of the supplied iterator.

Member Function Documentation

◆ getAncestor() [1/2]

ObjectTrieNode<T>* getAncestor ( size_t  level)
inline

Get a pointer to the nth ancestor of the current node.

Nullptr is returned if such an ancestor does not exist.

Parameters
levelthe ancestor distance
Returns
the ancestor or nullptr if such an ancestor does not exist

◆ getAncestor() [2/2]

const ObjectTrieNode<T>* getAncestor ( size_t  level) const
inline

Get a const pointer to the nth ancestor of the current node.

Nullptr is returned if such an ancestor does not exist.

Parameters
levelthe ancestor distance
Returns
the ancestor or nullptr if such an ancestor does not exist

◆ getAncestors()

void getAncestors ( std::vector< const ObjectTrieNode< T > *> &  output) const
inline

Populate the supplied const pointer vector with the node's ancestors and the current node.

Returns
a const pointer vector to the node's ancestors and the current node

◆ operator!=()

bool operator!= ( const DepthIterator rhs) const
inline

Compare the current iterator and the supplied iterator for inequality.

◆ operator*() [1/2]

ObjectTrieNode<T>& operator* ( )
inline

Dereference the node pointed to by the iterator.

◆ operator*() [2/2]

const ObjectTrieNode<T>& operator* ( ) const
inline

Dereference the node pointed to by the iterator.

◆ operator++()

DepthIterator& operator++ ( )
inline

Increment the iterator.

◆ operator->() [1/2]

ObjectTrieNode<T>* operator-> ( )
inline

Dereference the node pointed to by the iterator.

◆ operator->() [2/2]

const ObjectTrieNode<T>* operator-> ( ) const
inline

Dereference the node pointed to by the iterator.

◆ operator=()

DepthIterator& operator= ( const DepthIterator copy)
inline

Make a copy of the supplied iterator.

◆ operator==()

bool operator== ( const DepthIterator rhs) const
inline

Compare the current iterator and the supplied iterator for equality.


The documentation for this class was generated from the following file: