vector Derived Type

type, public :: vector

Vector ๆณ›ๅž‹ๅ‘้‡


Contents

Source Code


Components

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

ๆœ‰ๆ•ˆๅ‘้‡้•ฟๅบฆ


Type-Bound Procedures

procedure, public, :: init

  • private pure subroutine init(self)

    ๅˆๅง‹ๅŒ–ๅ‘้‡

    Arguments

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

procedure, public, :: pop

  • private subroutine pop(self, item)

    ๅ‘้‡ๅผนๅ‡บ

    Arguments

    Type IntentOptional Attributes Name
    class(vector), intent(inout) :: self
    class(*), intent(out), optional, allocatable :: item

procedure, public, :: push

  • private pure subroutine push(self, item)

    ๅ‘้‡ๅŽ‹ๅ…ฅ

    Arguments

    Type IntentOptional Attributes Name
    class(vector), intent(inout) :: self
    class(*), intent(in) :: item

procedure, public, :: set

  • private pure subroutine set(self, index, item)

    ๅ‘้‡่ฎพ็ฝฎ

    Arguments

    Type IntentOptional Attributes Name
    class(vector), intent(inout) :: self
    integer, intent(in) :: index
    class(*), intent(in) :: item

procedure, public, :: get

  • private subroutine get(self, index, item)

    ๅ‘้‡่Žทๅ–

    Arguments

    Type IntentOptional Attributes Name
    class(vector), intent(in) :: self
    integer, intent(in) :: index
    class(*), intent(out), allocatable :: item

procedure, public, :: clear

  • private pure subroutine clear(self)

    ๅ‘้‡ๆธ…็ฉบ

    Arguments

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

Source Code

    type vector
        private
        integer, public :: len = 0  !! ๆœ‰ๆ•ˆๅ‘้‡้•ฟๅบฆ
        type(node), allocatable :: items(:)  !! ๆณ›ๅž‹ๆ•ฐ็ป„
    contains
        procedure :: init
        procedure :: push, pop
        procedure :: get, set
        procedure :: clear
        procedure, private :: extend
    end type vector