BinaryTree  HW 06
Spell Checking Using Binary Trees
 All Classes Files Functions Variables Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TreeStringSet::Iterator Class Reference

Public Types

using value_type = int
 
using reference = value_type &
 
using pointer = value_type *
 
using difference_type = ptrdiff_t
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 Iterator (const Iterator &)=default
 
Iteratoroperator= (const Iterator &)=default
 
Iteratoroperator++ ()
 Increments an iterator. More...
 
string & operator* () const
 Derefences an iterator. More...
 
bool operator== (const Iterator &rhs) const
 Determines if iterators are equal. More...
 
bool operator!= (const Iterator &rhs) const
 Determines if iterators are not equal. Uses the == operator. More...
 
void iterHelper (Element *&elem, queue< Element * > &order)
 Helper for iterator constructor. Recursively adds element adresses to the queue. More...
 

Private Member Functions

 Iterator (Element *current)
 Friends create non-default iterators. More...
 

Private Attributes

Elementcurrent_
 Pointer to current element.
 
queue< Element * > order_
 Queue holding the addresses of the elements.
 

Friends

class TreeStringSet
 

Constructor & Destructor Documentation

TreeStringSet::Iterator::Iterator ( Element current)
private

Friends create non-default iterators.

Creates an iterator.

Returns
Constructor does not return anything, but creates the Iterator.
Parameters
currentPointer to the element the iterator should be created at.

Member Function Documentation

void TreeStringSet::iterator::iterHelper ( Element *&  elem,
queue< Element * > &  order_ 
)

Helper for iterator constructor. Recursively adds element adresses to the queue.

Parameters
elemReference to an element pointer at which the function starts
order_Queue holding addresses
bool TreeStringSet::Iterator::operator!= ( const Iterator rhs) const

Determines if iterators are not equal. Uses the == operator.

Returns
True if iterators are not equal, false else.
Parameters
rhsIterator for comparison
string & TreeStringSet::Iterator::operator* ( ) const

Derefences an iterator.

Returns
The string value of the current iterator
TreeStringSet::Iterator & TreeStringSet::Iterator::operator++ ( )

Increments an iterator.

Returns
Reference to an iterator incremented by one
bool TreeStringSet::Iterator::operator== ( const Iterator rhs) const

Determines if iterators are equal.

Returns
True if iterators are equal, false else.
Parameters
rhsIterator for comparison

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