Provides the iterator data type which can be used to access a collection of data.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(container), | intent(in), | dimension(:) | :: | contents |
Creates an iterator from an array of containers containing the data to be returned upon iteration. The data is returned starting with the first element of the array and ending with the last.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(container), | private, | allocatable, dimension(:) | :: | contents | |||
integer, | private | :: | location | = | 1 | ||
logical, | private | :: | filled | = | .false. |
private pure function constructor(contents) | Creates an iterator from an array of containers containing the data to be returned upon iteration. The data is returned starting with the first element of the array and ending with the last. |
procedure, public :: has_next | |
procedure, public :: next | |
procedure, public :: reset | |
procedure, public :: contents_type |
A data type which provides a collection of data to the user. Objects
of this type are returned using the iter method of
FIAT's other data types. The contents of the iterator are set to be
the same as the iterable at the time when the iter
method was
called. If new items are later added to the iterable object, this
will not be reflected in the iterator object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(container), | intent(in), | dimension(:) | :: | contents |
Creates an iterator from an array of containers containing the data to be returned upon iteration. The data is returned starting with the first element of the array and ending with the last.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(iterator), | intent(in) | :: | this |
Whether there are additional items to iterate through
Returns .true.
if there are any remaining objects through which
to iterate, and .false.
otherwise.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(iterator), | intent(inout) | :: | this |
The next item held in the iterator, if present. Otherwise an unallocated container.
Returns the next item stored in the iterator. If there are no more items present then an empty container is returned. If there are no contents stored in this iterator then it returns an unallocated container.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(iterator), | intent(in) | :: | this |
A container with the dynamic type of that used to hold the contents of the iterator. It is a pointer as pointer assignment is the easiest way to hold its "value" in an abstract variable.
Returns a container with the dynamic type of that used to hold the contents of this iterator