queue_real Derived Type

type, public :: queue_real

队列


Contents

Source Code


Components

Type Visibility Attributes Name Initial
integer, public :: len = 0

number of nodes in the queue


Type-Bound Procedures

procedure, public, :: enqueue => queue_enqueue

  • private pure subroutine queue_enqueue(self, item)

    Enqueue an item to the queue

    Arguments

    Type IntentOptional Attributes Name
    class(queue_real), intent(inout) :: self
    real(kind=rk), intent(in) :: item

procedure, public, :: dequeue => queue_dequeue

  • private pure subroutine queue_dequeue(self, item)

    Dequeue an item from the queue

    Arguments

    Type IntentOptional Attributes Name
    class(queue_real), intent(inout) :: self
    real(kind=rk), intent(out), optional :: item

procedure, public, :: iterator

  • private function iterator(self) result(iter)

    Get an queue_real_iterator for the queue

    Arguments

    Type IntentOptional Attributes Name
    class(queue_real), intent(in) :: self

    Return Value type(queue_real_iterator)

procedure, public, :: clear => queue_clear

  • private pure subroutine queue_clear(self)

    Clear the queue

    Arguments

    Type IntentOptional Attributes Name
    class(queue_real), intent(inout) :: self

Source Code

    type queue_real
        private
        integer, public :: len = 0 !! number of nodes in the queue
        type(node), pointer :: head => null() !! head of the queue
        type(node), pointer :: tail => null() !! tail of the queue
    contains
        procedure :: enqueue => queue_enqueue
        procedure :: dequeue => queue_dequeue
        procedure :: iterator
        procedure :: clear => queue_clear
    end type queue_real