feisty meow concerns codebase
2.140
|
#include <tree.h>
Public Member Functions | |
iterator (const tree *initial, traversal_directions direction) | |
~iterator () | |
tree * | next () |
Returns a pointer to the next tree in the direction of traversal. More... | |
void | whack (tree *to_whack) |
destroys the tree "to_whack". More... | |
Public Member Functions inherited from nodes::path | |
path (const node *root) | |
the path is relative to the "root" node. More... | |
path (const path &to_copy) | |
~path () | |
DEFINE_CLASS_NAME ("path") | |
path & | operator= (const path &to_copy) |
int | size () const |
returns the number of items in the path. More... | |
node * | root () const |
returns the relative root node for this path. More... | |
node * | current () const |
node * | follow () const |
Returns the node specified by this path. More... | |
node * | pop () |
returns the top node on the path stack. More... | |
basis::outcome | push (node *to_add) |
puts the node "to_add" on the top of the stack. More... | |
basis::outcome | push (int index) |
indexed push uses the current top node's index'th link as new top. More... | |
bool | generate_path (node *to_locate, path &to_follow) const |
finds the way to get from the root to the "to_locate" node. More... | |
node * | operator[] (int index) const |
returns the node stored at "index", or NULL_POINTER if "index" is invalid. More... | |
Public Member Functions inherited from basis::nameable | |
virtual const char * | class_name () const =0 |
Returns the bare name of this class as a constant character pointer. More... | |
Public Attributes | |
traversal_directions | _order |
elevator_directions | _aim |
nodes::tree::iterator::iterator | ( | const tree * | initial, |
traversal_directions | direction | ||
) |
tree * nodes::tree::iterator::next | ( | ) |
Returns a pointer to the next tree in the direction of traversal.
If the traversal is finished, NULL_POINTER is returned.
Definition at line 257 of file tree.cpp.
References FUNCDEF, and NULL_POINTER.
Referenced by nodes::symbol_tree::text_form().
void nodes::tree::iterator::whack | ( | tree * | to_whack | ) |
destroys the tree "to_whack".
whacks the node "to_whack" by patching this iterator so that future iterations will be correct. it is required that the "to_whack" node was just returned from a call to next(). NOTE: this has only been tested with postfix so far.
Definition at line 221 of file tree.cpp.
References FUNCDEF, LOG, nodes::tree::parent(), nodes::tree::prune(), and basis::WHACK().
elevator_directions nodes::tree::iterator::_aim |
traversal_directions nodes::tree::iterator::_order |