TUV-x
Loading...
Searching...
No Matches
Public Member Functions | List of all members
musica_iterator::iterator_t Type Reference

An abstract iterator. More...

Inheritance diagram for musica_iterator::iterator_t:
musica_config::config_iterator_t

Public Member Functions

procedure(next), deferred next
 Advances the iterator.
 
procedure(reset), deferred reset
 Resets the iterator to the beginning of the collection.
 

Detailed Description

An abstract iterator.

Extending types should provide a constructor that returns a pointer to a iterator_t that references a newly allocated iterator of the extending type. The iterator must be in the state it would be in after a call to reset.

Example usage:

use musica_foo_iterator, only : foo_iterator_t
class(iterator), pointer :: my_iterator
my_iterator => foo_iterator_t( ) ! can accept arguments if necessary
do while( my_iterator%next( ) )
some_function( my_iterator, ... ) ! use a function that uses a foo_iterator_t
end do
call my_iterator%reset( ) ! reset the iterator
do while( my_iterator%next( ) )
some_other_function( my_iterator, ... )
end do
deallocate( my_iterator )
The abstract iterator_t type and related functions.
Definition: iterator.F90:8
An abstract iterator.
Definition: iterator.F90:40

The documentation for this type was generated from the following file: