Doubly-linked list with polymorphic element storage.
Iterate with iterate / reverse_iterate, or access by index with get.
Abstract base for list element data. Extend this type to store custom data.
Node holding a single integer value.
Node holding a single real(8) value.
Node holding a real(8) rank-1 array.
Node holding a real(8) rank-2 array.
Node holding an allocatable character string.
Construct an integer node.
Construct a real(8) scalar node.
Construct a real(8) rank-1 array node.
Construct a real(8) rank-2 array node.
Construct a character node.
Generic node constructor — dispatches on argument type.
Visitor procedure signature for iterate / reverse_iterate.
Set ok = .false. to stop iteration early.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | v |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=8), | intent(in) | :: | v |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=8), | intent(in) | :: | v(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=8), | intent(in) | :: | v(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | v |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout), | target | :: | this | ||
| procedure(command_fun) | :: | f |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout), | target | :: | this | ||
| procedure(command_fun) | :: | f |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(in) | :: | lst |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | idx |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout) | :: | lst | |||
| integer, | intent(in) | :: | idx | |||
| class(dlist_node_data_t), | intent(in) | :: | data |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout) | :: | lst | |||
| integer, | intent(in) | :: | idx |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(in) | :: | lst |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout) | :: | lst | |||
| class(dlist_node_data_t), | intent(in) | :: | data |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_t), | intent(inout) | :: | lst |
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.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dlist_t), | intent(inout) | :: | lst |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(dlist_node_data_t), | intent(in) | :: | command | |||
| logical, | intent(out) | :: | ok |
| final :: finalize_ll |
| procedure, public :: iterate => iterate_ll | Apply a visitor to each element in order |
| procedure, public :: reverse_iterate => reverse_iterate_ll | Apply a visitor to each element in reverse |
| procedure, public :: print => print_ll | Print list contents to stdout |
| procedure, public :: append => append_ll | Append a node to the tail |
| procedure, public :: insert => insert_ll | Insert a node at 1-based index |
| procedure, public :: remove => remove_ll | Remove element at 1-based index |
| procedure, public :: size => size_ll | Number of elements |
| procedure, public :: clear => clear_ll | Remove all elements |
| procedure, public :: get => get_ll | Index-based accessor (1-based); unallocated if out of range |
| generic, public :: assignment(=) => assign_ll |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | data | = | 0 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=8), | public | :: | data | = | 0.0d0 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=8), | public, | allocatable | :: | data(:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=8), | public, | allocatable | :: | data(:,:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | data |