Return a pointer to a node's content in the hash table.
The result is associated only if the queried node belongs to the current CAF image, otherwise pointer association is not allowed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hash_table), | intent(in) | :: | self | The hash table. |
||
class(*), | intent(in) | :: | key | The key. |
Content pointer of the queried node.
function get_pointer(self, key) result(content)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return a pointer to a node's content in the hash table.
!<
!< @note The result is associated only if the queried node belongs to the current CAF image, otherwise pointer association is
!< not allowed.
!---------------------------------------------------------------------------------------------------------------------------------
class(hash_table), intent(in) :: self !< The hash table.
class(*), intent(in) :: key !< The key.
class(*), pointer :: content !< Content pointer of the queried node.
integer(I4P) :: b !< Bucket index.
integer(I4P) :: i !< Image index.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
content => null()
if (self%is_initialized_) then
call self%get_bucket_image_indexes(key=key, bucket=b, image=i)
if (b>0.and.i==self%me) then
content => self%bucket(b)%get_pointer(key=key)
endif
endif
!---------------------------------------------------------------------------------------------------------------------------------
endfunction get_pointer