|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
Self-adjusting tree of caller-owned nodes, with unique keys.
Searches, including unsuccessful searches, may change the root and links. The tree does not allocate or free nodes or keys.
#include <SplayTree.h>
Public Member Functions | |
| SplayTree () | |
| Leave storage uninitialized; call SplayTree_constructor before use. More... | |
| SplayTree (SplayTree_Compare compare) | |
| Initialize an empty tree. More... | |
| int | insert (SplayTreeNode *n) |
| Insert a node without allocating memory. More... | |
| SplayTreeNode * | find (SplayTreeKey key) |
| Find a node and adjust the tree. More... | |
| int | remove (SplayTreeNode *n) |
| Unlink a node without freeing it. More... | |
| SplayTreeNode * | getRoot () |
| SplayTree::SplayTree | ( | ) |
Leave storage uninitialized; call SplayTree_constructor before use.
| SplayTree::SplayTree | ( | SplayTree_Compare | compare | ) |
Initialize an empty tree.
| [in] | compare | Required comparison callback retained by the tree. |
| SplayTreeNode * SplayTree::find | ( | SplayTreeKey | key | ) |
Find a node and adjust the tree.
| [in] | key | Search key interpreted by the comparison callback. |
| SplayTreeNode * SplayTree::getRoot | ( | ) |
| int SplayTree::insert | ( | SplayTreeNode * | n | ) |
Insert a node without allocating memory.
| [in,out] | n | Initialized, unlinked node. |
| int SplayTree::remove | ( | SplayTreeNode * | n | ) |
Unlink a node without freeing it.
| [in,out] | n | Node to remove, identified by both key and pointer. |