BFLibCPP 0.1
CPP Library
Loading...
Searching...
No Matches
BF::BinTree< T, S >::Iterator Class Reference

#include <bintree.hpp>

Inheritance diagram for BF::BinTree< T, S >::Iterator:
Collaboration diagram for BF::BinTree< T, S >::Iterator:

Public Member Functions

virtual ~Iterator ()
 
current ()
 
int next ()
 
bool finished ()
 
- Public Member Functions inherited from BF::Object
 Object ()
 
 Object (Object &obj)
 
virtual ~Object ()
 

Protected Member Functions

virtual int setCurrent (BinNode *node)
 
 Iterator ()
 

Protected Attributes

Stack< BinNode * > _st
 

Friends

class BinTree< T, S >
 

Additional Inherited Members

- Static Public Member Functions inherited from BF::Object
static void retain (Object *obj)
 
static void release (Object *obj)
 
static int retainCount (Object *obj)
 
static int retainCount (Object &obj)
 

Detailed Description

template<typename T, typename S = int>
class BF::BinTree< T, S >::Iterator

Iterates through the nodes in tree to return their objects

https://www.geeksforgeeks.org/implementing-forward-iterator-in-bst/

Constructor & Destructor Documentation

◆ ~Iterator()

template<typename T , typename S = int>
virtual BF::BinTree< T, S >::Iterator::~Iterator ( )
inlinevirtual

◆ Iterator()

template<typename T , typename S = int>
BF::BinTree< T, S >::Iterator::Iterator ( )
inlineprotected

Member Function Documentation

◆ current()

template<typename T , typename S = int>
T BF::BinTree< T, S >::Iterator::current ( )
inline

Returns current object

◆ finished()

template<typename T , typename S = int>
bool BF::BinTree< T, S >::Iterator::finished ( )
inline

If we have no more nodes to traverse

◆ next()

template<typename T , typename S = int>
int BF::BinTree< T, S >::Iterator::next ( )
inline

Goes to the next node in tree

Should I implement a descending iterator?

Here is the call graph for this function:

◆ setCurrent()

template<typename T , typename S = int>
virtual int BF::BinTree< T, S >::Iterator::setCurrent ( BinNode * node)
inlineprotectedvirtual

Sets stack to every node's left child

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ BinTree< T, S >

template<typename T , typename S = int>
friend class BinTree< T, S >
friend

Member Data Documentation

◆ _st

template<typename T , typename S = int>
Stack<BinNode *> BF::BinTree< T, S >::Iterator::_st
protected

Assists the iterations


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