Fetch the entry at position in the iteration order, counting from 1.
This is the exact-fidelity iteration accessor: key comes back with
the key’s true length, trailing blanks included.
An out-of-range position yields key == "", value == 0 and
ERROR_VALIDATION in err when it is present.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hash_map_t), | intent(in) | :: | this | |||
| integer(kind=default_int), | intent(in) | :: | position | |||
| character(len=:), | intent(out), | allocatable | :: | key | ||
| integer(kind=int64), | intent(out) | :: | value | |||
| type(error_t), | intent(out), | optional | :: | err |
subroutine hash_map_at(this, position, key, value, err) !! Fetch the entry at `position` in the iteration order, counting from 1. !! This is the exact-fidelity iteration accessor: `key` comes back with !! the key's true length, trailing blanks included. !! !! An out-of-range `position` yields `key == ""`, `value == 0` and !! `ERROR_VALIDATION` in `err` when it is present. class(hash_map_t), intent(in) :: this integer(default_int), intent(in) :: position character(len=:), allocatable, intent(out) :: key integer(int64), intent(out) :: value type(error_t), intent(out), optional :: err if (position < 1 .or. position > this%n_entries) then key = "" value = 0_int64 if (present(err)) then call err%set(ERROR_VALIDATION, "pic_hash_map: iteration index out of range") end if return end if key = entry_key(this, position) value = this%entry_value(position) end subroutine hash_map_at