dict_i4tuple_callstat_items Function

private function dict_i4tuple_callstat_items(dict) result(items)

Returns a pointer to an array of all key/value-items stored in the dictionary. Caution: The caller is responsible for deallocating targeted array after usage.

Arguments

TypeIntentOptionalAttributesName
type(dict_i4tuple_callstat_type), intent(inout) :: dict

Return Value type(dict_i4tuple_callstat_item_type),dimension(:),POINTER


Contents


Source Code

      FUNCTION dict_i4tuple_callstat_items(dict) RESULT(items)
      !! Returns a pointer to an array of all key/value-items stored in the dictionary.
      !! Caution: The caller is responsible for deallocating targeted array after usage.
         TYPE(dict_i4tuple_callstat_type), intent(inout)  :: dict
         TYPE(dict_i4tuple_callstat_item_type), dimension(:), POINTER :: items

         TYPE(private_item_type_i4tuple_callstat), POINTER  :: item
         INTEGER :: i, j

         IF (.not. ASSOCIATED(dict%buckets)) &
            DBCSR_ABORT("dict_i4tuple_callstat_items: dictionary is not initialized.")

         allocate (items(dict%size))
         j = 1
         do i = 1, size(dict%buckets)
            item => dict%buckets(i)%p
            do while (ASSOCIATED(item))
               items(j)%key =item%key
               items(j)%value =>item%value
               j = j + 1
               item => item%next
            end do
         end do

         IF (j /= dict%size + 1) &
            DBCSR_ABORT("dict_i4tuple_callstat_items: assertion failed!")
      END FUNCTION dict_i4tuple_callstat_items