GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
TreeStruct::iterator Class Reference

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)
 
iteratoroperator= (iterator &p)
 
iteratoroperator= (Branch *branch)
 
Branchoperator* ()
 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 ()
 

Detailed Description

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.

Member Function Documentation

◆ TreeWalkStep()

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.

◆ up()

bool TreeStruct::iterator::up ( )

Same as up()

Move up to the parent of current branch if current in not the root. Otherwise returns false.

Same as up()


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