#include <uniconftree.h>
Inheritance diagram for UniConfTree< Sub, Base >:
Someday this could be further abstracted into a generic WvTreeDict.
"Sub" is the name of the concrete subclass of UniConfTree.
Definition at line 24 of file uniconftree.h.
Public Types | |
typedef WvCallback< void, const Sub *, void * > | Visitor |
typedef WvCallback< bool, const Sub *, const Sub *, void * > | Comparator |
Public Member Functions | |
UniConfTree (Sub *parent, const UniConfKey &key) | |
Creates a node and links it to a subtree, if parent is non-NULL. | |
~UniConfTree () | |
Destroy this node's contents and children. | |
Sub * | parent () const |
Returns a pointer to the parent node, or NULL if there is none. | |
void | setparent (Sub *parent) |
Reparents this node. | |
Sub * | root () const |
Returns a pointer to the root node of the tree. | |
UniConfKey | fullkey (const Sub *ancestor=NULL) const |
Returns full path of this node relative to an ancestor. | |
Sub * | find (const UniConfKey &key) const |
Finds the sub-node with the specified key. | |
Sub * | findchild (const UniConfKey &key) const |
Finds the direct child node with the specified key. | |
void | remove (const UniConfKey &key) |
Removes the node for the specified key from the tree and deletes it along with any of its children. | |
void | zap () |
Removes and deletes all children of this node. | |
void | visit (const Visitor &visitor, void *userdata, bool preorder=true, bool postorder=false) const |
Performs a traversal on this tree using the specified visitor function and traversal type(s). | |
bool | compare (const Sub *other, const Comparator &comparator, void *userdata) |
Compares this tree with another using the specified comparator function. | |
Classes | |
class | Iter |
An iterator that walks over all elements on one level of a UniConfTree. More... |
|
Returns full path of this node relative to an ancestor. If ancestor is NULL, returns the root. Definition at line 56 of file uniconftree.h. Referenced by UniTransactionGen::deletion_visitor(), and UniTempGen::notify_deleted(). |
|
Finds the sub-node with the specified key. If key.isempty(), returns this node. Definition at line 63 of file uniconftree.h. Referenced by UniConfRoot::del_callback(), UniFastRegetGen::gencallback(), UniTransactionGen::get(), UniTempGen::get(), UniFastRegetGen::get(), UniTempGen::haschildren(), UniFastRegetGen::haschildren(), UniTransactionGen::iterator(), UniTempGen::iterator(), UniConfTree< UniConfChangeTree >::remove(), and UniTransactionGen::set_value(). |
|
Finds the direct child node with the specified key. If key.numsegments() == 1, then performs the same task as find(key), but a little faster. Otherwise returns NULL. Definition at line 72 of file uniconftree.h. Referenced by UniConfRoot::add_callback(), UniTransactionGen::apply_values(), UniTransactionGen::gencallback(), UniTransactionGen::get(), and UniTransactionGen::iterator(). |
|
Removes the node for the specified key from the tree and deletes it along with any of its children. If the key is UniConfKey::EMPTY, deletes this object. Definition at line 81 of file uniconftree.h. |
|
Performs a traversal on this tree using the specified visitor function and traversal type(s). "visitor" is the tree visitor function "userdata" is userdata for the tree visitor function Definition at line 109 of file uniconftree.h. Referenced by UniTransactionGen::cancel_changes(), and UniTransactionGen::set_value(). |
|
Compares this tree with another using the specified comparator function. Comparison of a subtree ends when the comparator returns false. "comparator" is the value compare function "userdata" is userdata for the compare function Returns: true if the comparison function returned true each time Definition at line 125 of file uniconftree.h. |