GLAMERDOC++
Gravitational Lensing Code Library
|
A iterator class fore TreeStruct that allows for movement through the tree without changing anything in the tree itself. More...
#include <Tree.h>
Public Member Functions | |
iterator (TreeStruct *tree) | |
Sets the top or root to the top of "tree". | |
iterator (Branch *branch) | |
Sets the root to the input branch so that this will be a subtree in branch is not the real root. | |
iterator (iterator &p) | |
iterator & | operator= (iterator &p) |
iterator & | operator= (Branch *branch) |
Branch * | operator* () |
Returns a pointer to the current Branch. | |
void | movetop () |
bool | up () |
Same as up() | |
bool | brother () |
Move to brother if it exists. | |
bool | down (short child) |
Move to child. | |
bool | atLeaf () |
bool | TreeWalkStep (bool allowDescent) |
step for walking tree by iteration instead of recursion. | |
bool | noChild () |
bool | offEnd () |
bool | IsSquareBranch () |
bool | atTop () |
A iterator class fore TreeStruct that allows for movement through the tree without changing anything in the tree itself.
This class should be able to preform all of the constant movements within the tree without causing any change to the tree.
bool TreeStruct::iterator::TreeWalkStep | ( | bool | allowDescent | ) |
step for walking tree by iteration instead of recursion.
This walk will not exit the tree defined by the descendants of the root that is set in the constructor of TreeIt. If allowed to, it will return to the root and return false. If used again after this it will repeat its walk.
bool TreeStruct::iterator::up | ( | ) |