.TH "heap.h" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME heap.h \- .SH SYNOPSIS .br .PP \fC#include \fP .br .SS "Typedefs" .in +1c .ti -1c .RI "typedef int \fBcc_heap_compare_cb\fP (void *o1, void *o2)" .br .ti -1c .RI "typedef struct cc_heap \fBcc_heap\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "cc_heap * \fBcc_heap_construct\fP (unsigned int size, cc_heap_compare_cb *comparecb, SbBool support_remove)" .br .ti -1c .RI "void \fBcc_heap_destruct\fP (cc_heap *h)" .br .ti -1c .RI "void \fBcc_heap_clear\fP (cc_heap *h)" .br .ti -1c .RI "void \fBcc_heap_add\fP (cc_heap *h, void *o)" .br .ti -1c .RI "void * \fBcc_heap_get_top\fP (cc_heap *h)" .br .ti -1c .RI "void * \fBcc_heap_extract_top\fP (cc_heap *h)" .br .ti -1c .RI "int \fBcc_heap_remove\fP (cc_heap *h, void *o)" .br .ti -1c .RI "unsigned int \fBcc_heap_elements\fP (cc_heap *h)" .br .ti -1c .RI "SbBool \fBcc_heap_empty\fP (cc_heap *h)" .br .in -1c .SH "Detailed Description" .PP .SH "Function Documentation" .PP .SS "cc_heap* cc_heap_construct (unsigned intsize, cc_heap_compare_cb *comparecb, SbBoolsupport_remove)" Construct a heap\&. \fIsize\fP is the initial array size\&. .PP \fIcomparecb\fP 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\&. .PP \fIsupport_remove\fP 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\&. .SS "void cc_heap_destruct (cc_heap *h)" Destruct the heap \fIh\fP\&. .SS "void cc_heap_clear (cc_heap *h)" Clear/remove all elements in the heap \fIh\fP\&. .SS "void cc_heap_add (cc_heap *h, void *o)" Add the element \fIo\fP to the heap \fIh\fP\&. .SS "void* cc_heap_get_top (cc_heap *h)" Returns the top element from the heap \fIh\fP\&. If the heap is empty, NULL is returned\&. .SS "void* cc_heap_extract_top (cc_heap *h)" Returns and removes the top element from the heap \fIh\fP\&. If the heap is empty, NULL is returned\&. .SS "int cc_heap_remove (cc_heap *h, void *o)" Remove \fIo\fP from the heap \fIh\fP; if present TRUE is returned, otherwise FALSE\&. Please note that the heap must have been created with support_remove\&. .SS "unsigned int cc_heap_elements (cc_heap *h)" Returns the number of elements in the heap \fIh\fP\&. .SS "SbBool cc_heap_empty (cc_heap *h)" Returns TRUE of the heap \fIh\fP is empty; otherwise FALSE\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.