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~97 CFIOCollectionVector%begin proc~mapl_cfioaddcollection->none~begin~97 none~get~73 CFIOCollectionVectorIterator%get proc~mapl_cfioaddcollection->none~get~73 none~next~67 CFIOCollectionVectorIterator%next proc~mapl_cfioaddcollection->none~next~67 none~push_back~33 CFIOCollectionVector%push_back proc~mapl_cfioaddcollection->none~push_back~33 proc~new_cfiocollection new_CFIOCollection proc~mapl_cfioaddcollection->proc~new_cfiocollection none~capacity~193 CFIOCollectionVector%capacity none~push_back~33->none~capacity~193 none~resize~66 CFIOCollectionVector%resize none~push_back~33->none~resize~66 none~resize_32~21 CFIOCollectionVector%resize_32 none~resize~66->none~resize_32~21 none~resize_32~21->none~resize~66

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