get_next Function

private function get_next(this)

Arguments

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

Return Value class(linked_node), pointer

Description

Returns a pointer to the node which this ones points to, i.e. the next node in the chain. If this node does not point at another one, then a null pointer is returned.


Source Code

  function get_next(this)
    !* Author: Chris MacMackin
    !  Date: February 2016
    !
    ! Returns a pointer to the node which this ones points to, i.e. the
    ! next node in the chain. If this node does not point at another 
    ! one, then a null pointer is returned.
    !
    class(linked_node), intent(in) :: this
    class(linked_node), pointer :: get_next
    if (this%has_next()) then
      get_next => this%next
    else
      get_next => null()
    end if
  end function get_next