#include <tnode.h>
|
| tnode (n_value v, self *p=0, bool behind=true) |
|
| tnode (n_value v, self &p, bool behind=true) |
|
| tnode (n_value v, self &p, self &s, bool behind=true) |
|
void | Disconnect () |
| Disconnect from the parent and siblings, but keep children.
|
|
bool | ReparentTo (self &p, bool behind=true) |
|
bool | ReparentTo (self &p, self &s, bool behind=true) |
|
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) |
|
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 |
|
|
typedef tnode< n_value > | self |
|
|
virtual void | PreDisconnect () |
|
virtual void | PostDisconnect () |
|
virtual void | PreReparent () |
|
virtual void | PostReparent () |
|
template<class n_value>
class tnode< n_value >
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.
◆ tnode() [1/3]
template<class n_value >
tnode< n_value >::tnode |
( |
n_value | v, |
|
|
self * | p = 0, |
|
|
bool | behind = true ) |
|
inline |
New node, added as the last child by default (which is natural).
- Parameters
-
◆ tnode() [2/3]
template<class n_value >
tnode< n_value >::tnode |
( |
n_value | v, |
|
|
self & | p, |
|
|
bool | behind = true ) |
|
inline |
New node, added as the last child by default (which is natural).
- Parameters
-
◆ tnode() [3/3]
template<class n_value >
tnode< n_value >::tnode |
( |
n_value | v, |
|
|
self & | p, |
|
|
self & | s, |
|
|
bool | behind = true ) |
|
inline |
New node under p, just after s (or before s if behind==false)
- Parameters
-
p | parent |
s | reference sibling |
◆ Next()
template<class n_value >
self * tnode< n_value >::Next |
( |
bool | restart = false | ) |
|
|
inline |
Next node: depth first, pre-order.
- Parameters
-
restart | if true, the last node's Next is the first (Top); otherwise nilptr. |
◆ ReparentTo() [1/2]
template<class n_value >
bool tnode< n_value >::ReparentTo |
( |
self & | p, |
|
|
bool | behind = true ) |
|
inline |
Disconnect from old parent, connect to new parent p. Become the last child (or the first, if behind==false).
- Parameters
-
- Returns
- true on success; false on failure (p is myself or a descendant of mine)
◆ ReparentTo() [2/2]
template<class n_value >
bool tnode< n_value >::ReparentTo |
( |
self & | p, |
|
|
self & | s, |
|
|
bool | behind = true ) |
|
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.
- Parameters
-
p | new parent |
s | reference sibling |
behind | true: insert after s; false: insert before s |
- Returns
- true on success; false on failure (p is myself or a descendant of mine)
The documentation for this class was generated from the following file:
- /builddir/build/BUILD/libyui-4.6.0/libyui-ncurses/src/tnode.h