hashtbl_obj_Print Subroutine

private impure subroutine hashtbl_obj_Print(this)

Uses

  • proc~~hashtbl_obj_print~~UsesGraph proc~hashtbl_obj_print hashtbl_obj%hashtbl_obj_Print iso_fortran_env iso_fortran_env proc~hashtbl_obj_print->iso_fortran_env

Type Bound

hashtbl_obj

Arguments

Type IntentOptional Attributes Name
class(hashtbl_obj), intent(inout), target :: this

Hashtable object


Source Code

    impure subroutine hashtbl_obj_Print(this)
      ! Prints to stdout the hashtable content.
      use iso_fortran_env, only : stdout => output_unit
      implicit none
      class(hashtbl_obj), intent(inout), &
                                 target :: this                                !! Hashtable object
      ! Work variables
      integer           :: n,m
      type(sllist_obj),  &
          pointer       :: current

      do n=1,this%vec_len
        m = 0
        if (this%vec(n)%key.ne.-1) then
          m = m + 1
          current => this%vec(n)
          select type(val => current%val)
          type is (real(leapDP))
            write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
          type is (real(leapSP))
            write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
          type is (integer(leapI4))
            write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
          type is (integer(leapI8))
            write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
          end select

          do while (associated(current%child))
            current => current%child
            select type(val => current%val)
            type is (real(leapDP))
              write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
            type is (real(leapSP))
              write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
            type is (integer(leapI4))
              write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
            type is (integer(leapI8))
              write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',current%key,val
            end select
          end do
        else
          write(stdout,*) "Bucket ID -- key-value pair:", n,' -- ',this%vec(n)%key,allocated(this%vec(n)%val)
        end if
      end do

      return
    end subroutine hashtbl_obj_Print