Skip to content

Commit

Permalink
Update stdlib_hashmap_wrappers.f90
Browse files Browse the repository at this point in the history
Added get_inte32_key function.
  • Loading branch information
chuckyvt committed Mar 30, 2024
1 parent 418cb82 commit 561cee2
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions src/stdlib_hashmap_wrappers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ end function hasher_fun

module procedure get_char_key, &
get_int8_key, &
get_int32_key, &
get_other

end interface get
Expand Down Expand Up @@ -278,6 +279,21 @@ subroutine get_int8_key( key, value )
end subroutine get_int8_key


subroutine get_int32_key( key, value )
!! Version: Experimental
!!
!! Gets the contents of the key as an INTEGER(INT8) vector
!! Arguments:
!! key - the input key
!! value - the contents of key mapped to an INTEGER(INT32) vector
type(key_type), intent(in) :: key
integer(int32), allocatable, intent(out) :: value(:)

value = transfer( key % value, value )

end subroutine get_int8_key


subroutine set_char_key( key, value )
!! Version: Experimental
!!
Expand Down Expand Up @@ -309,21 +325,6 @@ subroutine set_other( other, value )
end subroutine set_other


subroutine set_int32_key( key, value )
!! Version: Experimental
!!
!! Sets the contents of the key from an INTEGER(INT8) vector
!! Arguments:
!! key - the output key
!! value - the input INTEGER(INT32) vector
type(key_type), intent(out) :: key
integer(int32), intent(in) :: value(:)

key % value = transfer(value, key % value)

end subroutine set_int32_key


subroutine set_int8_key( key, value )
!! Version: Experimental
!!
Expand All @@ -339,6 +340,21 @@ subroutine set_int8_key( key, value )
end subroutine set_int8_key


subroutine set_int32_key( key, value )
!! Version: Experimental
!!
!! Sets the contents of the key from an INTEGER(INT8) vector
!! Arguments:
!! key - the output key
!! value - the input INTEGER(INT32) vector
type(key_type), intent(out) :: key
integer(int32), intent(in) :: value(:)

key % value = transfer(value, key % value)

end subroutine set_int32_key


pure function fnv_1_hasher( key )
!! Version: Experimental
!!
Expand Down

0 comments on commit 561cee2

Please sign in to comment.