WvStreams
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
UniWatchInfoTree Class Reference
Inheritance diagram for UniWatchInfoTree:
Inheritance graph
[legend]

List of all members.

Public Types

typedef wv::function< void(const
UniWatchInfoTree *, void *) 
Visitor )
typedef wv::function< bool(const
UniWatchInfoTree *, const
UniWatchInfoTree *) 
Comparator )

Public Member Functions

 UniWatchInfoTree (UniWatchInfoTree *parent, const UniConfKey &key=UniConfKey::EMPTY)
bool isessential ()
 Returns true if the node should not be pruned.
UniWatchInfoTreeparent () const
 Returns a pointer to the parent node, or NULL if there is none.
void setparent (UniWatchInfoTree *parent)
 Reparents this node.
UniWatchInfoTreeroot () const
 Returns a pointer to the root node of the tree.
UniConfKey fullkey (const UniWatchInfoTree *ancestor=NULL) const
 Returns full path of this node relative to an ancestor.
UniWatchInfoTreefind (const UniConfKey &key) const
 Finds the sub-node with the specified key.
UniWatchInfoTreefindchild (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 UniWatchInfoTree *other, const Comparator &comparator)
 Compares this tree with another using the specified comparator function.
const UniConfKeykey () const
 Returns the key field.
bool haschildren () const
 Returns true if the node has children.

Public Attributes

UniWatchInfoList watches

Protected Types

typedef WvScatterHash
< UniHashTreeBase, UniConfKey,
Accessor
Container
typedef UniHashTreeBaseVisitor BaseVisitor
typedef UniHashTreeBaseComparator BaseComparator

Protected Member Functions

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)
static void _recursive_unsorted_visit (const UniHashTreeBase *a, const UniHashTreeBaseVisitor &visitor, void *userdata, bool preorder, bool postorder)

Protected Attributes

UniHashTreeBasexparent
Containerxchildren

Friends

class Iter

Detailed Description

Definition at line 48 of file uniconfroot.h.


Member Function Documentation

bool UniWatchInfoTree::isessential ( ) [inline]

Returns true if the node should not be pruned.

Definition at line 58 of file uniconfroot.h.

References UniHashTreeBase::haschildren().

UniWatchInfoTree * UniConfTree< UniWatchInfoTree >::parent ( ) const [inline, inherited]

Returns a pointer to the parent node, or NULL if there is none.

Definition at line 40 of file uniconftree.h.

void UniConfTree< UniWatchInfoTree >::setparent ( UniWatchInfoTree parent) [inline, inherited]

Reparents this node.

Definition at line 44 of file uniconftree.h.

UniWatchInfoTree * UniConfTree< UniWatchInfoTree >::root ( ) const [inline, inherited]

Returns a pointer to the root node of the tree.

Definition at line 48 of file uniconftree.h.

UniConfKey UniConfTree< UniWatchInfoTree >::fullkey ( const UniWatchInfoTree 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 55 of file uniconftree.h.

UniWatchInfoTree * UniConfTree< UniWatchInfoTree >::find ( const UniConfKey key) const [inline, inherited]

Finds the sub-node with the specified key.

If key.isempty(), returns this node.

Definition at line 62 of file uniconftree.h.

UniWatchInfoTree * UniConfTree< UniWatchInfoTree >::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 71 of file uniconftree.h.

void UniConfTree< UniWatchInfoTree >::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 80 of file uniconftree.h.

void UniConfTree< UniWatchInfoTree >::zap ( ) [inline, inherited]

Removes and deletes all children of this node.

Definition at line 84 of file uniconftree.h.

void UniConfTree< UniWatchInfoTree >::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 108 of file uniconftree.h.

bool UniConfTree< UniWatchInfoTree >::compare ( const UniWatchInfoTree other,
const Comparator &  comparator 
) [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 124 of file uniconftree.h.

const UniConfKey& UniHashTreeBase::key ( ) const [inline, inherited]

Returns the key field.

Definition at line 40 of file unihashtree.h.

Referenced by UniConfTree< UniConfChangeTree >::remove(), and UniTransactionGen::setv().

bool UniHashTreeBase::haschildren ( ) const [inherited]

Returns true if the node has children.

Definition at line 114 of file unihashtree.cc.

References UniHashTreeBase::xchildren.

Referenced by UniTempGen::haschildren(), and isessential().


Member Data Documentation

UniHashTreeBase* UniHashTreeBase::xparent [protected, inherited]

the parent of this subtree

Definition at line 62 of file unihashtree.h.

Referenced by UniConfTree< UniConfChangeTree >::parent().

Container* UniHashTreeBase::xchildren [protected, inherited]

the hash table of children

Definition at line 63 of file unihashtree.h.

Referenced by UniHashTreeBase::haschildren(), and UniConfTree< UniConfChangeTree >::zap().


The documentation for this class was generated from the following file: