#include <dsBintree.h>
Inheritance diagram for dsBinTreeGeneric:
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 | |
dsBinTreeItem * | _root |
DACleanupMode | _purge |
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.
|
|
|
Construct an object
|
|
Destructor |
|
comparision function have to be overloaded Implemented in dsBinTree. |
|
Return consumed memory, if purge flag is set call free for each attached object, if not - just destroy tree item |
|
Insert an object into tree
Implements dsDataAccessor. |
|
Remove an object from tree
Implements dsDataAccessor. |
|
Find matching object
Implements dsDataAccessor. |
|
This function invoked for each node from inorder() |
|
Walk throuph storage behavioure details depends of storage nature |
|
Recursive walks throuph tree and call visit() for each node |
|
Cleanup mode flag. See DACleanupMode |
|
Tree root |