Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

UniMountTree Class Reference

#include <unimounttreegen.h>

Inherits UniConfTree< UniMountTree >.

Collaboration diagram for UniMountTree:

[legend]
List of all members.

Detailed Description

Used by UniMountTreeGen to maintain information about mounted subtrees.

Definition at line 20 of file unimounttreegen.h.

Public Types

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

Public Member Functions

 UniMountTree (UniMountTree *parent, const UniConfKey &key)
 ~UniMountTree ()
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 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 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

void _recursivecompare (const UniHashTreeBase *a, const UniHashTreeBase *b, const UniHashTreeBaseComparator &comparator, void *userdata)

Protected Attributes

UniConfKey xkey
UniHashTreeBasexparent
Containerxchildren


Member Typedef Documentation

typedef UniHashTreeBaseComparator UniHashTreeBase::BaseComparator [protected, inherited]
 

Definition at line 33 of file unihashtree.h.

typedef WvCallback<bool, const UniMountTree *, const UniMountTree *, void *> UniConfTree< UniMountTree , UniHashTreeBase >::Comparator [inherited]
 

Definition at line 38 of file uniconftree.h.

typedef WvScatterHash<UniHashTreeBase, UniConfKey, Accessor> UniHashTreeBase::Container [protected, inherited]
 

Definition at line 32 of file unihashtree.h.

Referenced by UniHashTreeBase::Iter::Iter(), and UniHashTreeBase::~UniHashTreeBase().


Constructor & Destructor Documentation

UniMountTree::UniMountTree UniMountTree parent,
const UniConfKey key
 

Definition at line 307 of file unimounttreegen.cc.

Referenced by findormake().

UniMountTree::~UniMountTree  ) 
 

Definition at line 314 of file unimounttreegen.cc.


Member Function Documentation

UniHashTreeBase * UniHashTreeBase::_find const UniConfKey key  )  const [protected, inherited]
 

Definition at line 90 of file unihashtree.cc.

References UniHashTreeBase::_findchild(), UniConfKey::Iter::next(), and UniConfKey::Iter::rewind().

UniHashTreeBase * UniHashTreeBase::_findchild const UniConfKey key  )  const [protected, inherited]
 

Definition at line 104 of file unihashtree.cc.

References UniConfKey::isempty(), and UniHashTreeBase::xchildren.

Referenced by UniHashTreeBase::_find().

UniConfKey UniHashTreeBase::_fullkey const UniHashTreeBase ancestor = NULL  )  const [protected, inherited]
 

Definition at line 63 of file unihashtree.cc.

References UniHashTreeBase::key(), UniConfKey::prepend(), and UniHashTreeBase::xparent.

void UniHashTreeBase::_recursivecompare const UniHashTreeBase a,
const UniHashTreeBase b,
const UniHashTreeBaseComparator comparator,
void *  userdata
[static, protected, inherited]
 

Definition at line 140 of file unihashtree.cc.

References UniHashTreeBaseComparator.

UniHashTreeBase * UniHashTreeBase::_root  )  const [protected, inherited]
 

Definition at line 54 of file unihashtree.cc.

References UniHashTreeBase::xparent.

void UniHashTreeBase::_setparent UniHashTreeBase parent  )  [protected, inherited]
 

Definition at line 42 of file unihashtree.cc.

References UniHashTreeBase::link(), UniHashTreeBase::unlink(), and UniHashTreeBase::xparent.

void 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

Definition at line 120 of file uniconftree.h.

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.

Definition at line 72 of file uniconftree.h.

Referenced by UniMountTreeGen::exists(), UniMountTreeGen::get(), UniMountTreeGen::haschildren(), UniMountTreeGen::ismountpoint(), UniMountTreeGen::KeyIter::rewind(), and UniMountTreeGen::unmount().

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.

Definition at line 81 of file uniconftree.h.

Referenced by findnearest(), and findormake().

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

Definition at line 319 of file unimounttreegen.cc.

References UniConfTree< UniMountTree >::findchild(), UniConfKey::Iter::next(), and UniConfKey::Iter::rewind().

Referenced by UniMountTree::MountIter::MountIter().

UniMountTree * UniMountTree::findormake const UniConfKey key  ) 
 

Finds or makes an info node for the specified key.

Definition at line 336 of file unimounttreegen.cc.

References UniConfTree< UniMountTree >::findchild(), UniConfKey::Iter::next(), UniConfKey::Iter::rewind(), and UniMountTree().

Referenced by UniMountTreeGen::mountgen().

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.

Definition at line 65 of file uniconftree.h.

bool UniHashTreeBase::haschildren  )  const [inherited]
 

Returns true if the node has children.

Definition at line 113 of file unihashtree.cc.

References WvScatterHashBase::isempty(), and UniHashTreeBase::xchildren.

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

bool UniMountTree::isessential  )  [inline]
 

Returns true if the node should not be pruned.

Definition at line 29 of file unimounttreegen.h.

References generators, and UniHashTreeBase::haschildren().

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

Returns the key field.

Definition at line 62 of file unihashtree.h.

Referenced by UniHashTreeBase::_fullkey(), and UniHashTreeBase::Accessor::get_key().

UniMountTree * UniConfTree< UniMountTree , UniHashTreeBase >::parent  )  const [inline, inherited]
 

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

Definition at line 50 of file uniconftree.h.

Referenced by UniMountTree::MountIter::next().

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.

Definition at line 90 of file uniconftree.h.

References UniConfTree< Sub, Base >::find().

UniMountTree * UniConfTree< UniMountTree , UniHashTreeBase >::root  )  const [inline, inherited]
 

Returns a pointer to the root node of the tree.

Definition at line 58 of file uniconftree.h.

void UniConfTree< UniMountTree , UniHashTreeBase >::setparent UniMountTree parent  )  [inline, inherited]
 

Reparents this node.

Definition at line 54 of file uniconftree.h.

void UniConfTree< UniMountTree , UniHashTreeBase >::zap  )  [inline, inherited]
 

Removes and deletes all children of this node.

Definition at line 94 of file uniconftree.h.


Member Data Documentation

UniConfGenList UniMountTree::generators
 

Definition at line 23 of file unimounttreegen.h.

Referenced by UniMountTreeGen::commit(), isessential(), UniMountTreeGen::ismountpoint(), UniMountTreeGen::mountgen(), UniMountTreeGen::refresh(), and UniMountTreeGen::unmount().

Container* UniHashTreeBase::xchildren [protected, inherited]
 

the hash table of children

Definition at line 34 of file unihashtree.h.

Referenced by UniHashTreeBase::_findchild(), UniHashTreeBase::haschildren(), UniHashTreeBase::UniHashTreeBase(), and UniHashTreeBase::~UniHashTreeBase().

UniConfKey UniHashTreeBase::xkey [protected, inherited]
 

the name of this entry

Definition at line 23 of file unihashtree.h.

UniHashTreeBase* UniHashTreeBase::xparent [protected, inherited]
 

the parent of this subtree

Definition at line 24 of file unihashtree.h.

Referenced by UniHashTreeBase::_fullkey(), UniHashTreeBase::_root(), UniHashTreeBase::_setparent(), UniHashTreeBase::UniHashTreeBase(), and UniHashTreeBase::~UniHashTreeBase().


The documentation for this class was generated from the following files:
Generated on Sat Mar 13 15:00:24 2004 for WvStreams by doxygen 1.3.6-20040222