Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(fhash_node_t), | public, | allocatable | :: | buckets(:) |
Finalizer for fhash_tbl_t
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(fhash_tbl_t), | intent(inout) | :: | tbl |
Table object to allocate |
Allocate hash table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Table object to allocate |
||
integer, | intent(in), | optional | :: | size |
Number of buckets in hash table
If ommited, |
Unset a value in the table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to remove |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful.
Unsuccessful: FHASH_EMPTY_TABLE | |
Check if key exists in table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer, | intent(out) | :: | stat |
Status flag. Zero if key is found.
Unsuccessful: |
Get stats about the hash table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
integer, | intent(out), | optional | :: | num_buckets |
Number of buckets allocated in table |
|
integer, | intent(out), | optional | :: | num_items |
Number of key-value pairs stored in table |
|
integer, | intent(out), | optional | :: | num_collisions |
Number of hash collisions |
|
integer, | intent(out), | optional | :: | max_depth |
Maximum depth of bucket in table |
Set/update a polymorphic scalar value in the table
tbl
is allocated with default size if not already allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to set/update |
||
class(*), | intent(in), | target | :: | value |
Value for key |
|
logical, | intent(in), | optional | :: | pointer |
If .true., store a pointer to value instead of copying |
Set/update a polymorphic scalar value in the table
tbl
is allocated with default size if not already allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to set/update |
||
class(*), | intent(in), | target | :: | value |
Value for key |
|
logical, | intent(in), | optional | :: | pointer |
If .true., store a pointer to value instead of copying |
Get wrapper routine for generic 'set_ptr'
tbl
is allocated with default size if not already allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to set/update |
||
class(*), | intent(in), | target | :: | value |
Value for key |
Get wrapper routine for generic 'set_ptr'
tbl
is allocated with default size if not already allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(inout) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to set/update |
||
class(*), | intent(in), | target | :: | value |
Value for key |
Get wrapper to directly retrieve a scalar int64 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int64), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int32 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int32), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar double value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=dp), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar float value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=sp), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar logical value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
logical, | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar character value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
character(len=:), | intent(out), | allocatable | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve underlying polymorhpic scalar value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
class(*), | intent(out), | allocatable | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Retrieve data container from the hash table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
type(fhash_container_t), | pointer | :: | data |
Copy of value retrieved for key |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful.
Unsuccessful: |
Get wrapper to directly retrieve a scalar int32 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int32), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int64 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int64), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar float value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=sp), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar double value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=dp), | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar character value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
character(len=:), | intent(out), | allocatable | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar logical value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
logical, | intent(out) | :: | value |
Output value |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Retrieve data container from the hash table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
type(fhash_container_t), | pointer | :: | data |
Copy of value retrieved for key |
||
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful.
Unsuccessful: |
Get wrapper to directly retrieve underlying polymorhpic scalar value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
class(*), | intent(out), | allocatable | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int64 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int64), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int32 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int32), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar double value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=dp), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar float value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=sp), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar logical value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
logical, | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar character value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
character(len=:), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve underlying polymorhpic scalar value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
class(*), | intent(out), | pointer | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int32 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int32), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar int64 value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
integer(kind=int64), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar float value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=sp), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar double value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
real(kind=dp), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar character value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
character(len=:), | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve a scalar logical value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
logical, | intent(out), | pointer | :: | value |
Output value pointer |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |
Get wrapper to directly retrieve underlying polymorhpic scalar value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fhash_tbl_t), | intent(in) | :: | tbl |
Hash table object |
||
class(fhash_key_t), | intent(in) | :: | key |
Key to retrieve |
||
class(*), | intent(out), | pointer | :: | value |
Output value |
|
integer, | intent(out), | optional | :: | stat |
Status flag. Zero if successful. |