◆ fiftyoneDegreesTreeIterateMethod
typedef void(* fiftyoneDegreesTreeIterateMethod) (void *state, fiftyoneDegreesTreeNode *node) |
Callback method called while iterating over a tree.
- Parameters
-
- state - pointer to any data needed by the method
- node - at the current point in the tree
Function Documentation
◆ fiftyoneDegreesTreeCount()
uint32_t fiftyoneDegreesTreeCount ( fiftyoneDegreesTreeRoot * root ) Used by assert statements to validate the number of entries in the cache for debugging should any changes be made to the logic.
Should not be compiled in release builds.
- Parameters
-
- root - pointer to the node being counted.
- Returns
- the number of children plus 1 for this current node.
◆ fiftyoneDegreesTreeDelete()
void fiftyoneDegreesTreeDelete ( fiftyoneDegreesTreeNode * node ) Removes the node from the tree so that it can be used again to store another result.
The node will come from the last item in the cache's linked list.
- Parameters
-
- node - pointer to be deleted.
◆ fiftyoneDegreesTreeFind()
fiftyoneDegreesTreeNode* fiftyoneDegreesTreeFind ( fiftyoneDegreesTreeRoot * root, int64_t key ) Returns the node that matches the key code provided.
- Parameters
-
- root - of the tree to search in
- key - to get the item for
- Returns
- the corresponding node if it exists in the tree, otherwise NULL.
◆ fiftyoneDegreesTreeInsert()
void fiftyoneDegreesTreeInsert ( fiftyoneDegreesTreeNode * node ) Inserts the node into the red black tree.
- Parameters
-
- node - pointer to the node being inserted.
◆ fiftyoneDegreesTreeIterateNodes()
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 with each node in the tree.
- Parameters
-
- root - of the tree to iterate
- state - pointer to pass to the callback method
- callback - method to call with each node
◆ fiftyoneDegreesTreeNodeInit()
void fiftyoneDegreesTreeNodeInit ( fiftyoneDegreesTreeNode * node, fiftyoneDegreesTreeRoot * root ) Initialises a newly allocated node.
- Parameters
-
- node - to initialise
- root - of the tree to which the node belongs
◆ fiftyoneDegreesTreeNodeRemove()
void fiftyoneDegreesTreeNodeRemove ( fiftyoneDegreesTreeNode * node ) Removes a node from the tree it belongs to.
- Parameters
-
- node - to remove
◆ fiftyoneDegreesTreeRootInit()
void fiftyoneDegreesTreeRootInit ( fiftyoneDegreesTreeRoot * root ) Initialises a newly allocated tree root to a clean state.
- Parameters
-
- root - to initialise