17 integer(I4B) :: curent_bucket_index = 1
38 iterator%buckets => buckets
40 first_bucket => iterator%buckets(1)
41 allocate (iterator%current_bucket_iterator, source=first_bucket%iterator())
53 integer(I4B) :: bucket_index
57 if (this%current_bucket_iterator%has_next())
then
65 do bucket_index = this%curent_bucket_index + 1,
size(this%buckets)
66 bucket => this%buckets(bucket_index)
67 if (bucket%count() > 0)
then
84 integer(I4B) :: bucket_index
88 if (.not. this%current_bucket_iterator%has_next())
then
89 do bucket_index = this%curent_bucket_index + 1,
size(this%buckets)
90 bucket => this%buckets(bucket_index)
91 if (bucket%count() > 0)
then
92 deallocate (this%current_bucket_iterator)
93 allocate (this%current_bucket_iterator, source=bucket%iterator())
94 this%curent_bucket_index = bucket_index
100 call this%current_bucket_iterator%next()
109 class(*),
pointer :: res
111 res => this%current_bucket_iterator%value()
This module defines variable data types.
subroutine next(this)
Increment the iterator to the next node.
type(logical) function has_next(this)
Indicates if there is a next node in the iteration chain.
type(ptrhashtableiteratortype) function constructor(buckets)
Constructor to create a PtrHashTableIterator.
class(*) function, pointer value(this)
Get the value the iterator is pointing to.
A list that stores items as a key-value pair.
An iterator used to iterate through a PtrHashTable.