Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

UniMountTree Class Reference

#include <unimounttreegen.h>

Inheritance diagram for UniMountTree:

Inheritance graph
[legend]
List of all members.

Detailed Description

Used by UniMountTreeGen to maintain information about mounted subtrees.


Public Types

typedef WvCallback< void,
const UniMountTree *, void * > 
Visitor
typedef WvCallback< bool,
const UniMountTree *, const
UniMountTree *, void * > 
Comparator

Public Member Functions

 UniMountTree (UniMountTree *parent, const UniConfKey &key)
bool isessential ()
 Returns true if the node should not be pruned.
UniMountTreefindnearest (const UniConfKey &key, int &split)
 Returns the nearest node in the info tree to the key.
UniMountTreefindormake (const UniConfKey &key)
 Finds or makes an info node for the specified key.
UniMountTreeparent () const
 Returns a pointer to the parent node, or NULL if there is none.
void setparent (UniMountTree *parent)
 Reparents this node.
UniMountTreeroot () const
 Returns a pointer to the root node of the tree.
UniConfKey fullkey (const UniMountTree *ancestor=NULL) const
 Returns full path of this node relative to an ancestor.
UniMountTreefind (const UniConfKey &key) const
 Finds the sub-node with the specified key.
UniMountTreefindchild (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 UniMountTree *other, const Comparator &comparator, void *userdata)
 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

UniConfGenList generators

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

Classes

class  GenIter
 An iterator over the generators that might provide a key starting with the nearest match. More...
class  MountIter
 An iterator over the UniMountTree nodes that might know something about the provided 'key', starting with the nearest match and then moving up the tree. More...


Member Function Documentation

UniMountTree * UniMountTree::findnearest const UniConfKey key,
int &  split
 

Returns the nearest node in the info tree to the key.

"key" is the key "split" is set to the number of leading segments used Returns: the node

UniConfKey UniConfTree< UniMountTree , UniHashTreeBase >::fullkey const UniMountTree ancestor = NULL  )  const [inline, inherited]
 

Returns full path of this node relative to an ancestor.

If ancestor is NULL, returns the root.

UniMountTree * UniConfTree< UniMountTree , UniHashTreeBase >::find const UniConfKey key  )  const [inline, inherited]
 

Finds the sub-node with the specified key.

If key.isempty(), returns this node.

UniMountTree * UniConfTree< UniMountTree , 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.

void UniConfTree< UniMountTree , 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.

void UniConfTree< UniMountTree , 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

bool UniConfTree< UniMountTree , UniHashTreeBase >::compare const UniMountTree 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


Member Data Documentation

UniConfKey UniHashTreeBase::xkey [protected, inherited]
 

the name of this entry

UniHashTreeBase* UniHashTreeBase::xparent [protected, inherited]
 

the parent of this subtree

Container* UniHashTreeBase::xchildren [protected, inherited]
 

the hash table of children


The documentation for this class was generated from the following files:
Generated on Tue Jul 12 03:00:19 2005 for WvStreams by  doxygen 1.4.0