dlist_t Derived Type

type, public :: dlist_t


Finalization Procedures

final :: finalize_ll

  • public interface finalize_ll()

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    Arguments

    None

Type-Bound Procedures

procedure, public :: iterate => iterate_ll

Apply a visitor to each element in order

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module function iterate_ll(this, f) result(r)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout), target :: this
    procedure(command_fun) :: f

    Return Value logical

procedure, public :: reverse_iterate => reverse_iterate_ll

Apply a visitor to each element in reverse

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module function reverse_iterate_ll(this, f) result(r)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout), target :: this
    procedure(command_fun) :: f

    Return Value logical

procedure, public :: print => print_ll

Print list contents to stdout

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module subroutine print_ll(lst)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(in) :: lst

procedure, public :: append => append_ll

Append a node to the tail

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module subroutine append_ll(lst, data)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout) :: lst
    class(dlist_node_data_t), intent(in) :: data

procedure, public :: insert => insert_ll

Insert a node at 1-based index

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module subroutine insert_ll(lst, idx, data)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout) :: lst
    integer, intent(in) :: idx
    class(dlist_node_data_t), intent(in) :: data

procedure, public :: remove => remove_ll

Remove element at 1-based index

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module subroutine remove_ll(lst, idx)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout) :: lst
    integer, intent(in) :: idx

procedure, public :: size => size_ll

Number of elements

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module function size_ll(lst)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(in) :: lst

    Return Value integer

procedure, public :: clear => clear_ll

Remove all elements

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module subroutine clear_ll(lst)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(inout) :: lst

procedure, public :: get => get_ll

Index-based accessor (1-based); unallocated if out of range

  • interface

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    public module function get_ll(this, idx) result(node)

    Arguments

    Type IntentOptional Attributes Name
    class(dlist_t), intent(in) :: this
    integer, intent(in) :: idx

    Return Value class(dlist_node_data_t), allocatable

generic, public :: assignment(=) => assign_ll

  • public interface assign_ll()

    Apply f to each element in forward order. Returns .true. if all elements were visited (i.e. f never set ok=.false.). Insert data at 1-based idx, shifting later elements right. Out-of-range low values prepend; out-of-range high values append. Remove the element at 1-based idx. Silently does nothing if idx is out-of-range. Apply f to each element in reverse order. Print list contents to stdout. Append data to the tail of the list. Number of elements in the list. Remove all elements. Index-based accessor (1-based). Returns an allocatable polymorphic copy of the node data. Unallocated if idx is out of range — check allocated(node) before select type.

    Arguments

    None