Definition at line 47 of file unitransactiongen.cc.
Public Types | |
typedef WvCallback < void, const UniConfChangeTree *, void * > | Visitor |
typedef WvCallback < bool, const UniConfChangeTree *, const UniConfChangeTree *, void * > | Comparator |
Public Member Functions | |
UniConfChangeTree (UniConfChangeTree *parent, const UniConfKey &key) | |
~UniConfChangeTree () | |
UniConfChangeTree * | parent () const |
Returns a pointer to the parent node, or NULL if there is none. | |
void | setparent (UniConfChangeTree *parent) |
Reparents this node. | |
UniConfChangeTree * | root () const |
Returns a pointer to the root node of the tree. | |
UniConfKey | fullkey (const UniConfChangeTree *ancestor=NULL) const |
Returns full path of this node relative to an ancestor. | |
UniConfChangeTree * | find (const UniConfKey &key) const |
Finds the sub-node with the specified key. | |
UniConfChangeTree * | 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 UniConfChangeTree *other, const Comparator &comparator, void *userdata) |
Compares this tree with another using the specified comparator function. | |
const UniConfKey & | key () const |
Returns the key field. | |
bool | haschildren () const |
Returns true if the node has children. | |
Public Attributes | |
changeMode | mode |
WvString | newvalue |
UniConfValueTree * | newtree |
bool | was_null_or_empty |
Protected Types | |
typedef WvScatterHash < UniHashTreeBase, UniConfKey, Accessor > | Container |
typedef UniHashTreeBaseVisitor | BaseVisitor |
typedef UniHashTreeBaseComparator | BaseComparator |
Protected Member Functions | |
void | _setparent (UniHashTreeBase *parent) |
UniHashTreeBase * | _root () const |
UniConfKey | _fullkey (const UniHashTreeBase *ancestor=NULL) const |
UniHashTreeBase * | _find (const UniConfKey &key) const |
UniHashTreeBase * | _findchild (const UniConfKey &key) const |
Static Protected Member Functions | |
static bool | _recursivecompare (const UniHashTreeBase *a, const UniHashTreeBase *b, const UniHashTreeBaseComparator &comparator, void *userdata) |
static void | _recursive_unsorted_visit (const UniHashTreeBase *a, const UniHashTreeBaseVisitor &visitor, void *userdata, bool preorder, bool postorder) |
Protected Attributes | |
UniConfKey | xkey |
UniHashTreeBase * | xparent |
Container * | xchildren |
Friends | |
class | Iter |
UniConfChangeTree * UniConfTree< UniConfChangeTree , UniHashTreeBase >::parent | ( | ) | const [inline, inherited] |
Returns a pointer to the parent node, or NULL if there is none.
Definition at line 41 of file uniconftree.h.
void UniConfTree< UniConfChangeTree , UniHashTreeBase >::setparent | ( | UniConfChangeTree * | parent | ) | [inline, inherited] |
UniConfChangeTree * UniConfTree< UniConfChangeTree , UniHashTreeBase >::root | ( | ) | const [inline, inherited] |
UniConfKey UniConfTree< UniConfChangeTree , UniHashTreeBase >::fullkey | ( | const UniConfChangeTree * | ancestor = NULL |
) | const [inline, inherited] |
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.
UniConfChangeTree * UniConfTree< UniConfChangeTree , UniHashTreeBase >::find | ( | const UniConfKey & | key | ) | const [inline, inherited] |
Finds the sub-node with the specified key.
If key.isempty(), returns this node.
Definition at line 63 of file uniconftree.h.
UniConfChangeTree * UniConfTree< UniConfChangeTree , UniHashTreeBase >::findchild | ( | const UniConfKey & | key | ) | const [inline, inherited] |
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.
void UniConfTree< UniConfChangeTree , UniHashTreeBase >::remove | ( | const UniConfKey & | key | ) | [inline, inherited] |
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.
References UniConfTree< Sub, Base >::find().
void UniConfTree< UniConfChangeTree , UniHashTreeBase >::zap | ( | ) | [inline, inherited] |
Removes and deletes all children of this node.
Definition at line 85 of file uniconftree.h.
References WvScatterHashBase::IterBase::next(), WvScatterHash< T, K, Accessor, Comparator >::Iter::ptr(), and WvScatterHashBase::IterBase::rewind().
void UniConfTree< UniConfChangeTree , UniHashTreeBase >::visit | ( | const Visitor & | visitor, | |
void * | userdata, | |||
bool | preorder = true , |
|||
bool | postorder = false | |||
) | const [inline, inherited] |
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.
bool UniConfTree< UniConfChangeTree , UniHashTreeBase >::compare | ( | const UniConfChangeTree * | other, | |
const Comparator & | comparator, | |||
void * | userdata | |||
) | [inline, inherited] |
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.
const UniConfKey& UniHashTreeBase::key | ( | ) | const [inline, inherited] |
Returns the key field.
Definition at line 71 of file unihashtree.h.
References UniHashTreeBase::xkey.
Referenced by UniHashTreeBase::_fullkey(), UniHashTreeBase::_recursivecompare(), and UniHashTreeBase::Accessor::get_key().
bool UniHashTreeBase::haschildren | ( | ) | const [inherited] |
Returns true if the node has children.
Definition at line 114 of file unihashtree.cc.
References WvScatterHashBase::isempty(), and UniHashTreeBase::xchildren.
Referenced by UniTempGen::haschildren(), and UniWatchInfoTree::isessential().
UniConfKey UniHashTreeBase::xkey [protected, inherited] |
the name of this entry
Definition at line 26 of file unihashtree.h.
Referenced by UniHashTreeBase::key().
UniHashTreeBase* UniHashTreeBase::xparent [protected, inherited] |
the parent of this subtree
Definition at line 27 of file unihashtree.h.
Referenced by UniHashTreeBase::_fullkey(), UniHashTreeBase::_root(), UniHashTreeBase::_setparent(), UniHashTreeBase::UniHashTreeBase(), and UniHashTreeBase::~UniHashTreeBase().
Container* UniHashTreeBase::xchildren [protected, inherited] |
the hash table of children
Definition at line 38 of file unihashtree.h.
Referenced by UniHashTreeBase::_findchild(), UniHashTreeBase::_recursive_unsorted_visit(), UniHashTreeBase::_recursivecompare(), UniHashTreeBase::haschildren(), UniHashTreeBase::UniHashTreeBase(), and UniHashTreeBase::~UniHashTreeBase().