MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
memorycontaineriteratormodule Module Reference

Data Types

interface  memorycontaineriteratortype
 An iterator used to iterate through a MemoryContainer. More...

Functions/Subroutines

type(memorycontaineriteratortype) function constructor (container_iterator)
 Constructor to create a MemoryContainerIterator.
logical(lgp) function has_next (this)
 Indicates if there is a next node in the iteration chain.
subroutine next (this)
 Increment the iterator to the next node.
type(memorytype) function, pointer value (this)
 Get the value the iterator is pointing to.

Function/Subroutine Documentation

◆ constructor()

type(memorycontaineriteratortype) function memorycontaineriteratormodule::constructor ( class(iteratortype), allocatable container_iterator)
private

Definition at line 31 of file MemoryContainerIterator.f90.

32 class(IteratorType), allocatable :: container_iterator
33 type(MemoryContainerIteratorType) :: iterator
34
35 call move_alloc(container_iterator, iterator%container_iterator)
36
Here is the caller graph for this function:

◆ has_next()

logical(lgp) function memorycontaineriteratormodule::has_next ( class(memorycontaineriteratortype) this)
private

Definition at line 42 of file MemoryContainerIterator.f90.

43 class(MemoryContainerIteratorType) :: this
44 logical(LGP) :: res
45
46 res = this%container_iterator%has_next()

◆ next()

subroutine memorycontaineriteratormodule::next ( class(memorycontaineriteratortype) this)
private

Definition at line 52 of file MemoryContainerIterator.f90.

53 class(MemoryContainerIteratorType) :: this
54
55 call this%container_iterator%next()

◆ value()

type(memorytype) function, pointer memorycontaineriteratormodule::value ( class(memorycontaineriteratortype), target this)
private

Definition at line 61 of file MemoryContainerIterator.f90.

62 class(MemoryContainerIteratorType), target :: this
63 type(MemoryType), pointer :: res
64 ! -- local
65 class(*), pointer :: obj !< void pointer to MemoryType
66
67 obj => this%container_iterator%value()
68
69 select type (obj)
70 type is (memorytype)
71 res => obj
72 class default
73 res => null()
74 end select
75