libsim Versione 7.2.4
list_link.F03
1
7module 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
29contains
30
31function nextlink(this)
32class(link) :: this
33class(link), pointer :: nextLink
34nextlink => this%next
35end function nextlink
36
37function prevlink(this)
38class(link) :: this
39class(link), pointer :: prevLink
40prevlink => this%prev
41end function prevlink
42
43subroutine setnextlink(this,next)
44class(link) :: this
45type(link), pointer :: next
46this%next => next
47end subroutine setnextlink
49subroutine setprevlink(this,prev)
50class(link) :: this
51type(link), pointer :: prev
52this%prev => prev
53end subroutine setprevlink
55function getvalue(this)
56class(link),intent(in) :: this
57class(*), pointer :: getvalue
58getvalue => this%value
59end function getvalue
62function constructor(value)
63type(link),pointer :: constructor
64class(*),intent(in) :: value
65allocate(constructor)
66constructor%prev => null()
67constructor%next => null()
68allocate(constructor%value, source=value)
69end function constructor
70
71end module list_link

Generated with Doxygen.