priority_queue_t Derived Type

type, public :: priority_queue_t

The priority_queue_t derived-type has an array containing segment data and the number of data. The array component is allocatable.


Components

Type Visibility Attributes Name Initial
type(segment_t), public, allocatable :: heap(:)
integer(kind=int32), public :: number = 0

Type-Bound Procedures

procedure, public :: clear

  • private pure subroutine clear(pq)

    The clear subroutine deallocates the queue.

    Arguments

    Type IntentOptional Attributes Name
    class(priority_queue_t), intent(inout) :: pq

procedure, public :: dequeue

  • private pure subroutine dequeue(pq, res)

    The dequeue function takes out and returns the prior segment from the queue.

    Arguments

    Type IntentOptional Attributes Name
    class(priority_queue_t), intent(inout) :: pq
    type(segment_t), intent(inout) :: res

procedure, public :: enqueue

  • private pure subroutine enqueue(pq, seg)

    The enqueue subroutine is responsible for allocating heap structure and holding the disjoined segment data with ascending priority order.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(priority_queue_t), intent(inout) :: pq
    type(segment_t), intent(in) :: seg