13 integer(I4B),
parameter,
private ::
hash_size = 4993
23 integer(I4B) :: cnt = 0
48 subroutine add(this, key, val)
50 character(len=*),
intent(in) :: key
51 class(*),
pointer,
intent(in) :: val
56 if (this%contains(key))
then
58 "Already existing variable being added to the HashTable -"//key)
63 bucket => this%buckets(hash)
64 call bucket%add(key, val)
65 this%cnt = this%cnt + 1
71 function get(this, key)
result(val)
73 character(len=*),
intent(in) :: key
74 class(*),
pointer :: val
81 bucket => this%buckets(hash)
82 val => bucket%get(key)
91 character(len=*),
intent(in) :: key
95 res =
associated(this%get(key))
117 integer(I4B) :: bucket_index
120 bucket => this%buckets(bucket_index)
132 character(len=*),
intent(in) :: key
138 do i = 1, len_trim(key)
This module defines variable data types.
class(*) function, pointer get(this, key)
Get a void pointer from the HashTable using a key.
subroutine clear(this)
Clears the HashTable.
integer(i4b), parameter, private multiplier
integer(i4b), parameter, private hash_size
subroutine add(this, key, val)
Add a void pointer to the HashTable.
integer(i4b) function compute_hash(key)
Compute the hash of a key.
logical function contains(this, key)
Boolean indicating if an item exists in the hashtable.
class(iteratortype) function, allocatable iterator(this)
An iterator used to iterate through the HashTable.
integer(i4b), parameter, public bucket_size
integer(i4b) function count(this)
The nummer of items in the HashTable.
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
A list that stores items as a key-value pair.
An iterator used to iterate through a PtrHashTable.
HashTable that stores void pointer items.