Singly-linked list. Defines a sequence of key-value pairs E.g.: with 4 nodes key1 --> key2 --> key3 --> key4 --> nul() | | | | val1 val2 val3 val4
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(sllist_obj), | public, | pointer | :: | child | => | null() | |
| integer, | public | :: | key | = | -1 | ||
| class(*), | public, | allocatable | :: | val |
Free all data associated with this list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(inout) | :: | this |
List object |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
list object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| integer(kind=leapI4), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| integer(kind=leapI8), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| real(kind=leapSP), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| real(kind=leapDP), | intent(out) | :: | val |
Value associated with key to return |
Adds a pair key-value to the list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(inout) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in key-val pair to add to list |
||
| class(*), | intent(in) | :: | val |
Val in key-val pair to add to list |
Remove key-value pair from list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(inout), | target | :: | this |
List object |
|
| integer, | intent(in) | :: | key |
Key of key-val pair to remove |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
list object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| integer(kind=leapI4), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| integer(kind=leapI8), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| real(kind=leapDP), | intent(out) | :: | val |
Value associated with key to return |
Traverse the list until key is found. Returns the associated value to the key, or -1 if key not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sllist_obj), | intent(in) | :: | this |
List object |
||
| integer, | intent(in) | :: | key |
Key in list |
||
| real(kind=leapSP), | intent(out) | :: | val |
Value associated with key to return |
type :: sllist_obj !> Singly-linked list. ! Defines a sequence of key-value pairs ! E.g.: with 4 nodes ! key1 --> key2 --> key3 --> key4 --> nul() ! | | | | ! val1 val2 val3 val4 type(sllist_obj), pointer :: child => null() integer :: key = -1 class(*), allocatable :: val contains procedure :: Put => sllist_obj_Put generic :: Get => sllist_obj_Get_int4, & sllist_obj_Get_int8, & sllist_obj_Get_real_sp, & sllist_obj_Get_real_dp procedure :: Remove => sllist_obj_Remove procedure :: Free => sllist_obj_Free ! Internal/private procedures procedure, private :: sllist_obj_Get_int4 procedure, private :: sllist_obj_Get_int8 procedure, private :: sllist_obj_Get_real_sp procedure, private :: sllist_obj_Get_real_dp end type sllist_obj