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

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

Private Member Functions

integer function list_get_int (specificlist, i)
 Retrieves the element at index i from the list. More...
 
integer function stack_get_int (specificstack, i)
 Gets a specific element from the stack at index specified. More...
 
integer function queue_get_int (specificqueue, i)
 Returns a specific queue element at an index. More...
 
integer function map_get_int (specificmap, key)
 Gets a specific element out of the map with the corresponding key. More...
 
integer function hashmap_get_int (specificmap, key)
 Gets a specific element out of the hashmap with the corresponding key. More...
 
integer function mapentry_get_int (mapentry_item)
 Retrieves the integer value from a map entry. More...
 

Detailed Description

Gets a specific integer 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
Integer value associated with the key or raises an error if none exists

Definition at line 378 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_get_int()

integer function collections_mod::c_get_integer::hashmap_get_int ( 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
Integer value associated with the key or raises an error if none is found

Definition at line 1695 of file collections.F90.

1696  type(hashmap_type), intent(inout) :: specificmap
1697  character(len=*), intent(in) :: key
1698  integer :: hashmap_get_int
1699 
1700  class(*), pointer :: generic
1701 
1702  generic=>hashmap_get_generic(specificmap, key)
1703  if (.not. associated(generic)) call log_log(log_error, "Can not find integer entry with key '"//trim(key)//"'")
1704  hashmap_get_int=conv_to_integer(generic, .false.)

◆ list_get_int()

integer function collections_mod::c_get_integer::list_get_int ( 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
Integer data in the list or raises an error if none is found

Definition at line 3038 of file collections.F90.

3039  type(list_type), intent(inout) :: specificlist
3040  integer, intent(in) :: i
3041  integer :: list_get_int
3042 
3043  class(*), pointer :: generic
3044 
3045  generic=>list_get_generic(specificlist, i)
3046  if (.not. associated(generic)) call log_log(log_error, "Can not get integer from list at index "//trim(conv_to_string(i)))
3047  list_get_int=conv_to_integer(generic, .false.)

◆ map_get_int()

integer function collections_mod::c_get_integer::map_get_int ( 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
Integer value associated with the key or raises an error if none is found

Definition at line 1057 of file collections.F90.

1058  type(map_type), intent(inout) :: specificmap
1059  character(len=*), intent(in) :: key
1060  integer :: map_get_int
1061 
1062  class(*), pointer :: generic
1063 
1064  generic=>map_get_generic(specificmap, key)
1065  if (.not. associated(generic)) call log_log(log_error, "Can not find integer entry with key '"//trim(key)//"'")
1066  map_get_int=conv_to_integer(generic, .false.)

◆ mapentry_get_int()

integer function collections_mod::c_get_integer::mapentry_get_int ( type(mapentry_type), intent(in)  mapentry_item)
private

Retrieves the integer value from a map entry.

Parameters
mapentry_itemThe map entry to retrieve the integer value from

Definition at line 3320 of file collections.F90.

3321  type(mapentry_type), intent(in) :: mapentry_item
3322  integer :: mapentry_get_int
3323 
3324  class(*), pointer :: generic
3325 
3326  generic=>mapentry_item%value
3327  if (.not. associated(generic)) call log_log(log_error, "Can not get integer from map entry")
3328  mapentry_get_int=conv_to_integer(generic, .false.)

◆ queue_get_int()

integer function collections_mod::c_get_integer::queue_get_int ( 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
Integer element at i or raises an error if none is found

Definition at line 2644 of file collections.F90.

2645  type(queue_type), intent(inout) :: specificqueue
2646  integer, intent(in) :: i
2647  integer :: queue_get_int
2648 
2649  class(*), pointer :: generic
2650 
2651  generic=>queue_get_generic(specificqueue, i)
2652  if (.not. associated(generic)) call log_log(log_error, "Can not get integer from queue at index "//trim(conv_to_string(i)))
2653  queue_get_int=conv_to_integer(generic, .false.)

◆ stack_get_int()

integer function collections_mod::c_get_integer::stack_get_int ( 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
Integer data or raises an error if none is found

Definition at line 2348 of file collections.F90.

2349  type(stack_type), intent(inout) :: specificstack
2350  integer, intent(in) :: i
2351  integer :: stack_get_int
2352 
2353  class(*), pointer :: generic
2354 
2355  generic=>stack_get_generic(specificstack, i)
2356  if (.not. associated(generic)) call log_log(log_error, "Can not get integer from stack at index "//trim(conv_to_string(i)))
2357  stack_get_int=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