Return the root entry without removing it.
Behaves exactly like pop on an empty heap: key and payload are
zeroed and err reports ERROR_VALIDATION.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(heap_t), | intent(in) | :: | self | |||
| integer(kind=int64), | intent(out) | :: | key | |||
| integer(kind=int32), | intent(out) | :: | payload | |||
| type(error_t), | intent(out), | optional | :: | err |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | private | :: | ok |
subroutine heap_peek(self, key, payload, err) !! Return the root entry without removing it. !! !! Behaves exactly like `pop` on an empty heap: `key` and `payload` are !! zeroed and `err` reports `ERROR_VALIDATION`. class(heap_t), intent(in) :: self integer(int64), intent(out) :: key integer(int32), intent(out) :: payload type(error_t), intent(out), optional :: err logical :: ok ok = root_entry(self, key, payload, err) end subroutine heap_peek