![]() |
ucx
UAP Common Extensions
|
Structure for holding the base data of a tree. More...
#include <tree.h>
Data Fields | |
const cx_tree_class * | cl |
The tree class definition. | |
const CxAllocator * | allocator |
Allocator to allocate new nodes. | |
void * | root |
A pointer to the root node. | |
cx_tree_node_create_func | node_create |
A function to create new nodes. | |
cx_destructor_func | simple_destructor |
An optional simple destructor for the tree nodes. | |
cx_destructor_func2 | advanced_destructor |
An optional advanced destructor for the tree nodes. | |
void * | destructor_data |
The pointer to additional data that is passed to the advanced destructor. | |
cx_tree_search_func | search |
A function to compare two nodes. | |
cx_tree_search_data_func | search_data |
A function to compare a node with data. | |
size_t | size |
The number of currently stored elements. | |
ptrdiff_t | loc_parent |
Offset in the node struct for the parent pointer. | |
ptrdiff_t | loc_children |
Offset in the node struct for the children linked list. | |
ptrdiff_t | loc_last_child |
Optional offset in the node struct for the pointer to the last child in the linked list (negative if there is no such pointer). | |
ptrdiff_t | loc_prev |
Offset in the node struct for the previous sibling pointer. | |
ptrdiff_t | loc_next |
Offset in the node struct for the next sibling pointer. | |
Structure for holding the base data of a tree.
cx_tree_node_create_func cx_tree_s::node_create |
A function to create new nodes.
Invocations to this function will receive a pointer to this tree structure as second argument.
Nodes MAY use cx_tree_node_base_s as base layout, but do not need to.
void* cx_tree_s::root |
A pointer to the root node.
Will be NULL
when size
is 0.