csTree< T > Class Template Reference
A generic binary search tree. More...
#include <csutil/bintree.h>
Public Member Functions | |
csTree (const csTree< T > &other) | |
Copy constructor. | |
csTree (int blocksize=15) | |
Construct a tree that allocates memory for nodes in blocks of the given size. | |
bool | Delete (uint32 key) |
Delete the given entry from the tree, returning false if it doesn't exist. | |
bool | DeleteAll () |
Delete all the entries from the tree. | |
const T & | Find (uint32 key) const |
Find the given entry in the tree, returning 0 if it doesn't exist,. | |
T & | Find (uint32 key) |
Find the given entry in the tree, creating it if it doesn't exist. | |
int | GetSize () const |
Get the number of entries in the tree. | |
void | PopulateWith (const csArray< uint32 > &keys, const csArray< T > &values) |
Populate an empty tree with entries from a sorted array. | |
void | Put (uint32 key, const T &value) |
Put an entry into the tree, overwriting if the key already exists. | |
void | Traverse (TraverseFunc *func, void *some) const |
Call a callback function once for every entry in the tree. |
Detailed Description
template<class T>
class csTree< T >
A generic binary search tree.
Definition at line 27 of file bintree.h.
Constructor & Destructor Documentation
|
Construct a tree that allocates memory for nodes in blocks of the given size.
|
|
Copy constructor.
Definition at line 115 of file bintree.h. References csBlockAllocator< T, BlockPolicy >::Alloc(), and csTree< T >::Root. |
Member Function Documentation
|
Delete the given entry from the tree, returning false if it doesn't exist.
Definition at line 229 of file bintree.h. References csBlockAllocator< T, BlockPolicy >::Free(). |
|
Delete all the entries from the tree.
|
|
Find the given entry in the tree, returning 0 if it doesn't exist,.
|
|
Find the given entry in the tree, creating it if it doesn't exist.
|
|
Get the number of entries in the tree.
|
|
Populate an empty tree with entries from a sorted array.
Definition at line 123 of file bintree.h. References CS_ASSERT, and csArray< T, ElementHandler, MemoryAllocator >::Length(). |
|
Put an entry into the tree, overwriting if the key already exists.
|
|
Call a callback function once for every entry in the tree.
|
The documentation for this class was generated from the following file:
- csutil/bintree.h
Generated for Crystal Space by doxygen 1.4.4