a node in the linked list. This is the container to
the unlimited polymorphic value variable.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| class(*), | private, | allocatable | :: | key |
the key (can be integer, string, or key_class) |
||
| class(*), | private, | pointer | :: | value | => | null() |
the data to hold |
| logical, | private | :: | destroy_on_delete | = | .true. |
if true, value pointer is deallocated when it is removed from the list, or the list is destroyed. If false, it is only nullified. |
|
| type(node), | private, | pointer | :: | next | => | null() |
the next one in the list |
| type(node), | private, | pointer | :: | previous | => | null() |
the previous one in the list |
deallocate value
destroy the data in the node.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(node), | intent(inout) | :: | me |
get data from a node
Get the data from a node
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(node), | intent(in) | :: | me | |||
| class(*), | intent(out), | pointer | :: | value |
type,public :: node !! a node in the linked list. This is the container to !! the unlimited polymorphic `value` variable. private class(*),allocatable :: key !! the key (can be integer, string, or [[key_class]]) class(*),pointer :: value => null() !! the data to hold logical :: destroy_on_delete = .true. !! if true, value pointer is deallocated !! when it is removed from the list, !! or the list is destroyed. If false, !! it is only nullified. type(node),pointer :: next => null() !! the next one in the list type(node),pointer :: previous => null() !! the previous one in the list contains private procedure,public :: destroy => destroy_node_data !! deallocate value procedure,public :: get_data => get_node_data !! get data from a node end type node