cmd_t Derived Type

type, public :: cmd_t


Components

Type Visibility Attributes Name Initial
character(len=LEN_CMD), public, allocatable :: subc(:)
character(len=LEN_CMD), private :: name = ''

Type-Bound Procedures

procedure, public :: get_name => cmd__get_name

  • private pure function cmd__get_name(self) result(res)

    Arguments

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

    Return Value character(len=:), allocatable

procedure, public :: set_name => cmd__set_name

  • private pure subroutine cmd__set_name(self, name)

    Arguments

    Type IntentOptional Attributes Name
    class(cmd_t), intent(inout) :: self
    character(len=*), intent(in) :: name

Source Code

   type, public :: cmd_t  ! command type
      character(LEN_CMD), private :: name = ''
      character(LEN_CMD), allocatable :: subc(:)   ! sub-command
   contains
      procedure :: get_name => cmd__get_name
      procedure :: set_name => cmd__set_name
   end type cmd_t