MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
keyvaluelistiteratormodule Module Reference

Data Types

interface  keyvaluelistiteratortype
 An iterator used to iterate through a KeyValueList. More...
 

Functions/Subroutines

type(keyvaluelistiteratortype) function constructor (first_node)
 Constructor to create a KeyValueListIterator. More...
 
type(logical) 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(keyvaluelistiteratortype) function keyvaluelistiteratormodule::constructor ( type(keyvaluenodetype), intent(in), pointer  first_node)

Definition at line 28 of file KeyValueListIterator.f90.

29  type(KeyValueNodeType), pointer, intent(in) :: first_node
30  type(KeyValueListIteratorType) :: iterator
31 
32  iterator%first_node => first_node
33  iterator%current_node => null()
34 
Here is the caller graph for this function:

◆ has_next()

type(logical) function keyvaluelistiteratormodule::has_next ( class(keyvaluelistiteratortype this)

Definition at line 40 of file KeyValueListIterator.f90.

41  class(KeyValueListIteratorType) :: this
42  type(logical) :: res
43 
44  if (associated(this%current_node)) then
45  res = associated(this%current_node%next)
46  else
47  res = associated(this%first_node)
48  end if
49 

◆ next()

subroutine keyvaluelistiteratormodule::next ( class(keyvaluelistiteratortype this)

Definition at line 55 of file KeyValueListIterator.f90.

56  class(KeyValueListIteratorType) :: this
57 
58  if (associated(this%current_node)) then
59  this%current_node => this%current_node%next
60  else
61  this%current_node => this%first_node
62  end if

◆ value()

class(*) function, pointer keyvaluelistiteratormodule::value ( class(keyvaluelistiteratortype this)

Definition at line 68 of file KeyValueListIterator.f90.

69  class(KeyValueListIteratorType) :: this
70  class(*), pointer :: res
71 
72  if (associated(this%current_node)) then
73  res => this%current_node%value
74  else
75  res => null()
76  end if
77