vector_int Derived Type

type, public :: vector_int

Vector_int ๆ•ดๅž‹ๅ‘้‡


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_int), intent(inout) :: self

procedure, public, :: pop

  • private pure subroutine pop(self, item)

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

    Arguments

    Type IntentOptional Attributes Name
    class(vector_int), intent(inout) :: self
    integer, intent(out), optional :: item

procedure, public, :: push

  • private pure subroutine push(self, item)

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

    Arguments

    Type IntentOptional Attributes Name
    class(vector_int), intent(inout) :: self
    integer, intent(in) :: item

procedure, public, :: set

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

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

    Arguments

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

procedure, public, :: get

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

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

    Arguments

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

procedure, public, :: clear

  • private pure subroutine clear(self)

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

    Arguments

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

Source Code

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