ProvidedServiceGet Subroutine

public subroutine ProvidedServiceGet(provider_list, advertised_service, bundle, rc)

Arguments

Type IntentOptional Attributes Name
type(providedServiceItemVector), intent(in) :: provider_list
character(len=*), intent(in) :: advertised_service
type(ESMF_FieldBundle), intent(out) :: bundle
integer, intent(out), optional :: rc

Calls

proc~~providedserviceget~~CallsGraph proc~providedserviceget ProvidedServiceGet interface~mapl_assert MAPL_Assert proc~providedserviceget->interface~mapl_assert none~begin~166 providedServiceItemVector%begin proc~providedserviceget->none~begin~166 none~get~102 providedServiceItemVectorIterator%get proc~providedserviceget->none~get~102 none~next~104 providedServiceItemVectorIterator%next proc~providedserviceget->none~next~104 proc~mapl_return MAPL_Return proc~providedserviceget->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Called by

proc~~providedserviceget~~CalledByGraph proc~providedserviceget ProvidedServiceGet proc~mapl_genericinitialize MAPL_GenericInitialize proc~mapl_genericinitialize->proc~providedserviceget

Source Code

  subroutine ProvidedServiceGet(provider_list, advertised_service, bundle, rc)
    type(ProvidedServiceItemVector), intent(IN) :: provider_list
    character(len=*), intent(IN) :: advertised_service
    type(ESMF_FieldBundle), intent(OUT) :: bundle
    integer, optional, intent(out) :: rc
    
    logical :: found
    type (ProvidedServiceItemVectorIterator) :: iter
    type (ProvidedServiceType), pointer :: item
    
    _ASSERT(provider_list%size()>0,'provider_list should not be empty')
    
    found = .false.
    iter = provider_list%begin()
    ! loop over provided services
    do while (iter /= provider_list%end())
       item => iter%get()
       if(item%service_name == advertised_service) then
          found = .true.
          bundle = item%bundle
          exit
       end if
    end do
    _ASSERT(found, 'No match found for service')
    call iter%next()
    _RETURN(_SUCCESS)
  end subroutine ProvidedServiceGet