Skip to content

Commit 03bf2bd

Browse files
committed
Add WrapperFactoryListSingleton and the root of the hierarchy.
Test modified acording to this changes
1 parent 5ac62fc commit 03bf2bd

13 files changed

+289
-208
lines changed

src/lib/FPL.f90

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module FPL
2+
3+
USE IR_Precision, only: I4P
4+
USE ParameterListEntryContainer
5+
USE WrapperFactoryListSingleton
6+
7+
public :: ParameterListEntryContainer_t
8+
9+
contains
10+
11+
subroutine FPL_Init()
12+
!-----------------------------------------------------------------
13+
!< Initialize FPL
14+
!-----------------------------------------------------------------
15+
call TheWrapperFactoryList_Init()
16+
end subroutine FPL_Init
17+
18+
19+
subroutine FPL_Finalize()
20+
!-----------------------------------------------------------------
21+
!< Finalize FPL
22+
!-----------------------------------------------------------------
23+
call TheWrapperFactoryList%Free()
24+
end subroutine FPL_Finalize
25+
26+
end module FPL

src/lib/ParameterListEntryContainer.f90

+19-21
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module ParameterListEntryContainer
1414

1515
USE IR_Precision
1616
USE ParameterListEntry
17-
USE WrapperFactoryList
17+
USE WrapperFactoryListSingleton
1818
USE WrapperFactory
1919
USE DimensionsWrapper
2020

@@ -26,7 +26,6 @@ module ParameterListEntryContainer
2626

2727
type, public:: ParameterListEntryContainer_t
2828
private
29-
type(WrapperFactoryList_t) :: WrapperFactoryList
3029
type(ParameterListEntry_t), allocatable :: DataBase(:)
3130
integer(I4P) :: Size = 0_I4P
3231
contains
@@ -67,7 +66,7 @@ module ParameterListEntryContainer
6766
ParameterListEntryContainer_Get5D, &
6867
ParameterListEntryContainer_Get6D, &
6968
ParameterListEntryContainer_Get7D
70-
! procedure, public :: isPresent => ParameterListEntryContainer_isPresent
69+
procedure, public :: isPresent => ParameterListEntryContainer_isPresent
7170
! procedure, public :: isOfDataType => ParameterListEntryContainer_isOfDataType
7271
! procedure, public :: isSubList => ParameterListEntryContainer_isSubList
7372
procedure, public :: Del => ParameterListEntryContainer_RemoveEntry
@@ -110,7 +109,6 @@ subroutine ParameterListEntryContainer_Init(this,Size)
110109
this%Size = DefaultDataBaseSize
111110
endif
112111
allocate(this%DataBase(0:this%Size-1))
113-
call this%WrapperFactoryList%Init()
114112
end subroutine ParameterListEntryContainer_Init
115113

116114

