Go to the source code of this file.
Typedefs | |
| typedef isc_boolean_t(* | isc_heapcompare_t) (void *, void *) |
| typedef void(* | isc_heapindex_t) (void *, unsigned int) |
| typedef void(* | isc_heapaction_t) (void *, void *) |
| typedef struct isc_heap | isc_heap_t |
Functions | |
| isc_result_t | isc_heap_create (isc_heapcompare_t compare, isc_heapindex_t index, unsigned int size_increment, isc_heap_t **heapp) |
| Create a new heap. The heap is implemented using a space-efficient storage method. When the heap elements are deleted space is not freed but will be reused when new elements are inserted. More... | |
| void | isc_heap_destroy (isc_heap_t **heapp) |
| Destroys a heap. More... | |
| isc_result_t | isc_heap_insert (isc_heap_t *heap, void *elt) |
| Inserts a new element into a heap. More... | |
| void | isc_heap_delete (isc_heap_t *heap, unsigned int index) |
| Deletes an element from a heap, by element index. More... | |
| void | isc_heap_increased (isc_heap_t *heap, unsigned int index) |
| Indicates to the heap that an element's priority has increased. This function MUST be called whenever an element has increased in priority. More... | |
| void | isc_heap_decreased (isc_heap_t *heap, unsigned int index) |
| Indicates to the heap that an element's priority has decreased. This function MUST be called whenever an element has decreased in priority. More... | |
| void * | isc_heap_element (isc_heap_t *heap, unsigned int index) |
| Returns the element for a specific element index. More... | |
| void | isc_heap_foreach (isc_heap_t *heap, isc_heapaction_t action, void *uap) |
| Iterate over the heap, calling an action for each element. The order of iteration is not sorted. More... | |
| typedef struct isc_heap isc_heap_t |
| isc_result_t isc_heap_create | ( | isc_heapcompare_t | compare, |
| isc_heapindex_t | index, | ||
| unsigned int | size_increment, | ||
| isc_heap_t ** | heapp | ||
| ) |
Create a new heap. The heap is implemented using a space-efficient storage method. When the heap elements are deleted space is not freed but will be reused when new elements are inserted.
Requires:
Returns:
| void isc_heap_decreased | ( | isc_heap_t * | heap, |
| unsigned int | index | ||
| ) |
Indicates to the heap that an element's priority has decreased. This function MUST be called whenever an element has decreased in priority.
Requires:
| void isc_heap_delete | ( | isc_heap_t * | heap, |
| unsigned int | index | ||
| ) |
Deletes an element from a heap, by element index.
Requires:
| void isc_heap_destroy | ( | isc_heap_t ** | heapp | ) |
Destroys a heap.
Requires:
| void* isc_heap_element | ( | isc_heap_t * | heap, |
| unsigned int | index | ||
| ) |
Returns the element for a specific element index.
Requires:
Returns:
| void isc_heap_foreach | ( | isc_heap_t * | heap, |
| isc_heapaction_t | action, | ||
| void * | uap | ||
| ) |
Iterate over the heap, calling an action for each element. The order of iteration is not sorted.
Requires:
Note:
| void isc_heap_increased | ( | isc_heap_t * | heap, |
| unsigned int | index | ||
| ) |
Indicates to the heap that an element's priority has increased. This function MUST be called whenever an element has increased in priority.
Requires:
| isc_result_t isc_heap_insert | ( | isc_heap_t * | heap, |
| void * | elt | ||
| ) |
Inserts a new element into a heap.
Requires: