feisty meow concerns codebase
2.140
|
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. 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... | |
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.
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().
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 NULL_POINTER.
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(), and nodes::symbol_tree::text_form().