Heap.h -
#include <Inventor/C/basic.h>
typedef int cc_heap_compare_cb (void *o1, void *o2)
typedef struct cc_heap cc_heap
cc_heap * cc_heap_construct (unsigned int size, cc_heap_compare_cb *comparecb, SbBool support_remove)
void cc_heap_destruct (cc_heap *h)
void cc_heap_clear (cc_heap *h)
void cc_heap_add (cc_heap *h, void *o)
void * cc_heap_get_top (cc_heap *h)
void * cc_heap_extract_top (cc_heap *h)
int cc_heap_remove (cc_heap *h, void *o)
unsigned int cc_heap_elements (cc_heap *h)
SbBool cc_heap_empty (cc_heap *h)
Construct a heap. size is the initial array size.
comparecb should return a negative value if the first element is less than the second, zero if they are equal and a positive value if the first element is greater than the second.
support_remove specifies if the heap should support removal of elements (other than the top element) after they are added; this requires use of a hash table to be efficent, but as a slight runtime overhead will be incurred for the add and extract_top functions the support can be disabled if you don't need it.
Destruct the heap h.
Clear/remove all elements in the heap h.
Add the element o to the heap h.
Returns the top element from the heap h. If the heap is empty, NULL is returned.
Returns and removes the top element from the heap h. If the heap is empty, NULL is returned.
Remove o from the heap h; if present TRUE is returned, otherwise FALSE. Please note that the heap must have been created with support_remove.
Returns the number of elements in the heap h.
Returns TRUE of the heap h is empty; otherwise FALSE.
Generated automatically by Doxygen for Coin from the source code.