libsim  Versione 7.2.4
list_link.F03
1 
7 module list_link
8  private
9  public :: link
11  type link
12  private
13  class(*), pointer :: value => null()
14  type(link), pointer :: next => null()
15  type(link), pointer :: prev => null()
16  contains
17  procedure :: getValue
18  procedure :: nextLink
19  procedure :: prevLink
20  procedure :: setNextLink
21  procedure :: setPrevLink
22  end type link
23 
25  interface link
26  procedure constructor
27  end interface
28 
29 contains
30 
31 function nextlink(this)
32 class(link) :: this
33 class(link), pointer :: nextLink
34 nextlink => this%next
35 end function nextlink
36 
37 function prevlink(this)
38 class(link) :: this
39 class(link), pointer :: prevLink
40 prevlink => this%prev
41 end function prevlink
42 
43 subroutine setnextlink(this,next)
44 class(link) :: this
45 type(link), pointer :: next
46 this%next => next
47 end subroutine setnextlink
48 
49 subroutine setprevlink(this,prev)
50 class(link) :: this
51 type(link), pointer :: prev
52 this%prev => prev
53 end subroutine setprevlink
54 
55 function getvalue(this)
56 class(link),intent(in) :: this
57 class(*), pointer :: getValue
58 getvalue => this%value
59 end function getvalue
60 
62 function constructor(value)
63 type(link),pointer :: constructor
64 class(*),intent(in) :: value
65 allocate(constructor)
66 constructor%prev => null()
67 constructor%next => null()
68 allocate(constructor%value, source=value)
69 end function constructor
70 
71 end module list_link

Generated with Doxygen.