libsim Versione 7.2.6

◆ currentdoubleprecision()

doubleprecision function currentdoubleprecision ( class(doubleprecisionlist) this)
private

get double precision pointed by iterator

Definizione alla linea 101 del file list_doubleprecision.F03.

102!> \brief class to use lists in fortran 2003.
103!!
104!! Linked data structure is a data structure which
105!! consists of a set of data records (nodes) linked together and organized by references .
106!!
107!! A doubly-linked list is a linked data structure that consists of a set
108!! of sequentially linked records called nodes. Each node contains two
109!! fields, called links, that are references to the previous and to the
110!! next node in the sequence of nodes. The beginning and ending nodes'
111!! previous and next links, respectively, point to some kind of
112!! terminator.
113!!
114!! The program example is the better starting point:
115!!\include example_list.F03
116!!\ingroup base
117!!
119 use list_abstract
120 private
121 public :: doubleprecisionlist
122!> Double precision specific implementation of doubly-linked list
123!!
124!! extend list_abstract::list
125 type, extends(list) :: doubleprecisionlist
126#ifdef DOXYGEN
127 integer::none ! doxigen workaround: if missed do not show procedure
128#endif
129 contains
130! procedure :: addDoubleprecision !< add doubleprecision in list
131 procedure :: current => currentdoubleprecision !< get doubleprecision pointed by iterator
132 procedure :: display => displaydoubleprecision !< print the doubleprecision list
133! generic :: add => addDoubleprecision
134 end type doubleprecisionlist
135
136contains
137
138!> Print the double precision list
139subroutine displaydoubleprecision(this)
140class(doubleprecisionList),intent(inout) :: this
141
142call this%rewind()
143do while(this%element())
144 print *,"index:",this%currentindex()," value:", this%current()
145 call this%next()
146end do
147end subroutine displaydoubleprecision
148
149!!$ subroutine addDoubleprecision(this, value)
150!!$ class(doubleprecisionList) :: this
151!!$ doubleprecision value
152!!$ class(*), allocatable :: v
153!!$
154!!$ allocate(v,source=value)
155!!$ call this%addvalue(v)
156!!$
157!!$ end subroutine addDoubleprecision
158
159
160!> get double precision pointed by iterator
161doubleprecision function currentdoubleprecision(this)
162class(doubleprecisionList) :: this
163class(*), pointer :: v
164
165v => this%currentpoli()
166select type(v)
167type is (doubleprecision)
168 currentdoubleprecision = v
169end select
170end function currentdoubleprecision
171
172end module list_doubleprecision
abstract class to use lists in fortran 2003.
class to use lists in fortran 2003.
Abstract implementation of doubly-linked list.
Double precision specific implementation of doubly-linked list.

Generated with Doxygen.