实现 chaining_hashmap_type
类型的类型 (规范)
返回打开哈希表上的子程序调用次数 (规范)
参数:map - 打开的哈希表
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(in) | :: | map |
字符键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - 字符数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
logical, | intent(out) | :: | present |
将条目插入哈希表中 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 key - 条目的键 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
logical, | intent(out), | optional | :: | existed |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的字符值键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回哈希表中的条目数 (规范)
参数:map - 打开的哈希表
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(in) | :: | map |
返回哈希表中包含的所有键 参数:map - 链式哈希表 all_keys - 哈希表中包含的所有键
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(in) | :: | map | |||
type(key_type), | intent(out), | allocatable | :: | all_keys(:) |
Int8 键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
Int32 键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
字符键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
例程用于分配一个空表,其中 HASHER 为哈希函数,2SLOTS_BITS 为初始 SIZE(map % slots),并且 SIZE(map % slots) 限制为不超过 2MAX_BITS。所有字段都被初始化。参数:map - 要初始化的链式哈希表 hasher - 用于将键映射到槽的哈希函数 slots_bits - 用于初始化槽数的 2 的幂 status - 整数错误状态标志,允许的值为:success - 未发现任何问题 alloc_fault - 无法分配 map % slots 或 map % inverse array_size_error - slots_bits 小于 default_bits 或大于 max_bits
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(out) | :: | map | |||
procedure(hasher_fun) | :: | hasher | ||||
integer, | intent(in), | optional | :: | slots_bits | ||
integer(kind=int32), | intent(out), | optional | :: | status |
Int32 键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - int32 数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
logical, | intent(out) | :: | present |
将条目插入哈希表中 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 key - 条目的键 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
logical, | intent(out), | optional | :: | existed |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的 int32 数组键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
Int8 键通用接口,用于 get_other_data 函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - int8 数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
logical, | intent(out) | :: | present |
Int8 通用接口,用于映射条目 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 value - int8 数组键,指向条目 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
logical, | intent(out), | optional | :: | existed |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的 int8 数组键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回与反向表索引关联的其他数据 参数:map - 链式哈希表 key - 与映射条目关联的键 other - 与键关联的其他数据 exists - 一个逻辑标志,指示是否有一个具有该键的条目存在
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
type(key_type), | intent(in) | :: | key | |||
type(other_type), | intent(out) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回一个逻辑标志,指示 KEY 是否出现在哈希表中 参数:map - 感兴趣的哈希表 key - 感兴趣的键 present - 一个逻辑标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
type(key_type), | intent(in) | :: | key | |||
logical, | intent(out) | :: | present |
map - 感兴趣的哈希表 key - 标识条目的键 other - 与键关联的其他数据 conflict - 逻辑标志,指示条目键是否与现有键冲突
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
type(key_type), | intent(in) | :: | key | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 key - 条目的键 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
type(key_type), | intent(in) | :: | key | |||
logical, | intent(out), | optional | :: | existed |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 key - 条目在表中的键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
type(key_type), | intent(in) | :: | key | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - int8 数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
logical, | intent(out) | :: | present |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - int32 数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
logical, | intent(out) | :: | present |
返回一个逻辑标志,指示 KEY 是否存在于哈希表中 (规范)
参数:map - 感兴趣的哈希表 value - 字符数组,是查找的键。
present - 一个标志,指示键是否出现在表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
logical, | intent(out) | :: | present |
返回哈希映射中条目相对于槽位的数量 参数:map - 链式哈希映射
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(in) | :: | map |
Int8 通用接口,用于映射条目 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
将条目插入哈希表中 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
将条目插入哈希表中 (规范)
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(in), | optional | :: | other | ||
logical, | intent(out), | optional | :: | conflict |
返回哈希映射上的探测总数 (规格)
参数:map - 打开的哈希表
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(in) | :: | map |
返回哈希映射中分配的槽位数 (规格)
参数:map - 打开的哈希表
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(in) | :: | map |
将表条目的哈希方法更改为 HASHER 的方法。参数:map 要重新哈希的表 hasher 要用于表的哈希函数
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(inout) | :: | map | |||
procedure(hasher_fun) | :: | hasher |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 value - int8 数组键,指向条目 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
logical, | intent(out), | optional | :: | existed |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 key - 条目的键 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
logical, | intent(out), | optional | :: | existed |
删除具有键的条目(如果有) 参数:map - 要从中删除条目的表 key - 条目的键 existed - 一个逻辑标志,指示具有键的条目是否出现在原始表中
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
logical, | intent(out), | optional | :: | existed |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的 int8 数组键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int8), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的 int32 数组键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
integer(kind=int32), | intent(in) | :: | value(:) | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
更改与键关联的其他数据 参数:map - 包含感兴趣条目的表 value - 条目在表中的字符值键 other - 与键关联的新数据 exists - 一个逻辑标志,指示键是否已在表中输入
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(inout) | :: | map | |||
character(len=*), | intent(in) | :: | value | |||
type(other_type), | intent(in) | :: | other | |||
logical, | intent(out), | optional | :: | exists |
返回用于指定哈希映射中分配的槽位数量的位数 (规格)
参数:map - 打开的哈希表
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(hashmap_type), | intent(in) | :: | map |
返回哈希映射中槽位条目与其槽位索引之间的基于一的偏移量的总数 参数:map - 链式哈希映射
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
class(chaining_hashmap_type), | intent(in) | :: | map |
type, extends(hashmap_type) :: chaining_hashmap_type !! Version: Experimental !! !! Type implementing the `chaining_hashmap_type` types !! ([Specifications](../page/specs/stdlib_hashmaps.html#the-chaining_hashmap_type-derived-type)) private type(chaining_map_entry_pool), pointer :: cache => null() !! Pool of allocated chaining_map_entry_type objects type(chaining_map_entry_type), pointer :: free_list => null() !! free list of map entries type(chaining_map_entry_ptr), allocatable :: inverse(:) !! Array of bucket lists (inverses) Note max_elts=size(inverse) type(chaining_map_entry_ptr), allocatable :: slots(:) !! Array of bucket lists Note # slots=size(slots) contains procedure :: get_all_keys => get_all_chaining_keys procedure :: key_get_other_data => get_other_chaining_data procedure :: init => init_chaining_map procedure :: loading => chaining_loading procedure :: key_map_entry => map_chain_entry procedure :: rehash => rehash_chaining_map procedure :: key_remove_entry => remove_chaining_entry procedure :: key_set_other_data => set_other_chaining_data procedure :: total_depth => total_chaining_depth procedure :: key_key_test => chaining_key_test final :: free_chaining_map end type chaining_hashmap_type