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

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