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.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(container), | private, | allocatable | :: | contents | Contains the value held in this node. |
Evaluates whether contents have been assigned to node.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(node), | intent(in) | :: | this |
Returns whether or not a values has been assigned to the node.
Returns the value stored in the node.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(node), | intent(in) | :: | this |
The stored in the node.
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.
Sets the value to be stored in the node.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
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.
Removes the record of any value stored in the node.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(node), | intent(inout) | :: | this |
Deallocates the value stored within the node.
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