Typeguard for used key.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | key | The key ID. |
Check result.
elemental function is_key_allowed(key)
!---------------------------------------------------------------------------------------------------------------------------------
!< Typeguard for used key.
!---------------------------------------------------------------------------------------------------------------------------------
class(*), intent(in) :: key !< The key ID.
logical :: is_key_allowed !< Check result.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
is_key_allowed = .false.
select type(key)
class is(key_base)
is_key_allowed = .true.
type is(integer(I1P))
if (key>0) is_key_allowed = .true.
type is(integer(I2P))
if (key>0) is_key_allowed = .true.
type is(integer(I4P))
if (key>0) is_key_allowed = .true.
type is(integer(I8P))
if (key>0) is_key_allowed = .true.
type is(character(len=*))
is_key_allowed = .true.
endselect
!---------------------------------------------------------------------------------------------------------------------------------
endfunction is_key_allowed