get_node Subroutine

private subroutine get_node(me, key, p_node)

Returns a pointer to a node in a list.

Type Bound

list

Arguments

Type IntentOptional Attributes Name
class(list), intent(in) :: me
class(*), intent(in) :: key
type(node), intent(out), pointer :: p_node

Calls

proc~~get_node~~CallsGraph proc~get_node list%get_node proc~keys_equal list%keys_equal proc~get_node->proc~keys_equal proc~uppercase uppercase proc~keys_equal->proc~uppercase

Called by

proc~~get_node~~CalledByGraph proc~get_node list%get_node proc~add_pointer list%add_pointer proc~add_pointer->proc~get_node proc~get_data list%get_data proc~get_data->proc~get_node proc~remove_by_key list%remove_by_key proc~remove_by_key->proc~get_node proc~add_clone list%add_clone proc~add_clone->proc~add_pointer

Source Code

    subroutine get_node(me,key,p_node)

    implicit none

    class(list),intent(in)         :: me
    class(*),intent(in)            :: key
    type(node),pointer,intent(out) :: p_node

    type(node),pointer :: p

    nullify(p_node)

    p => me%head
    do
        if (associated(p)) then
            if (me%keys_equal(p%key,key)) then
                p_node => p
                return
            end if
            p => p%next
        else
            return !not found
        end if
    end do

    end subroutine get_node