|
libyui-ncurses
2.57.2
|
Tree node. More...
#include <tnode.h>
Public Member Functions | |
| tnode (n_value v, self *p=0, bool behind=true) | |
| New node, added as the last child by default (which is natural). More... | |
| tnode (n_value v, self &p, bool behind=true) | |
| New node, added as the last child by default (which is natural). More... | |
| tnode (n_value v, self &p, self &s, bool behind=true) | |
| New node under p, just after s (or before s if behind==false) More... | |
| void | Disconnect () |
| Disconnect from the parent and siblings, but keep children. | |
| bool | ReparentTo (self &p, bool behind=true) |
| Disconnect from old parent, connect to new parent p. More... | |
| bool | ReparentTo (self &p, self &s, bool behind=true) |
| Disconnect from old parent, connect to new parent p and sibling s. More... | |
| n_value & | Value () const |
| n_value & | operator() () const |
| Alias for Value. | |
| self * | Parent () |
| const self * | Parent () const |
| self * | Psibling () |
| Previous sibling. | |
| const self * | Psibling () const |
| Previous sibling. | |
| self * | Nsibling () |
| Next sibling. | |
| const self * | Nsibling () const |
| Next sibling. | |
| self * | Fchild () |
| First child. | |
| const self * | Fchild () const |
| First child. | |
| self * | Lchild () |
| Last child. | |
| const self * | Lchild () const |
| Last child. | |
| bool | HasParent () const |
| bool | HasSiblings () const |
| bool | HasChildren () const |
| bool | IsParentOf (const self &c) const |
| bool | IsSiblingOf (const self &s) const |
| bool | IsChildOf (const self &p) const |
| unsigned | Depth () const |
| Depth: zero if no parent, otherwise 1 + parent's depth. | |
| bool | IsDescendantOf (const self &n) const |
| bool | IsDescendantOf (const self *n) const |
| self & | Top () |
| Root of the tree. | |
| self * | Next (bool restart=false) |
| Next node: depth first, pre-order. More... | |
| self * | Prev (bool restart=false) |
| self * | Next (self *&c, bool restart=false) |
| Return Next and assign it to c. | |
| self * | Prev (self *&c, bool restart=false) |
| Return Prev and assign it to c. | |
| const self & | Top () const |
| const self * | Next (bool restart=false) const |
| const self * | Prev (bool restart=false) const |
| const self * | Next (const self *&c, bool restart=false) const |
| const self * | Prev (const self *&c, bool restart=false) const |
Protected Types | |
| typedef tnode< n_value > | self |
Protected Member Functions | |
| virtual void | PreDisconnect () |
| virtual void | PostDisconnect () |
| virtual void | PreReparent () |
| virtual void | PostReparent () |
Protected Attributes | |
| n_value | val |
Tree node.
Traversing the tree with Next and Prev is done pre-order (self before children) and depth-first (children before siblings)
See also
In practice all instances of this template use NCWidget * for n_value.
|
inline |
Disconnect from old parent, connect to new parent p and sibling s.
Insert this as just after s (or just before, if behind==false).
In case s is not in fact a child of p then we become p's last (first) child.
| p | new parent |
| s | reference sibling |
| behind | true: insert after s; false: insert before s |