libsim Versione 7.2.1
list_linkchar.F03
1
7module list_linkchar
8 parameter(listcharmaxlen=10)
9
10 private
11 public :: link, listcharmaxlen
13 type link
14 private
15 character(len=listcharmaxlen) :: value = ""
16 type(link), pointer :: next => null()
17 type(link), pointer :: prev => null()
18 contains
19 procedure :: getValue
20 procedure :: nextLink
21 procedure :: prevLink
22 procedure :: setNextLink
23 procedure :: setPrevLink
24 end type link
25
27 interface link
28 procedure constructor
29 end interface
30
31contains
32
33function nextlink(this)
34class(link) :: this
35class(link), pointer :: nextLink
36nextlink => this%next
37end function nextlink
38
39function prevlink(this)
40class(link) :: this
41class(link), pointer :: prevLink
42prevlink => this%prev
43end function prevlink
44
45subroutine setnextlink(this,next)
46class(link) :: this
47type(link), pointer :: next
48this%next => next
49end subroutine setnextlink
50
51subroutine setprevlink(this,prev)
52class(link) :: this
53type(link), pointer :: prev
54this%prev => prev
55end subroutine setprevlink
57function getvalue(this)
58class(link) :: this
59character(len=listcharmaxlen) :: getvalue
60getvalue = this%value
61end function getvalue
64function constructor(value)
65type(link),pointer :: constructor
66character (len=*) :: value
67
68allocate(constructor)
69constructor%prev => null()
70constructor%next => null()
71constructor%value=value
72
73end function constructor
74
75end module list_linkchar
class to manage links for lists in fortran 2003.

Generated with Doxygen.