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

dsBinTreeGeneric Class Reference

#include <dsBintree.h>

Inheritance diagram for dsBinTreeGeneric:

dsDataAccessor dsBinTree btest List of all members.

Public Methods

 dsBinTreeGeneric (DACleanupMode purge=cmPURGE)
virtual ~dsBinTreeGeneric ()
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

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

Protected Attributes

DACleanupMode _purge

Detailed Description

Very fast sorted binary tree

This bintree implementation based on examples shipped with Zortech C compiler and was initially written in plain C at 1994 And then was rewritten in C++ for version 2 of libdms. It was restyled to version 4.

This class is really fast and stable.

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

dsBinTreeGeneric::dsBinTreeGeneric DACleanupMode    purge = cmPURGE

Construct an object

purge if set to yes destructur delete attached objects.

virtual dsBinTreeGeneric::~dsBinTreeGeneric   [inline, virtual]


Member Function Documentation

virtual int dsBinTreeGeneric::cf void *    a,
void *    b
[protected, pure virtual]

comparision function have to be overloaded

Implemented in dsBinTree.

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

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

Insert an object into tree

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

Implements dsDataAccessor.

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

Remove an object from tree

a object to remove
pointer to removed object or NULL

Implements dsDataAccessor.

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

Find matching object

a object to find
pointer to found object or NULL

Implements dsDataAccessor.

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

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]

Tree root

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