Provided by: libcoin80-doc_3.1.4~abc9f50-4ubuntu2_all

**NAME**

heap.h -

**SYNOPSIS**

#include <Inventor/C/basic.h>Typedefstypedef intcc_heap_compare_cb(void *o1, void *o2) typedef struct cc_heapcc_heapFunctionscc_heap *cc_heap_construct(unsigned int size, cc_heap_compare_cb *comparecb, SbBool support_remove) voidcc_heap_destruct(cc_heap *h) voidcc_heap_clear(cc_heap *h) voidcc_heap_add(cc_heap *h, void *o) void *cc_heap_get_top(cc_heap *h) void *cc_heap_extract_top(cc_heap *h) intcc_heap_remove(cc_heap *h, void *o) unsigned intcc_heap_elements(cc_heap *h) SbBoolcc_heap_empty(cc_heap *h)

**Function** **Documentation**

cc_heap*cc_heap_construct(unsignedintsize,cc_heap_compare_cb*comparecb,SbBoolsupport_remove)Construct a heap.sizeis the initial array size.comparecbshould 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_removespecifies 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.voidcc_heap_destruct(cc_heap*h)Destruct the heaph.voidcc_heap_clear(cc_heap*h)Clear/remove all elements in the heaph.voidcc_heap_add(cc_heap*h,void*o)Add the elementoto the heaph.void*cc_heap_get_top(cc_heap*h)Returns the top element from the heaph. If the heap is empty, NULL is returned.void*cc_heap_extract_top(cc_heap*h)Returns and removes the top element from the heaph. If the heap is empty, NULL is returned.intcc_heap_remove(cc_heap*h,void*o)Removeofrom the heaph; if present TRUE is returned, otherwise FALSE. Please note that the heap must have been created with support_remove.unsignedintcc_heap_elements(cc_heap*h)Returns the number of elements in the heaph.SbBoolcc_heap_empty(cc_heap*h)Returns TRUE of the heaphis empty; otherwise FALSE.

**Author**

Generated automatically by Doxygen for Coin from the source code.