libsim  Versione 7.1.7
list_linkchar.F03
1 
7 module 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 
31 contains
32 
33 function nextlink(this)
34 class(link) :: this
35 class(link), pointer :: nextLink
36 nextlink => this%next
37 end function nextlink
38 
39 function prevlink(this)
40 class(link) :: this
41 class(link), pointer :: prevLink
42 prevlink => this%prev
43 end function prevlink
44 
45 subroutine setnextlink(this,next)
46 class(link) :: this
47 type(link), pointer :: next
48 this%next => next
49 end subroutine setnextlink
50 
51 subroutine setprevlink(this,prev)
52 class(link) :: this
53 type(link), pointer :: prev
54 this%prev => prev
55 end subroutine setprevlink
56 
57 function getvalue(this)
58 class(link) :: this
59 character(len=listcharmaxlen) :: getvalue
60 getvalue = this%value
61 end function getvalue
62 
64 function constructor(value)
65 type(link),pointer :: constructor
66 character (len=*) :: value
67 
68 allocate(constructor)
69 constructor%prev => null()
70 constructor%next => null()
71 constructor%value=value
72 
73 end function constructor
74 
75 end module list_linkchar
class to manage links for lists in fortran 2003.

Generated with Doxygen.