GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LDT / V0-5-0 > encdec / linux-gcc
Classes | |
struct | _HEAP |
Context structure for a heap. More... | |
Typedefs | |
typedef int(* | HEAP_compare )(const void *key1, const void *key2) |
Comparison function used to sort the heap. | |
typedef void(* | HEAP_destroy )(void *data) |
Call back function to destroy (freed) the data. | |
typedef struct _HEAP | HEAP |
Typedef for struct _HEAP. | |
Functions | |
void | HEAP_init (HEAP *heap, HEAP_compare compare, HEAP_destroy destroy) |
Initializes a heap for use. | |
void | HEAP_free (HEAP *heap) |
Frees all the nodes of the heap. | |
int | HEAP_insert (HEAP *heap, const void *data) |
Inserts a node with the specified data on the heap. | |
int | HEAP_extract (HEAP *heap, void **data) |
Extracts (removes) the top node of the heap. | |
static __inline int | HEAP__size (HEAP *heap) |
Returns the size of the heap,. |
CVS $Id
Typedef for struct _HEAP.
This structure is not meant to be directly manipulated by the user. It should be treated as a C++ private member
int HEAP_compare |
Comparison function used to sort the heap.
<0 | if key1 < key2 | |
=0 | if key1 = key2 | |
>0 | if key1 > key2 |
key1 | Pointer to the first data structure to be sorted | |
key2 | Pointer to the second data structure to be sorted |
Call back function to destroy (freed) the data.
data | The data to be destroyed (freed) |
HEAP__size | ( | HEAP * | heap | ) | [static] |
Returns the size of the heap,.
heap | The heap to size |
int HEAP_extract | ( | HEAP * | heap, | |
void ** | data | |||
) |
Extracts (removes) the top node of the heap.
heap | The heap to remove the node from | |
data | Returned as a pointer to the data associated with the node |
void HEAP_free | ( | HEAP * | heap | ) |
Frees all the nodes of the heap.
heap | The heap to free |
void HEAP_init | ( | HEAP * | heap, | |
HEAP_compare | compare, | |||
HEAP_destroy | destroy | |||
) |
Initializes a heap for use.
heap | The heap control structure to initialize | |
compare | Callback comparision routine | |
destroy | Callback destruction (free) routine |
int HEAP_insert | ( | HEAP * | heap, | |
const void * | data | |||
) |
Inserts a node with the specified data on the heap.
heap | The heap to insert the node on | |
data | The data |