Key class to identify a node.
It can be extended by user.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=I8P), | private, | allocatable | :: | id_ | Unique key id. |
||
character(len=:), | private, | allocatable | :: | char_key_ | Store character key. |
Return an instance of key_base
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | key | The key value. |
||
integer(kind=I4P), | intent(in), | optional | :: | buckets_number | Buckets number. |
Instance of key_base.
Destroy the key.
Hash the key.
Hash the key.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(key_base), | intent(in) | :: | self | The key. |
||
integer(kind=I4P), | intent(in) | :: | buckets_number | Buckets number. |
Bucket index corresponding to the key.
Return the id.
Typeguard for used key.
Typeguard for used key.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | key | The key ID. |
Check result.
Set the key.
Return a string representation of the key.
Overloading ==
operator.
Implement ==
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(key_morton), | intent(in) | :: | lhs | Left hand side. |
||
class(*), | intent(in) | :: | rhs | Rigth hand side. |
Implement ==
operator.
Hash a string.
Hash a string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | The string. |
||
integer(kind=I4P), | intent(in) | :: | buckets_number | Buckets number. |
Bucket index corresponding to the string.
type :: key_base
!< **Key** class to identify a node.
!<
!< It can be extended by user.
private
integer(I8P), allocatable :: id_ !< Unique key id.
character(len=:), allocatable :: char_key_ !< Store character key.
contains
! public methods
procedure, pass(self) :: destroy !< Destroy the key.
procedure, pass(self) :: hash !< Hash the key.
procedure, pass(self) :: id !< Return the id.
procedure, nopass :: is_key_allowed !< Typeguard for used key.
procedure, pass(self) :: set !< Set the key.
procedure, pass(self) :: stringify !< Return a string representation of the key.
! public generics
generic, public :: operator(==) => is_equal !< Overloading `==` operator.
! private methods
procedure, pass(lhs), private :: is_equal !< Implement `==` operator.
procedure, nopass, private :: hash_string !< Hash a string.
endtype key_base