20 integer(I4B) :: cnt = 0
42 subroutine add(this, key, val)
44 character(len=*),
intent(in) :: key
45 class(*),
pointer,
intent(in) :: val
48 if (.not.
associated(this%first))
then
50 this%last => this%first
52 allocate (this%last%next)
53 this%last => this%last%next
56 allocate (this%last%key)
58 this%last%value => val
59 this%last%next => null()
61 this%cnt = this%cnt + 1
69 function get(this, key)
result(val)
71 character(len=*),
intent(in) :: key
72 class(*),
pointer :: val
79 do while (
associated(node))
80 if (node%key == key)
then
92 function count(this)
result(val)
106 if (
associated(this%first))
call clear_node(this%first)
120 if (
associated(node))
then
123 deallocate (node%key)
This module contains simulation constants.
integer(i4b), parameter lenmemaddress
maximum length of the full memory address, including variable name
class(*) function, pointer get(this, key)
Get a value using a key.
integer(i4b) function count(this)
The nummer of items in the list.
class(iteratortype) function, allocatable iterator(this)
subroutine clear(this)
Clears the list.
recursive subroutine clear_node(node)
Clears the node.
subroutine add(this, key, val)
Add a key-value pair to the list.
This module defines variable data types.
An iterator used to iterate through a KeyValueList.
A list that stores items as a key-value pair.