MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
listiteratormodule Module Reference

Data Types

interface  listiteratortype
 An iterator used to iterate through a List. More...
 

Functions/Subroutines

type(listiteratortype) function constructor (first_node)
 Constructor to create a ListIterator. More...
 
logical(lgp) function has_next (this)
 Indicates if there is a next node in the iteration chain. More...
 
subroutine next (this)
 Increment the iterator to the next node. More...
 
class(*) function, pointer value (this)
 Get the value the iterator is pointing at. More...
 

Function/Subroutine Documentation

◆ constructor()

type(listiteratortype) function listiteratormodule::constructor ( type(listnodetype), pointer  first_node)
private

Definition at line 33 of file ListIterator.f90.

34  type(ListNodeType), pointer :: first_node
35  type(ListIteratorType) :: iterator
36 
37  iterator%first_node => first_node
38  iterator%current_node => null()
39 
Here is the caller graph for this function:

◆ has_next()

logical(lgp) function listiteratormodule::has_next ( class(listiteratortype this)
private

Definition at line 45 of file ListIterator.f90.

46  class(ListIteratorType) :: this
47  logical(LGP) :: res
48 
49  if (associated(this%current_node)) then
50  res = associated(this%current_node%nextNode)
51  else
52  res = associated(this%first_node)
53  end if
54 

◆ next()

subroutine listiteratormodule::next ( class(listiteratortype this)
private

Definition at line 60 of file ListIterator.f90.

61  class(ListIteratorType) :: this
62 
63  if (associated(this%current_node)) then
64  this%current_node => this%current_node%nextNode
65  else
66  this%current_node => this%first_node
67  end if

◆ value()

class(*) function, pointer listiteratormodule::value ( class(listiteratortype this)
private

Definition at line 73 of file ListIterator.f90.

74  class(ListIteratorType) :: this
75  class(*), pointer :: res
76 
77  if (associated(this%current_node)) then
78  res => this%current_node%GetItem()
79  else
80  res => null()
81  end if
82