MAPL_CFIOAddCollection Function

public function MAPL_CFIOAddCollection(template) result(id)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: template

Return Value integer


Calls

proc~~mapl_cfioaddcollection~~CallsGraph proc~mapl_cfioaddcollection MAPL_CFIOAddCollection none~begin~206 CFIOCollectionVector%begin proc~mapl_cfioaddcollection->none~begin~206 none~get~127 CFIOCollectionVectorIterator%get proc~mapl_cfioaddcollection->none~get~127 none~next~125 CFIOCollectionVectorIterator%next proc~mapl_cfioaddcollection->none~next~125 none~push_back~58 CFIOCollectionVector%push_back proc~mapl_cfioaddcollection->none~push_back~58 proc~new_cfiocollection new_CFIOCollection proc~mapl_cfioaddcollection->proc~new_cfiocollection none~capacity~343 CFIOCollectionVector%capacity none~push_back~58->none~capacity~343 none~resize~116 CFIOCollectionVector%resize none~push_back~58->none~resize~116 none~resize_32~38 CFIOCollectionVector%resize_32 none~resize~116->none~resize_32~38 none~resize_32~38->none~resize~116

Source Code

  function MAPL_CFIOAddCollection(template) result(id)
     character(len=*), intent(in) :: template
      integer :: n
      logical :: found
      type (CFIOCollectionVectorIterator) :: iter
      type (CFIOCollection), pointer :: collection
      type (CFIOCollection) :: c
      integer :: id

      iter = collections%begin()
      n = 1

      ! Is it a new collection?
      found = .false.
      do while (iter /= collections%end())
         collection => iter%get()
         if (template == collection%template) then
            found = .true.
            exit
         end if
         n = n + 1
         call iter%next()
      end do

      if (.not. found) then
         c = new_CFIOCollection(template)
         call collections%push_back(c)
      end if

      id = n

   end function MAPL_CFIOAddCollection