dictionary_node Derived Type

type, public :: dictionary_node

type~~dictionary_node~~InheritsGraph type~dictionary_node dictionary_node type~dictionary_node->type~dictionary_node next, previous type~key_base key_base type~key_base->type~dictionary_node key
Help


Dictionary node class to storage any contents by means of generic key/content pairs.

Inherited By

type~~dictionary_node~~InheritedByGraph type~dictionary_node dictionary_node type~dictionary_node->type~dictionary_node next, previous type~dictionary dictionary type~dictionary_node->type~dictionary head, tail type~hash_table hash_table type~dictionary->type~hash_table bucket
Help

Source Code


Components

TypeVisibility AttributesNameInitial
type(key_base), public, allocatable:: key

The key.

class(*), private, pointer:: content_=> null()

The generic content.

type(dictionary_node), public, pointer:: next=> null()

The next node in the dictionary.

type(dictionary_node), public, pointer:: previous=> null()

The previous node in the dictionary.


Finalization Procedures

final :: finalize

Finalize the node.

  • private elemental subroutine finalize(self)

    Finalize the dictionary node.

    Arguments

    Type IntentOptional AttributesName
    type(dictionary_node), intent(inout) :: self

    The node.


Type-Bound Procedures

procedure, public, pass(self) :: destroy

Destroy the node (key & content).

  • private elemental subroutine destroy(self)

    Destroy the node (key & content).

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(inout) :: self

    The node.

procedure, public, pass(self) :: get_pointer

Return a pointer to node's content.

  • private function get_pointer(self) result(content)

    Return a pointer to node's content.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(in) :: self

    The node.

    Return Value class(*), pointer

    Content pointer of the node.

procedure, public, pass(self) :: has_key

Return .true. if the node has a key (or id) set-up.

  • private elemental function has_key(self)

    Return .true. if the node has a key (or id) set-up.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(in) :: self

    The node.

    Return Value logical

procedure, public, pass(self) :: is_filled

Return storage status.

  • private elemental function is_filled(self)

    Return storage status.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(in) :: self

    The node.

    Return Value logical

procedure, public, pass(self) :: set_pointer

Set the node pointer-associating content.

  • private subroutine set_pointer(self, key, content, buckets_number)

    Set the node pointer-associating content.

    Arguments

    Type IntentOptional AttributesName
    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.

procedure, public, pass(self) :: set_clone

Set the node cloning content.

  • private subroutine set_clone(self, key, content, buckets_number)

    Set the node cloning content.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(inout) :: self

    The node.

    class(*), intent(in) :: key

    The key.

    class(*), intent(in) :: content

    The content.

    integer(kind=I4P), intent(in), optional :: buckets_number

    Buckets number.

procedure, private, pass(self) :: destroy_key

Destroy the node key.

  • private elemental subroutine destroy_key(self)

    Destroy the node key.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(inout) :: self

    The node.

procedure, private, pass(self) :: destroy_content

Destroy the node content.

  • private elemental subroutine destroy_content(self)

    Destroy the node content.

    Arguments

    Type IntentOptional AttributesName
    class(dictionary_node), intent(inout) :: self

    The node.

Source Code

type :: dictionary_node
  !< **Dictionary node** class to storage any contents by means of generic key/content pairs.
  !<
  !< @note The `next/previous` members of this class are public because they can be safely handled by the [[dictionary]] class.
  type(key_base),        allocatable, public  :: key              !< The key.
  class(*),              pointer,     private :: content_=>null() !< The generic content.
  type(dictionary_node), pointer,     public  :: next=>null()     !< The next node in the dictionary.
  type(dictionary_node), pointer,     public  :: previous=>null() !< The previous node in the dictionary.
  contains
    ! public methods
    procedure, pass(self) :: destroy     !< Destroy the node (key & content).
    procedure, pass(self) :: get_pointer !< Return a pointer to node's content.
    procedure, pass(self) :: has_key     !< Return .true. if the node has a key (or id) set-up.
    procedure, pass(self) :: is_filled   !< Return storage status.
    procedure, pass(self) :: set_pointer !< Set the node pointer-associating content.
    procedure, pass(self) :: set_clone   !< Set the node cloning content.
    ! private methods
    procedure, pass(self), private :: destroy_key     !< Destroy the node key.
    procedure, pass(self), private :: destroy_content !< Destroy the node content.
    ! finalizer
    final :: finalize !< Finalize the node.
endtype dictionary_node