#include <dsBintree.h>
Inheritance diagram for dsBinTree:
Public Methods | |
dsBinTree (DACleanupMode purge=cmPURGE) | |
dsDataPair * | seek (dsDataPair *dp) |
char * | seek (const char *key) |
dsDataPair * | insert (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 | |
dsBinTreeItem * | _root |
DACleanupMode | _purge |
|
|
|
|
|
comparision function have to be overloaded Implements dsBinTreeGeneric. |
|
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 |