Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_dlrbTree.h
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * Update an existing node instance accordingly to be in sync with the given data. | * Update an existing node instance accordingly to be in sync with the given data. | ||||
| * \param node: <DLRBT_Node> the node to update. | * \param node: <DLRBT_Node> the node to update. | ||||
| * \param data: Pointer to the relevant data or values stored in the bit-pattern. | * \param data: Pointer to the relevant data or values stored in the bit-pattern. | ||||
| * Dependent on the function. | * Dependent on the function. | ||||
| */ | */ | ||||
| typedef void (*DLRBT_NUpdate_FP)(void *node, void *data); | typedef void (*DLRBT_NUpdate_FP)(void *node, void *data); | ||||
| /** | |||||
| * Free a node and the wrapped data. | |||||
| * \param node: <DLRBT_Node> the node to free. | |||||
| */ | |||||
| typedef void (*DLRBT_NFree_FP)(void *node); | |||||
| /* ********************************************** */ | /* ********************************************** */ | ||||
| /* Public API */ | /* Public API */ | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name ADT Management | /** \name ADT Management | ||||
| * \{ */ | * \{ */ | ||||
| /** | /** | ||||
| * Create a new tree, and initialize as necessary. | * Create a new tree, and initialize as necessary. | ||||
| */ | */ | ||||
| DLRBT_Tree *BLI_dlrbTree_new(void); | DLRBT_Tree *BLI_dlrbTree_new(void); | ||||
| /** | /** | ||||
| * Initializes some given trees. | * Initializes some given trees. | ||||
| * Just zero out the pointers used. | * Just zero out the pointers used. | ||||
| */ | */ | ||||
| void BLI_dlrbTree_init(DLRBT_Tree *tree); | void BLI_dlrbTree_init(DLRBT_Tree *tree); | ||||
| /** | /** | ||||
| * Free the given tree's data but not the tree itself. | * Free the given tree's data but not the tree itself. | ||||
| */ | */ | ||||
| void BLI_dlrbTree_free(DLRBT_Tree *tree); | void BLI_dlrbTree_free(DLRBT_Tree *tree, DLRBT_NFree_FP free_cb); | ||||
| /** | /** | ||||
| * Make sure the tree's Double-Linked list representation is valid. | * Make sure the tree's Double-Linked list representation is valid. | ||||
| */ | */ | ||||
| void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree); | void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree); | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||