MONC
Private Member Functions | List of all members
collections_mod::c_logical_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_logical_entry_at (specificmap, i, key, logical_val)
 Retrieves the entry at a specific map index or null if index > map elements. More...
 
logical function hashmap_logical_entry_at (specificmap, i, key, logical_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
valueLogical value or raises an error if none is found

Definition at line 567 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_logical_entry_at()

logical function collections_mod::c_logical_entry_at::hashmap_logical_entry_at ( type(hashmap_type), intent(inout)  specificmap,
integer, intent(in)  i,
character(len=*), intent(out)  key,
logical, intent(out)  logical_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
valueLogical value or raises an error if none is found

Definition at line 1620 of file collections.F90.

1621  type(hashmap_type), intent(inout) :: specificmap
1622  integer, intent(in) :: i
1623  character(len=*), intent(out) :: key
1624  logical, intent(out) :: logical_val
1625 
1626  class(*), pointer :: generic
1627 
1628  hashmap_logical_entry_at=hashmap_generic_entry_at(specificmap, i, key, generic)
1629  if (.not. associated(generic)) call log_log(log_error, "Can not find logical entry with key '"//trim(key)//"'")
1630  logical_val=conv_to_logical(generic, .false.)

◆ map_logical_entry_at()

logical function collections_mod::c_logical_entry_at::map_logical_entry_at ( type(map_type), intent(inout)  specificmap,
integer, intent(in)  i,
character(len=*), intent(out)  key,
logical, intent(out)  logical_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
valueLogical value or raises an error if none is found

Definition at line 979 of file collections.F90.

980  type(map_type), intent(inout) :: specificmap
981  integer, intent(in) :: i
982  character(len=*), intent(out) :: key
983  logical, intent(out) :: logical_val
984 
985  class(*), pointer :: generic
986 
987  map_logical_entry_at=map_generic_entry_at(specificmap, i, key, generic)
988  if (.not. associated(generic)) call log_log(log_error, "Can not find logical entry with key '"//trim(key)//"'")
989  logical_val=conv_to_logical(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