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~4 CFIOCollectionVector%begin proc~mapl_cfioaddcollection->none~begin~4 none~get~8 CFIOCollectionVectorIterator%get proc~mapl_cfioaddcollection->none~get~8 none~next~3 CFIOCollectionVectorIterator%next proc~mapl_cfioaddcollection->none~next~3 none~push_back~3 CFIOCollectionVector%push_back proc~mapl_cfioaddcollection->none~push_back~3 proc~new_cfiocollection new_CFIOCollection proc~mapl_cfioaddcollection->proc~new_cfiocollection none~capacity~13 CFIOCollectionVector%capacity none~push_back~3->none~capacity~13 none~resize~6 CFIOCollectionVector%resize none~push_back~3->none~resize~6 none~resize_32~3 CFIOCollectionVector%resize_32 none~resize~6->none~resize_32~3 none~resize_32~3->none~resize~6

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