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

Gets a specific logical element out of the list, stack, queue or map with the corresponding key. More...

Private Member Functions

logical function list_get_logical (specificlist, i)
 Retrieves the element at index i from the list. More...
 
logical function stack_get_logical (specificstack, i)
 Gets a specific element from the stack at index specified. More...
 
logical function queue_get_logical (specificqueue, i)
 Returns a specific queue element at an index. More...
 
logical function map_get_logical (specificmap, key)
 Gets a specific element out of the map with the corresponding key. More...
 
logical function hashmap_get_logical (specificmap, key)
 Gets a specific element out of the hashmap with the corresponding key. More...
 
logical function mapentry_get_logical (mapentry_item)
 Retrieves the logical value from a map entry. More...
 

Detailed Description

Gets a specific logical element out of the list, stack, queue or map with the corresponding key.

This has a time complexity of O(n)

Parameters
collectionThe specific list, stack, queue or map involved
keyString look up key
Returns
Logical value associated with the key or raises an error if none exists

Definition at line 409 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_get_logical()

logical function collections_mod::c_get_logical::hashmap_get_logical ( type(hashmap_type), intent(inout)  specificmap,
character(len=*), intent(in)  key 
)
private

Gets a specific element out of the hashmap with the corresponding key.

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

Parameters
specificmapThe specific hashmap involved
keyLook up key
Returns
Logical value associated with the key or raises an error if none is found

Definition at line 1756 of file collections.F90.

1757  type(hashmap_type), intent(inout) :: specificmap
1758  character(len=*), intent(in) :: key
1759  logical :: hashmap_get_logical
1760 
1761  class(*), pointer :: generic
1762 
1763  generic=>hashmap_get_generic(specificmap, key)
1764  if (.not. associated(generic)) call log_log(log_error, "Can not find logical entry with key '"//trim(key)//"'")
1765  hashmap_get_logical=conv_to_logical(generic, .false.)

◆ list_get_logical()

logical function collections_mod::c_get_logical::list_get_logical ( type(list_type), intent(inout)  specificlist,
integer, intent(in)  i 
)
private

Retrieves the element at index i from the list.

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

Parameters
specificlistThe specific list involved
iIndex to look up
Returns
Logical data in the list or raises an error if none is found

Definition at line 3099 of file collections.F90.

3100  type(list_type), intent(inout) :: specificlist
3101  integer, intent(in) :: i
3102  logical :: list_get_logical
3103 
3104  class(*), pointer :: generic
3105 
3106  generic=>list_get_generic(specificlist, i)
3107  if (.not. associated(generic)) call log_log(log_error, "Can not get logical from list at index "//trim(conv_to_string(i)))
3108  list_get_logical=conv_to_logical(generic, .false.)

◆ map_get_logical()

logical function collections_mod::c_get_logical::map_get_logical ( type(map_type), intent(inout)  specificmap,
character(len=*), intent(in)  key 
)
private

Gets a specific element out of the map with the corresponding key.

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

Parameters
specificmapThe specific map involved
keyLook up key
Returns
Logical value associated with the key or raises an error if none is found

Definition at line 1118 of file collections.F90.

1119  type(map_type), intent(inout) :: specificmap
1120  character(len=*), intent(in) :: key
1121  logical :: map_get_logical
1122 
1123  class(*), pointer :: generic
1124 
1125  generic=>map_get_generic(specificmap, key)
1126  if (.not. associated(generic)) call log_log(log_error, "Can not find logical entry with key '"//trim(key)//"'")
1127  map_get_logical=conv_to_logical(generic, .false.)

◆ mapentry_get_logical()

logical function collections_mod::c_get_logical::mapentry_get_logical ( type(mapentry_type), intent(in)  mapentry_item)
private

Retrieves the logical value from a map entry.

Parameters
mapentry_itemThe map entry to retrieve the logical value from

Definition at line 3366 of file collections.F90.

3367  type(mapentry_type), intent(in) :: mapentry_item
3368  logical :: mapentry_get_logical
3369 
3370  class(*), pointer :: generic
3371 
3372  generic=>mapentry_item%value
3373  if (.not. associated(generic)) call log_log(log_error, "Can not get logical from map entry")
3374  mapentry_get_logical=conv_to_logical(generic, .false.)

◆ queue_get_logical()

logical function collections_mod::c_get_logical::queue_get_logical ( type(queue_type), intent(inout)  specificqueue,
integer, intent(in)  i 
)
private

Returns a specific queue element at an index.

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

Parameters
specificqueueThe specific queue involved
iThe index to look up
Returns
Logical element at i or raises an error if none is found

Definition at line 2705 of file collections.F90.

2706  type(queue_type), intent(inout) :: specificqueue
2707  integer, intent(in) :: i
2708  logical :: queue_get_logical
2709 
2710  class(*), pointer :: generic
2711 
2712  generic=>queue_get_generic(specificqueue, i)
2713  if (.not. associated(generic)) call log_log(log_error, "Can not get logical from queue at index "//trim(conv_to_string(i)))
2714  queue_get_logical=conv_to_logical(generic, .false.)

◆ stack_get_logical()

logical function collections_mod::c_get_logical::stack_get_logical ( type(stack_type), intent(inout)  specificstack,
integer, intent(in)  i 
)
private

Gets a specific element from the stack at index specified.

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

Parameters
specificstackThe specific stack involved
iThe index to retrieve the element at
Returns
Logical data or raises an error if none is found

Definition at line 2409 of file collections.F90.

2410  type(stack_type), intent(inout) :: specificstack
2411  integer, intent(in) :: i
2412  logical :: stack_get_logical
2413 
2414  class(*), pointer :: generic
2415 
2416  generic=>stack_get_generic(specificstack, i)
2417  if (.not. associated(generic)) call log_log(log_error, "Can not get logical from stack at index "//trim(conv_to_string(i)))
2418  stack_get_logical=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