Set the node pointer-associating content.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary_node), | intent(inout) | :: | self | The node. |
||
class(*), | intent(in) | :: | key | The key. |
||
class(*), | intent(in), | pointer | :: | content | The content. |
|
integer(kind=I4P), | intent(in), | optional | :: | buckets_number | Buckets number. |
subroutine set_pointer(self, key, content, buckets_number)
!---------------------------------------------------------------------------------------------------------------------------------
!< Set the node pointer-associating content.
!---------------------------------------------------------------------------------------------------------------------------------
class(dictionary_node), intent(inout) :: self !< The node.
class(*), intent(in) :: key !< The key.
class(*), pointer, intent(in) :: content !< The content.
integer(I4P), intent(in), optional :: buckets_number !< Buckets number.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
call self%destroy_key
allocate(self%key, source=key_base(key=key, buckets_number=buckets_number))
call self%destroy_content
self%content_ => content
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine set_pointer