Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsBinTree Class Reference

#include <dsBintree.h>

Inheritance diagram for dsBinTree:

dsBinTreeGeneric dsDataAccessor btest List of all members.

Public Methods

 dsBinTree (DACleanupMode purge=cmPURGE)
dsDataPairseek (dsDataPair *dp)
char * seek (const char *key)
dsDataPairinsert (dsDataPair *dp, bool replace)
char * insert (const char *key, char *value, bool replace=false)
void * insert (void *a, bool replace=false)
void * remove (void *a)
void * seek (void *a)
void walk (dsBinTreeItem *n=NULL, int first=1)

Protected Types

enum  DACleanupMode { cmPASSIVE, cmPURGE }

Protected Methods

virtual int cf (void *a, void *b)
const char * key (void *a)
void cleanup (dsBinTreeItem *n=NULL, int first=1)
virtual void visit (void *)
virtual void * walk ()

Protected Attributes

DACleanupMode _purge

Member Enumeration Documentation

enum dsDataAccessor::DACleanupMode [protected, inherited]

Enumeration values:
cmPASSIVE  don't delete data body
cmPURGE  delete data body on replace or cleanup

Constructor & Destructor Documentation

dsBinTree::dsBinTree DACleanupMode    purge = cmPURGE [inline]

Member Function Documentation

virtual int dsBinTree::cf void *    a,
void *    b
[inline, protected, virtual]

comparision function have to be overloaded

Implements dsBinTreeGeneric.

void dsBinTreeGeneric::cleanup dsBinTreeItem   n = NULL,
int    first = 1
[protected, inherited]

Return consumed memory, if purge flag is set call free for each attached object, if not - just destroy tree item

void * dsBinTreeGeneric::insert void *    a,
bool    replace = false
[virtual, inherited]

Insert an object into tree

a object to insert
pointer to existing object if object already there or NULL

Implements dsDataAccessor.

char * dsBinTree::insert const char *    key,
char *    value,
bool    replace = false

dsDataPair * dsBinTree::insert dsDataPair   dp,
bool    replace

const char* dsBinTree::key void *    a [inline, protected]

void * dsBinTreeGeneric::remove void *    a [virtual, inherited]

Remove an object from tree

a object to remove
pointer to removed object or NULL

Implements dsDataAccessor.

void * dsBinTreeGeneric::seek void *    a [virtual, inherited]

Find matching object

a object to find
pointer to found object or NULL

Implements dsDataAccessor.

char * dsBinTree::seek const char *    key [inline]

dsDataPair * dsBinTree::seek dsDataPair   dp [inline]

virtual void dsBinTreeGeneric::visit void *    [inline, protected, virtual, inherited]

This function invoked for each node from inorder()

virtual void* dsDataAccessor::walk   [inline, protected, virtual, inherited]

Walk throuph storage behavioure details depends of storage nature

void dsBinTreeGeneric::walk dsBinTreeItem   n = NULL,
int    first = 1

Recursive walks throuph tree and call visit() for each node

Member Data Documentation

DACleanupMode dsDataAccessor::_purge [protected, inherited]

Cleanup mode flag. See DACleanupMode

dsBinTreeItem* dsBinTreeGeneric::_root [protected, inherited]

Tree root

The documentation for this class was generated from the following file:
Generated on Mon May 16 18:26:59 2005 for libdms4 by doxygen1.3-rc2