libsim Versione 7.1.11

◆ constructor()

type(link) function, pointer constructor ( class(*), intent(in)  value)
private

Constructor.

Parametri
[in]valuevalue for list

Definizione alla linea 103 del file list_link.F03.

104
110module list_link
111 private
112 public :: link
114 type link
115 private
116 class(*), pointer :: value => null()
117 type(link), pointer :: next => null()
118 type(link), pointer :: prev => null()
119 contains
120 procedure :: getValue
121 procedure :: nextLink
122 procedure :: prevLink
123 procedure :: setNextLink
124 procedure :: setPrevLink
125 end type link
126
128 interface link
129 procedure constructor
130 end interface
131
132contains
133
134function nextlink(this)
135class(link) :: this
136class(link), pointer :: nextLink
137nextlink => this%next
138end function nextlink
139
140function prevlink(this)
141class(link) :: this
142class(link), pointer :: prevLink
143prevlink => this%prev
144end function prevlink
145
146subroutine setnextlink(this,next)
147class(link) :: this
148type(link), pointer :: next
149this%next => next
150end subroutine setnextlink
151
152subroutine setprevlink(this,prev)
153class(link) :: this
154type(link), pointer :: prev
155this%prev => prev
156end subroutine setprevlink
157
158function getvalue(this)
159class(link),intent(in) :: this
160class(*), pointer :: getValue
161getvalue => this%value
162end function getvalue
163
165function constructor(value)
166type(link),pointer :: constructor
167class(*),intent(in) :: value
168allocate(constructor)
169constructor%prev => null()
170constructor%next => null()
171allocate(constructor%value, source=value)
172end function constructor
173
174end module list_link

Generated with Doxygen.