Skip to content

Commit

Permalink
Add WrapperFactoryListSingleton and the root of the hierarchy.
Browse files Browse the repository at this point in the history
Test modified acording to this changes
  • Loading branch information
femparadmin committed Oct 22, 2015
1 parent 5ac62fc commit 03bf2bd
Show file tree
Hide file tree
Showing 13 changed files with 289 additions and 208 deletions.
26 changes: 26 additions & 0 deletions src/lib/FPL.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module FPL

USE IR_Precision, only: I4P
USE ParameterListEntryContainer
USE WrapperFactoryListSingleton

public :: ParameterListEntryContainer_t

contains

subroutine FPL_Init()
!-----------------------------------------------------------------
!< Initialize FPL
!-----------------------------------------------------------------
call TheWrapperFactoryList_Init()
end subroutine FPL_Init


subroutine FPL_Finalize()
!-----------------------------------------------------------------
!< Finalize FPL
!-----------------------------------------------------------------
call TheWrapperFactoryList%Free()
end subroutine FPL_Finalize

end module FPL
40 changes: 19 additions & 21 deletions src/lib/ParameterListEntryContainer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ParameterListEntryContainer

USE IR_Precision
USE ParameterListEntry
USE WrapperFactoryList
USE WrapperFactoryListSingleton
USE WrapperFactory
USE DimensionsWrapper

Expand All @@ -26,7 +26,6 @@ module ParameterListEntryContainer

type, public:: ParameterListEntryContainer_t
private
type(WrapperFactoryList_t) :: WrapperFactoryList
type(ParameterListEntry_t), allocatable :: DataBase(:)
integer(I4P) :: Size = 0_I4P
contains
Expand Down Expand Up @@ -67,7 +66,7 @@ module ParameterListEntryContainer
ParameterListEntryContainer_Get5D, &
ParameterListEntryContainer_Get6D, &
ParameterListEntryContainer_Get7D
! procedure, public :: isPresent => ParameterListEntryContainer_isPresent
procedure, public :: isPresent => ParameterListEntryContainer_isPresent
! procedure, public :: isOfDataType => ParameterListEntryContainer_isOfDataType
! procedure, public :: isSubList => ParameterListEntryContainer_isSubList
procedure, public :: Del => ParameterListEntryContainer_RemoveEntry
Expand Down Expand Up @@ -110,7 +109,6 @@ subroutine ParameterListEntryContainer_Init(this,Size)
this%Size = DefaultDataBaseSize
endif
allocate(this%DataBase(0:this%Size-1))
call this%WrapperFactoryList%Init()
end subroutine ParameterListEntryContainer_Init


Expand All @@ -121,7 +119,6 @@ subroutine ParameterListEntryContainer_Free(this)
class(ParameterListEntryContainer_t), intent(INOUT) :: this !< Parameter List Entry Containter type
integer(I4P) :: DBIterator !< Database Iterator index
!-----------------------------------------------------------------
call this%WrapperFactoryList%Free()
if (allocated(this%DataBase)) THEN
do DBIterator=lbound(this%DataBase,dim=1),ubound(this%DataBase,dim=1)
call this%DataBase(DBIterator)%Free()
Expand Down Expand Up @@ -152,7 +149,7 @@ subroutine ParameterListEntryContainer_Set0D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -172,7 +169,7 @@ subroutine ParameterListEntryContainer_Set1D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -192,7 +189,7 @@ subroutine ParameterListEntryContainer_Set2D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -212,7 +209,7 @@ subroutine ParameterListEntryContainer_Set3D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -232,7 +229,7 @@ subroutine ParameterListEntryContainer_Set4D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -252,7 +249,7 @@ subroutine ParameterListEntryContainer_Set5D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -272,7 +269,7 @@ subroutine ParameterListEntryContainer_Set6D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -292,7 +289,7 @@ subroutine ParameterListEntryContainer_Set7D(this,Key,Value)
class(WrapperFactory_t), pointer :: WrapperFactory
class(DimensionsWrapper_t), allocatable :: Wrapper
!-----------------------------------------------------------------
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
if(allocated(Wrapper)) then
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
Expand All @@ -319,7 +316,7 @@ subroutine ParameterListEntryContainer_Get0D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -344,7 +341,7 @@ subroutine ParameterListEntryContainer_Get1D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -369,7 +366,7 @@ subroutine ParameterListEntryContainer_Get2D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -394,7 +391,7 @@ subroutine ParameterListEntryContainer_Get3D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -419,7 +416,7 @@ subroutine ParameterListEntryContainer_Get4D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -444,7 +441,7 @@ subroutine ParameterListEntryContainer_Get5D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -469,7 +466,7 @@ subroutine ParameterListEntryContainer_Get6D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand All @@ -494,7 +491,7 @@ subroutine ParameterListEntryContainer_Get7D(this,Key,Value)
type is (ParameterListEntry_t)
call Node%GetValue(Value=Wrapper)
if(allocated(Wrapper)) then
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
endif
end select
Expand Down Expand Up @@ -569,6 +566,7 @@ subroutine ParameterListEntryContainer_Print(this, unit, prefix, iostat, iomsg)
endif
if (present(iostat)) iostat = iostatd
if (present(iomsg)) iomsg = iomsgd
call TheWrapperFactoryList%Print(unit=unit)
end subroutine ParameterListEntryContainer_Print


Expand Down
Loading

0 comments on commit 03bf2bd

Please sign in to comment.