tree.h
uint32_t fiftyoneDegreesTreeCount(fiftyoneDegreesTreeRoot *root)
Used by assert statements to validate the number of entries in the cache for debugging should any cha...
fiftyoneDegreesTreeNode * fiftyoneDegreesTreeFind(fiftyoneDegreesTreeRoot *root, int64_t key)
Returns the node that matches the key code provided.
void fiftyoneDegreesTreeRootInit(fiftyoneDegreesTreeRoot *root)
Initialises a newly allocated tree root to a clean state.
fiftyoneDegreesTreeRoot * root
The current root node of the tree.
Definition: tree.h:79
fiftyoneDegreesTreeNode * right
Right node or NULL if none.
Definition: tree.h:82
void fiftyoneDegreesTreeNodeRemove(fiftyoneDegreesTreeNode *node)
Removes a node from the tree it belongs to.
void fiftyoneDegreesTreeNodeInit(fiftyoneDegreesTreeNode *node, fiftyoneDegreesTreeRoot *root)
Initialises a newly allocated node.
fiftyoneDegreesTreeNode root
The current root node of the tree.
Definition: tree.h:88
void(* fiftyoneDegreesTreeIterateMethod)(void *state, fiftyoneDegreesTreeNode *node)
Callback method called while iterating over a tree.
Definition: tree.h:97
fiftyoneDegreesTreeNode * parent
Parent node or NULL if root.
Definition: tree.h:80
int64_t key
Numeric key associated with the data value.
Definition: tree.h:78
void fiftyoneDegreesTreeInsert(fiftyoneDegreesTreeNode *node)
Inserts the node into the red black tree.
void fiftyoneDegreesTreeIterateNodes(fiftyoneDegreesTreeRoot *root, void *state, fiftyoneDegreesTreeIterateMethod callback)
Iterates over all the nodes in the tree starting at the root provided, calling the callback method wi...
unsigned char colour
The colour of the node in the red black tree.
Definition: tree.h:83
fiftyoneDegreesTreeNode * left
Left node or NULL if none.
Definition: tree.h:81
void fiftyoneDegreesTreeDelete(fiftyoneDegreesTreeNode *node)
Removes the node from the tree so that it can be used again to store another result.