libsim  Versione 7.1.7
list_character.F03
1 
17 module list_character
19  use list_linkchar
20  private
21  public :: characterlist, toarray_charl
25  type, extends(list) :: characterlist
26 #ifdef DOXYGEN
27  integer::none ! doxigen workaround: if missed do not show procedure
28 #endif
29  contains
30 ! procedure :: addCharacter !< add character in list
31  procedure :: current => currentcharacter
32  procedure :: display => displaycharacter
33 ! generic :: add => addCharacter
34  end type characterlist
35 
36 contains
37 
39 subroutine displaycharacter(this)
40 class(characterList) :: this
41 
42 call this%rewind()
43 do while(this%element())
44 
45  print *,"index:",this%currentindex()," value:", trim(this%current())
46  call this%next()
47 end do
48 end subroutine displaycharacter
49 
50 !!$ subroutine addCharacter(this, value)
51 !!$ class(characterList) :: this
52 !!$ character value
53 !!$ class(*), allocatable :: v
54 !!$
55 !!$ allocate(v,source=value)
56 !!$ call this%addvalue(v)
57 !!$
58 !!$ end subroutine addCharacter
59 
60 
62 function currentcharacter(this)
63 character(len=listcharmaxlen) :: currentCharacter
64 class(characterList) :: this
65 
66 currentcharacter = this%currentpoli()
67 
68 end function currentcharacter
69 
70 
72 function toarray_charl(this)
73 character(len=listcharmaxlen),allocatable :: toarray_charl(:)
74 type(characterlist) :: this
75 
76 integer :: i
77 
78 allocate (toarray_charl(this%countelements()))
79 
80 call this%rewind()
81 i=0
82 do while(this%element())
83  i=i+1
84  toarray_charl(i) =this%current()
85  call this%next()
86 end do
87 end function toarray_charl
88 
89 
90 
91 end module list_character
like abstract class to use character lists in fortran 2003 (gnu gcc 4.8 do not work with character(le...
class to use character lists in fortran 2003 WARNING !!!! CHAR LEN IS FIXED TO listcharmaxlen.
class to manage links for lists in fortran 2003.
Abstract implementation of doubly-linked list.
Character specific implementation of doubly-linked list.

Generated with Doxygen.