get_prev Function

private function get_prev(this)

Arguments

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

Return Value class(bidir_node), pointer

Description

Returns a pointer to the previous node in the chain. If this node does not point at a previous one one, then a null pointer is returned.


Source Code

  function get_prev(this)
    !* Author: Chris MacMackin
    !  Date: February 2016
    !
    ! Returns a pointer to the previous node in the chain. If this node
    ! does not point at a previous one one, then a null pointer is
    ! returned.
    !
    class(bidir_node), intent(in) :: this
    class(bidir_node), pointer :: get_prev
    if (this%has_prev()) then
      get_prev => this%prev
    else
      get_prev => null()
    end if
  end function get_prev