constructor Function

private pure function constructor(contents) result(new)

Arguments

Type IntentOptional AttributesName
class(container), intent(in), dimension(:):: contents

Return Value type(iterator)

Description

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.

Called By

proc~~constructor~~CalledByGraph proc~constructor constructor interface~iterator iterator interface~iterator->proc~constructor
Help

Source Code

  pure function constructor(contents) result(new)
    !* Author: Chris MacMackin
    !  Date: March 2016
    !
    ! 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.
    !
    class(container), dimension(:), intent(in) :: contents
    type(iterator) :: new
    allocate(new%contents(size(contents)), source=contents)
    new%filled = .true.
  end function constructor