@@ -121,7 +119,6 @@ subroutine ParameterListEntryContainer_Free(this)
121119
class(ParameterListEntryContainer_t), intent(INOUT) :: this !< Parameter List Entry Containter type
122120
integer(I4P) :: DBIterator !< Database Iterator index
123121
!-----------------------------------------------------------------
124-
call this%WrapperFactoryList%Free()
125122
if (allocated(this%DataBase)) THEN
126123
do DBIterator=lbound(this%DataBase,dim=1),ubound(this%DataBase,dim=1)
127124
call this%DataBase(DBIterator)%Free()
@@ -152,7 +149,7 @@ subroutine ParameterListEntryContainer_Set0D(this,Key,Value)
152149
class(WrapperFactory_t), pointer :: WrapperFactory
153150
class(DimensionsWrapper_t), allocatable :: Wrapper
154151
!-----------------------------------------------------------------
155-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
152+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
156153
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
157154
if(allocated(Wrapper)) then
158155
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -172,7 +169,7 @@ subroutine ParameterListEntryContainer_Set1D(this,Key,Value)
172169
class(WrapperFactory_t), pointer :: WrapperFactory
173170
class(DimensionsWrapper_t), allocatable :: Wrapper
174171
!-----------------------------------------------------------------
175-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
172+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
176173
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
177174
if(allocated(Wrapper)) then
178175
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -192,7 +189,7 @@ subroutine ParameterListEntryContainer_Set2D(this,Key,Value)
192189
class(WrapperFactory_t), pointer :: WrapperFactory
193190
class(DimensionsWrapper_t), allocatable :: Wrapper
194191
!-----------------------------------------------------------------
195-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
192+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
196193
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
197194
if(allocated(Wrapper)) then
198195
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -212,7 +209,7 @@ subroutine ParameterListEntryContainer_Set3D(this,Key,Value)
212209
class(WrapperFactory_t), pointer :: WrapperFactory
213210
class(DimensionsWrapper_t), allocatable :: Wrapper
214211
!-----------------------------------------------------------------
215-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
212+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
216213
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
217214
if(allocated(Wrapper)) then
218215
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -232,7 +229,7 @@ subroutine ParameterListEntryContainer_Set4D(this,Key,Value)
232229
class(WrapperFactory_t), pointer :: WrapperFactory
233230
class(DimensionsWrapper_t), allocatable :: Wrapper
234231
!-----------------------------------------------------------------
235-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
232+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
236233
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
237234
if(allocated(Wrapper)) then
238235
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -252,7 +249,7 @@ subroutine ParameterListEntryContainer_Set5D(this,Key,Value)
252249
class(WrapperFactory_t), pointer :: WrapperFactory
253250
class(DimensionsWrapper_t), allocatable :: Wrapper
254251
!-----------------------------------------------------------------
255-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
252+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
256253
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
257254
if(allocated(Wrapper)) then
258255
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -272,7 +269,7 @@ subroutine ParameterListEntryContainer_Set6D(this,Key,Value)
272269
class(WrapperFactory_t), pointer :: WrapperFactory
273270
class(DimensionsWrapper_t), allocatable :: Wrapper
274271
!-----------------------------------------------------------------
275-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
272+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
276273
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
277274
if(allocated(Wrapper)) then
278275
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -292,7 +289,7 @@ subroutine ParameterListEntryContainer_Set7D(this,Key,Value)
292289
class(WrapperFactory_t), pointer :: WrapperFactory
293290
class(DimensionsWrapper_t), allocatable :: Wrapper
294291
!-----------------------------------------------------------------
295-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
292+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
296293
if(associated(WrapperFactory)) call WrapperFactory%Wrap(Value=Value, Wrapper=Wrapper)
297294
if(allocated(Wrapper)) then
298295
call this%DataBase(this%Hash(Key=Key))%AddNode(Key=Key,Value=Wrapper)
@@ -319,7 +316,7 @@ subroutine ParameterListEntryContainer_Get0D(this,Key,Value)
319316
type is (ParameterListEntry_t)
320317
call Node%GetValue(Value=Wrapper)
321318
if(allocated(Wrapper)) then
322-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
319+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
323320
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
324321
endif
325322
end select
@@ -344,7 +341,7 @@ subroutine ParameterListEntryContainer_Get1D(this,Key,Value)
344341
type is (ParameterListEntry_t)
345342
call Node%GetValue(Value=Wrapper)
346343
if(allocated(Wrapper)) then
347-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
344+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
348345
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
349346
endif
350347
end select
@@ -369,7 +366,7 @@ subroutine ParameterListEntryContainer_Get2D(this,Key,Value)
369366
type is (ParameterListEntry_t)
370367
call Node%GetValue(Value=Wrapper)
371368
if(allocated(Wrapper)) then
372-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
369+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
373370
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
374371
endif
375372
end select
@@ -394,7 +391,7 @@ subroutine ParameterListEntryContainer_Get3D(this,Key,Value)
394391
type is (ParameterListEntry_t)
395392
call Node%GetValue(Value=Wrapper)
396393
if(allocated(Wrapper)) then
397-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
394+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
398395
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
399396
endif
400397
end select
@@ -419,7 +416,7 @@ subroutine ParameterListEntryContainer_Get4D(this,Key,Value)
419416
type is (ParameterListEntry_t)
420417
call Node%GetValue(Value=Wrapper)
421418
if(allocated(Wrapper)) then
422-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
419+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
423420
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
424421
endif
425422
end select
@@ -444,7 +441,7 @@ subroutine ParameterListEntryContainer_Get5D(this,Key,Value)
444441
type is (ParameterListEntry_t)
445442
call Node%GetValue(Value=Wrapper)
446443
if(allocated(Wrapper)) then
447-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
444+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
448445
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
449446
endif
450447
end select
@@ -469,7 +466,7 @@ subroutine ParameterListEntryContainer_Get6D(this,Key,Value)
469466
type is (ParameterListEntry_t)
470467
call Node%GetValue(Value=Wrapper)
471468
if(allocated(Wrapper)) then
472-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
469+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
473470
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
474471
endif
475472
end select
@@ -494,7 +491,7 @@ subroutine ParameterListEntryContainer_Get7D(this,Key,Value)
494491
type is (ParameterListEntry_t)
495492
call Node%GetValue(Value=Wrapper)
496493
if(allocated(Wrapper)) then
497-
WrapperFactory => this%WrapperFactoryList%GetFactory(Value=Value)
494+
WrapperFactory => TheWrapperFactoryList%GetFactory(Value=Value)
498495
if(associated(WrapperFactory)) call WrapperFactory%UnWrap(Wrapper=Wrapper, Value=Value)
499496
endif
500497
end select
@@ -569,6 +566,7 @@ subroutine ParameterListEntryContainer_Print(this, unit, prefix, iostat, iomsg)
569566
endif
570567
if (present(iostat)) iostat = iostatd
571568
if (present(iomsg)) iomsg = iomsgd
569+
call TheWrapperFactoryList%Print(unit=unit)
572570
end subroutine ParameterListEntryContainer_Print
573571

574572

0 commit comments

Comments
 (0)