traverse list from head to tail, and call the iterator function for each key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(list), | intent(inout) | :: | me | |||
| procedure(key_iterator) | :: | iterator |
the function to call for each node. |
subroutine traverse(me,iterator) implicit none class(list),intent(inout) :: me procedure(key_iterator) :: iterator !! the function to call for each node. call me%traverse_list(key_iterator_wrapper) contains subroutine key_iterator_wrapper(me,done) !! for calling the user-specified key_iterator function. implicit none type(node),pointer :: me logical,intent(out) :: done !! set to true to stop traversing call iterator(me%key,me%value,done) end subroutine key_iterator_wrapper end subroutine traverse