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

Retrieves the string value held at the specific map index or null if index > map elements. More...

Private Member Functions

character(len=string_length) function map_string_at (specificmap, i)
 Retrieves the string value held at the specific map index. More...
 
character(len=string_length) function hashmap_string_at (specificmap, i)
 Retrieves the value held at the specific hashmap index. Note that this is an expensive operation has it has to potentially process all internal hashed lists so avoid if can. More...
 

Detailed Description

Retrieves the string value held at the specific map index or null if index > map elements.

This has a time complexity of O(n)

Parameters
collectionThe specific map involved
indexThe index to get value from
Returns
String value or raises an error if none is found

Definition at line 487 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_string_at()

character(len=string_length) function collections_mod::c_string_at::hashmap_string_at ( type(hashmap_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the value held at the specific hashmap index. Note that this is an expensive operation has it has to potentially process all internal hashed lists so avoid if can.

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

Parameters
specificmapThe specific hashmap involved
iIndex to get value from
Returns
String value or raises an error if none is found

Definition at line 1464 of file collections.F90.

1465  type(hashmap_type), intent(inout) :: specificmap
1466  integer, intent(in) :: i
1467  character(len=STRING_LENGTH) :: hashmap_string_at
1468 
1469  class(*), pointer :: generic
1470 
1471  generic=>hashmap_generic_at(specificmap, i)
1472  if (.not. associated(generic)) call log_log(log_error, "Can not find string at "//trim(conv_to_string(i)))
1473  hashmap_string_at=conv_to_string(generic, .false., string_length)

◆ map_string_at()

character(len=string_length) function collections_mod::c_string_at::map_string_at ( type(map_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the string value held at the 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
Returns
String value or raises an error if none is found

Definition at line 823 of file collections.F90.

824  type(map_type), intent(inout) :: specificmap
825  integer, intent(in) :: i
826  character(len=STRING_LENGTH) :: map_string_at
827 
828  class(*), pointer :: generic
829 
830  generic=>map_generic_at(specificmap, i)
831  if (.not. associated(generic)) call log_log(log_error, "Can not find string at "//trim(conv_to_string(i)))
832  map_string_at=conv_to_string(generic, .false., string_length)

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