A method for tracing a route from a tree's root to a particular node. More...
#include <path.h>


Public Member Functions | |
| path (const node *root) | |
| the path is relative to the "root" node. | |
| 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. | |
| node * | root () const |
| returns the relative root node for this path. | |
| node * | current () const |
| node * | follow () const |
| Returns the node specified by this path. | |
| node * | pop () |
| returns the top node on the path stack. | |
| basis::outcome | push (node *to_add) |
| puts the node "to_add" on the top of the stack. | |
| basis::outcome | push (int index) |
| indexed push uses the current top node's index'th link as new top. | |
| bool | generate_path (node *to_locate, path &to_follow) const |
| finds the way to get from the root to the "to_locate" node. | |
| node * | operator[] (int index) const |
| returns the node stored at "index", or NIL if "index" is invalid. | |
A method for tracing a route from a tree's root to a particular node.
A path has a starting point at a particular node and a list of links to take from that node to another node. For the path to remain valid, none of the links contained within it may be destroyed.
Definition at line 35 of file path.h.
| nodes::path::path | ( | const node * | root | ) |
| nodes::path::~path | ( | ) |
Definition at line 47 of file path.cpp.
References basis::WHACK().
| node * nodes::path::current | ( | ) | const |
Definition at line 59 of file path.cpp.
Referenced by generate_path(), and nodes::tree::iterator::whack().
| nodes::path::DEFINE_CLASS_NAME | ( | "path" | ) |
| node * nodes::path::follow | ( | ) | const |
| node * nodes::path::operator[] | ( | int | index | ) | const |
| node * nodes::path::pop | ( | ) |
returns the top node on the path stack.
this returns the node at the farthest distance from the relative root node and removes it from this path.
Definition at line 70 of file path.cpp.
References NIL.
Referenced by nodes::tree::iterator::whack(), and nodes::tree::iterator::~iterator().
| outcome nodes::path::push | ( | int | index | ) |
| node * nodes::path::root | ( | ) | const |
| int nodes::path::size | ( | ) | const |
returns the number of items in the path.
Definition at line 55 of file path.cpp.
Referenced by nodes::tree::generate_path(), nodes::symbol_tree::text_form(), nodes::tree::iterator::whack(), and nodes::tree::iterator::~iterator().
1.6.3