![]() |
Coin
4.0.10
Coin3D core library
|
The SbHeapFuncs struct is used to specify functions on heap elements. More...
#include <Inventor/SbHeap.h>
Public Attributes | |
| float(* | eval_func )(void *) |
| int(* | get_index_func )(void *) |
| void(* | set_index_func )(void *, int) |
The SbHeapFuncs struct is used to specify functions on heap elements.
| SbHeapFuncs::eval_func |
The eval_func member is a pointer to a function that should return a weight-value for a heap element. Smaller elements are extracted first from the heap. The returned value must define a stable ordering and must not be NaN.
| SbHeapFuncs::get_index_func |
get_index_func is a pointer to a function which should return the element's heap index. Supplying it makes removing an arbitrary element or changing its weight faster than the default linear lookup. It may only be supplied together with set_index_func. Each element must then store its heap index in its own data structures. An element not in a heap must use an index smaller than 1.
| SbHeapFuncs::set_index_func |
set_index_func is used to set this index value, and will be called whenever the element is moved in the heap. It is called with -1 when an element is removed, extracted, or discarded by emptyHeap() or heap destruction. Elements must outlive the heap unless removed first. It may be supplied without get_index_func when movement notifications are useful but indexed lookup is not.