API reference
GDBinaryHeap
Heap that pops the value with the smallest rank chosen by pick first.
Methods
set_pick(pick: Callable) -> voidpush(value: Variant) -> voidpop() -> Variantpeek() -> Variantdrain() -> Arraysize() -> intis_empty() -> bool
set_pick
set_pick(pick: Callable) -> voidSet the heap's rank-selection callback.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pick | Callable | Required | Callable selecting a comparison or aggregation key from each value. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
push
push(value: Variant) -> voidInsert a value and restore heap order.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
value | Variant | Required | Value to store, serialize, validate or pass to the operation described above. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
pop
pop() -> VariantRemove and return the next value.
Parameters
No parameters.
Return value
Variant
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
peek
peek() -> VariantReturn the next value without removing it.
Parameters
No parameters.
Return value
Variant
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
drain
drain() -> ArrayRemove all heap values in priority order.
Parameters
No parameters.
Return value
Array
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
size
size() -> intReturn the retained element count.
Parameters
No parameters.
Return value
int
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
is_empty
is_empty() -> boolReport whether the container is empty.
Parameters
No parameters.
Return value
bool
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.