node Derived Type

type, public :: node

type~~node~~InheritsGraph type~node node type~container container type~container->type~node contents
Help


An object which contains a container that can be set to have arbitrary contents. While of limited use on its own, various derived types exist which are extensions of this one exist and are used to build more complex data structures.

It is not anticipated that the node type, or any types extending it, will be handled directly by end users of FIAT; they are meant for internal use within this package.

Inherited By

type~~node~~InheritedByGraph type~node node type~linked_node linked_node type~node->type~linked_node type~linked_node->type~linked_node next type~bidir_node bidir_node type~linked_node->type~bidir_node type~bidir_node->type~bidir_node prev
Help

Components

TypeVisibility AttributesNameInitial
class(container), private, allocatable:: contents

Contains the value held in this node.


Type-Bound Procedures

procedure, public, non_overridable :: has_contents

Evaluates whether contents have been assigned to node.

  • private elemental function has_contents(this)

    Arguments

    Type IntentOptional AttributesName
    class(node), intent(in) :: this

    Return Value logical

    Description

    Author
    Chris MacMackin
    Date
    February 2016

    Returns whether or not a values has been assigned to the node.

procedure, public, non_overridable :: get_contents

Returns the value stored in the node.

  • private pure function get_contents(this)

    Arguments

    Type IntentOptional AttributesName
    class(node), intent(in) :: this

    Return Value class(container), allocatable

    The stored in the node.

    Description

    Author
    Chris MacMackin
    Date
    February 2016

    An accessor returning a container object storing the value placed in the node. If the contents have not been set then an unallocated container is returned.

procedure, public, non_overridable :: set_contents

Sets the value to be stored in the node.

  • private subroutine set_contents(this, contents)

    Arguments

    Type IntentOptional AttributesName
    class(node), intent(inout) :: this
    class(container), intent(inout), allocatable:: contents

    The new value to be stored in this node. The actual argument will be deallocated during the process of assigning it to the node.

    Description

    Author
    Chris MacMackin
    Date
    February 2016

    Places a new value into storage within the node. This value must already be heald within an allocatable container. The actual argument will be deallocated after the subroutine call, as its allocation is moved to the contents of the node.

procedure, public, non_overridable :: unset_contents

Removes the record of any value stored in the node.

  • private subroutine unset_contents(this)

    Arguments

    Type IntentOptional AttributesName
    class(node), intent(inout) :: this

    Description

    Author
    Chris MacMackin
    Date
    February 2016

    Deallocates the value stored within the node.

Source Code

  type, public :: node
    !* Author: Chris MacMackin
    !  Date: February 2016
    ! 
    ! An object which contains a container that can be set to have
    ! arbitrary contents. While of limited use on its own, various
    ! derived types exist which are extensions of this one exist and
    ! are used to build more complex data structures.
    !
    ! It is not anticipated that the node type, or any types extending it,
    ! will be handled directly by end users of FIAT; they are meant for
    ! internal use within this package.
    !
    private
    class(container), allocatable :: contents 
      !! Contains the value held in this node.
  contains
    procedure, non_overridable :: has_contents 
      !! Evaluates whether contents have been assigned to node.
    procedure, non_overridable :: get_contents
      !! Returns the value stored in the node.
    procedure, non_overridable :: set_contents
      !! Sets the value to be stored in the node.
    procedure, non_overridable :: unset_contents
      !! Removes the record of any value stored in the node.
  end type node