heap_peek Subroutine

private 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.

Type Bound

heap_t

Arguments

Type IntentOptional 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

Calls

proc~~heap_peek~~CallsGraph proc~heap_peek heap_t%heap_peek proc~root_entry root_entry proc~heap_peek->proc~root_entry proc~error_set error_t%error_set proc~root_entry->proc~error_set

Variables

Type Visibility Attributes Name Initial
logical, private :: ok

Source Code

   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