AbstractComposite.F90 Source File


Files dependent on this one

sourcefile~~abstractcomposite.f90~~AfferentGraph sourcefile~abstractcomposite.f90 AbstractComposite.F90 sourcefile~compositecomponent.f90 CompositeComponent.F90 sourcefile~compositecomponent.f90->sourcefile~abstractcomposite.f90 sourcefile~concretecomposite.f90 ConcreteComposite.F90 sourcefile~compositecomponent.f90->sourcefile~concretecomposite.f90 sourcefile~concretecomposite.f90->sourcefile~abstractcomposite.f90 sourcefile~stringcompositemap.f90 StringCompositeMap.F90 sourcefile~concretecomposite.f90->sourcefile~stringcompositemap.f90 sourcefile~mapl_generic.f90~2 MAPL_Generic.F90 sourcefile~mapl_generic.f90~2->sourcefile~abstractcomposite.f90 sourcefile~mapl_generic.f90~2->sourcefile~concretecomposite.f90 sourcefile~stringcompositemap.f90->sourcefile~abstractcomposite.f90 sourcefile~test_concretecomposite.pf Test_ConcreteComposite.pf sourcefile~test_concretecomposite.pf->sourcefile~abstractcomposite.f90 sourcefile~test_concretecomposite.pf->sourcefile~concretecomposite.f90 sourcefile~baseframeworkcomponent.f90 BaseFrameworkComponent.F90 sourcefile~baseframeworkcomponent.f90->sourcefile~compositecomponent.f90 sourcefile~comp_testing_driver.f90 Comp_Testing_Driver.F90 sourcefile~comp_testing_driver.f90->sourcefile~mapl_generic.f90~2 sourcefile~driver.f90~2 driver.F90 sourcefile~driver.f90~2->sourcefile~compositecomponent.f90 sourcefile~driver.f90~2->sourcefile~concretecomposite.f90 sourcefile~extdatagridcompmod.f90 ExtDataGridCompMod.F90 sourcefile~extdatagridcompmod.f90->sourcefile~mapl_generic.f90~2 sourcefile~extdatagridcompng.f90 ExtDataGridCompNG.F90 sourcefile~extdatagridcompng.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl.f90 MAPL.F90 sourcefile~mapl.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_capgridcomp.f90 MAPL_CapGridComp.F90 sourcefile~mapl_capgridcomp.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_geosatmaskmod.f90 MAPL_GeosatMaskMod.F90 sourcefile~mapl_geosatmaskmod.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_historycollection.f90 MAPL_HistoryCollection.F90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_historygridcomp.f90 MAPL_HistoryGridComp.F90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_orbgridcompmod.f90 MAPL_OrbGridCompMod.F90 sourcefile~mapl_orbgridcompmod.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_stationsamplermod.f90 MAPL_StationSamplerMod.F90 sourcefile~mapl_stationsamplermod.f90->sourcefile~mapl_generic.f90~2 sourcefile~mapl_trajectorymod.f90 MAPL_TrajectoryMod.F90 sourcefile~mapl_trajectorymod.f90->sourcefile~mapl_generic.f90~2 sourcefile~maplgenericcomponent.f90 MaplGenericComponent.F90 sourcefile~maplgenericcomponent.f90->sourcefile~compositecomponent.f90 sourcefile~maplgenericcomponent.f90->sourcefile~concretecomposite.f90 sourcefile~test_compositecomponent.pf Test_CompositeComponent.pf sourcefile~test_compositecomponent.pf->sourcefile~compositecomponent.f90

Source Code

module mapl_AbstractComposite
   implicit none
   private

   public :: AbstractComposite

   type, abstract :: AbstractComposite
   contains
      procedure(i_GetChildByName), deferred :: get_child_by_name
      procedure(i_GetChildByIndex), deferred :: get_child_by_index
      generic :: get_child => get_child_by_name, get_child_by_index
      procedure(i_AddChild), deferred :: add_child
      procedure(i_GetParent), deferred :: get_parent
      procedure(i_GetNum), deferred :: get_num_children
!!$      procedure :: is_leaf
!!$      procedure :: is_root
!!$      procedure :: get_height
   end type AbstractComposite

   abstract interface

      function i_GetChildByName(this, name) result(child)
         import AbstractComposite
         class(AbstractComposite), pointer :: child
         class(AbstractComposite), target, intent(in) :: this
         character(*), intent(in) :: name
      end function i_GetChildByName

      function i_GetChildByIndex(this, i) result(child)
         import AbstractComposite
         class(AbstractComposite), pointer :: child
         class(AbstractComposite), target, intent(in) :: this
         integer, intent(in) :: i
      end function i_GetChildByIndex

      function i_AddChild(this, name, composite) result(child)
         import AbstractComposite
         class(AbstractComposite), pointer :: child
         class(AbstractComposite), target, intent(inout) :: this
         character(*), intent(in) :: name
         class(AbstractComposite), intent(in) :: composite
      end function i_AddChild

      function i_GetParent(this) result(parent)
         import AbstractComposite
         class(AbstractComposite), pointer :: parent
         class(AbstractComposite), intent(in) :: this
      end function i_GetParent

      integer function i_GetNum(this) result(num)
         import AbstractComposite
         class(AbstractComposite), intent(in) :: this
      end function i_GetNum

   end interface

end module mapl_AbstractComposite