Return a node's content by cloning.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dictionary), | intent(in) | :: | self | The dictionary. |
||
class(*), | intent(in) | :: | key | The key. |
||
class(*), | intent(out), | allocatable | :: | content | Content of the queried node. |
subroutine get_clone(self, key, content)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return a node's content by cloning.
!---------------------------------------------------------------------------------------------------------------------------------
class(dictionary), intent(in) :: self !< The dictionary.
class(*), intent(in) :: key !< The key.
class(*), allocatable, intent(out) :: content !< Content of the queried node.
class(*), pointer :: content_p !< Content pointer of the queried node.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
content_p => self%get_pointer(key=key)
if (associated(content_p)) allocate(content, source=content_p)
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine get_clone