MONC
Private Member Functions | List of all members
collections_mod::c_integer_entry_at Interface Reference

Retrieves a map entry at a specific index. This is more efficient than calling key at and then value at (or get with the key) as only requires one search for both the key and value. More...

Private Member Functions

logical function map_integer_entry_at (specificmap, i, key, int_val)
 Retrieves the entry at a specific map index or null if index > map elements. More...
 
logical function hashmap_integer_entry_at (specificmap, i, key, int_val)
 Retrieves the entry at a specific map index. More...
 

Detailed Description

Retrieves a map entry at a specific index. This is more efficient than calling key at and then value at (or get with the key) as only requires one search for both the key and value.

This has a time complexity of O(n)

Parameters
collectionThe specific map involved
indexThe index to get value from
keyThe associated key
valueInteger value or raises an error if none is found

Definition at line 531 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_integer_entry_at()

logical function collections_mod::c_integer_entry_at::hashmap_integer_entry_at ( type(hashmap_type), intent(inout)  specificmap,
integer, intent(in)  i,
character(len=*), intent(out)  key,
integer, intent(out)  int_val 
)
private

Retrieves the entry at a specific map index.

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificmapThe specific map involved
iIndex to get value from
keyThe associated key
valueInteger value or raises an error if none is found

Definition at line 1553 of file collections.F90.

1554  type(hashmap_type), intent(inout) :: specificmap
1555  integer, intent(in) :: i
1556  character(len=*), intent(out) :: key
1557  integer, intent(out) :: int_val
1558 
1559  class(*), pointer :: generic
1560 
1561  hashmap_integer_entry_at=hashmap_generic_entry_at(specificmap, i, key, generic)
1562  if (.not. associated(generic)) call log_log(log_error, "Can not find integer entry with key '"//trim(key)//"'")
1563  int_val=conv_to_integer(generic, .false.)

◆ map_integer_entry_at()

logical function collections_mod::c_integer_entry_at::map_integer_entry_at ( type(map_type), intent(inout)  specificmap,
integer, intent(in)  i,
character(len=*), intent(out)  key,
integer, intent(out)  int_val 
)
private

Retrieves the entry at a specific map index or null if index > map elements.

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificmapThe specific map involved
iIndex to get value from
keyThe associated key
valueInteger value or raises an error if none is found

Definition at line 912 of file collections.F90.

913  type(map_type), intent(inout) :: specificmap
914  integer, intent(in) :: i
915  character(len=*), intent(out) :: key
916  integer, intent(out) :: int_val
917 
918  class(*), pointer :: generic
919 
920  map_integer_entry_at=map_generic_entry_at(specificmap, i, key, generic)
921  if (.not. associated(generic)) call log_log(log_error, "Can not find integer entry with key '"//trim(key)//"'")
922  int_val=conv_to_integer(generic, .false.)

The documentation for this interface was generated from the following file:
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75