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~50 CFIOCollectionVector%begin proc~mapl_cfioaddcollection->none~begin~50 none~get~83 CFIOCollectionVectorIterator%get proc~mapl_cfioaddcollection->none~get~83 none~next~45 CFIOCollectionVectorIterator%next proc~mapl_cfioaddcollection->none~next~45 none~push_back~29 CFIOCollectionVector%push_back proc~mapl_cfioaddcollection->none~push_back~29 proc~new_cfiocollection new_CFIOCollection proc~mapl_cfioaddcollection->proc~new_cfiocollection none~capacity~169 CFIOCollectionVector%capacity none~push_back~29->none~capacity~169 none~resize~58 CFIOCollectionVector%resize none~push_back~29->none~resize~58 none~resize_32~26 CFIOCollectionVector%resize_32 none~resize~58->none~resize_32~26 none~resize_32~26->none~resize~58

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