node_mod Module

module~~node_mod~~UsesGraph module~node_mod node_mod module~abstract_container_mod abstract_container_mod module~abstract_container_mod->module~node_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~abstract_container_mod
Help

Provides a node data type, for holding some sort of contents. While a node itself is unlikely to be very useful, various type extensions are also made which are then 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.

Used By

module~~node_mod~~UsedByGraph module~node_mod node_mod module~linked_node_mod linked_node_mod module~node_mod->module~linked_node_mod module~bidir_node_mod bidir_node_mod module~linked_node_mod->module~bidir_node_mod
Help

Derived Types

type, public :: node

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.

procedure, public, non_overridable :: get_contents

Returns the value stored in the node.

procedure, public, non_overridable :: set_contents

Sets the value to be stored in the node.

procedure, public, non_overridable :: unset_contents

Removes the record of any value stored in the node.

Description

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.


Functions

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.

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.


Subroutines

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.

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.