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

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

Private Member Functions

class(*) function, pointer map_generic_at (specificmap, i)
 Retrieves the generic value held at the specific map index or null if index > map elements. More...
 
class(*) function, pointer hashmap_generic_at (specificmap, i)
 Retrieves the value held at the specific hashmap index or null if index > map elements. 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 generic 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
Generic pointer to the value

Definition at line 467 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_generic_at()

class(*) function, pointer collections_mod::c_generic_at::hashmap_generic_at ( type(hashmap_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the value held at the specific hashmap index or null if index > map elements. 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
Pointer to the generic value

Definition at line 1528 of file collections.F90.

1529  type(hashmap_type), intent(inout) :: specificmap
1530  integer, intent(in) :: i
1531 
1532  class(*), pointer :: raw_map_node, hashmap_generic_at
1533 
1534  raw_map_node=>hashmap_getnode_atindex(specificmap, i)
1535  if (associated(raw_map_node)) then
1536  select type(raw_map_node)
1537  type is (mapnode_type)
1538  hashmap_generic_at=>raw_map_node%value
1539  end select
1540  return
1541  else
1542  hashmap_generic_at=>null()
1543  end if

◆ map_generic_at()

class(*) function, pointer collections_mod::c_generic_at::map_generic_at ( type(map_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the generic value held at the 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
Returns
Pointer to the generic value

Definition at line 884 of file collections.F90.

885  type(map_type), intent(inout) :: specificmap
886  integer, intent(in) :: i
887 
888  class(*), pointer :: raw_map_node, map_generic_at
889  integer :: the_map_size
890 
891  the_map_size = map_size(specificmap)
892  if (i .le. the_map_size) then
893  raw_map_node=>list_get_generic(specificmap%map_ds, i)
894  if (associated(raw_map_node)) then
895  select type(raw_map_node)
896  type is (mapnode_type)
897  map_generic_at => raw_map_node%value
898  end select
899  return
900  end if
901  end if
902  map_generic_at=>null()

The documentation for this interface was generated from the following file: