get_contents Function

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

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.


Source Code

  pure function get_contents(this)
    !* 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.
    !
    class(node), intent(in) :: this
    class(container), allocatable :: get_contents !! The stored in the node.
    if (this%has_contents()) allocate(get_contents, source=this%contents)
  end function get_contents