List_ Derived Type

type, public :: List_

This is a derived type of list, where we can create a list instance and do some basic operations such as GET, APPEND, SPLIT.


Components

Type Visibility Attributes Name Initial
type(List_content_), public, allocatable :: content(:)

This attribute is no used.

type(List_fix_content_), public, allocatable :: fcontent(:)

This attribute is active. All entities in a list are contained in this list.

type(List_), public, allocatable :: list(:)

A list instance can have an array of list.


Type-Bound Procedures

procedure, public :: get => get_list_content_listclass

GET operation for a list instance.

  • public pure function get_list_content_listclass(this, idx) result(ret)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(in) :: this
    integer(kind=int32), intent(in) :: idx

    Return Value character(len=:), allocatable

procedure, public :: append => append_list_content_listclass

APPEND operation for a list instance.

  • public subroutine append_list_content_listclass(this, char)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(inout) :: this
    character(len=*), intent(in) :: char

procedure, public :: new => new_list_listclass

Initialize and allocate list by a number of content.

  • public pure subroutine new_list_listclass(this, length)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(inout) :: this
    integer(kind=int32), intent(in) :: length

procedure, public :: print => print_listclass

It shows the all content in the terminal.

  • public subroutine print_listclass(this)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(in) :: this

procedure, public :: size => size_listclass

It returns a number of entities of list.

  • public pure function size_listclass(this) result(ret)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(in) :: this

    Return Value integer(kind=int32)

procedure, public :: help => help_listclass

It shows the help of the listclass.

  • public subroutine help_listclass(this)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(in) :: this

procedure, public :: split => split_char_into_list

It sets entities by splitting a string by a delimiter.

  • public subroutine split_char_into_list(this, str_val, delimiter)

    Arguments

    Type IntentOptional Attributes Name
    class(List_), intent(inout) :: this
    character(len=*), intent(in) :: str_val
    character(len=*), intent(in) :: delimiter