MeterNodeIterator Derived Type

type, public, extends(AbstractMeterNodeIterator) :: MeterNodeIterator


Inherits

type~~meternodeiterator~~InheritsGraph type~meternodeiterator MeterNodeIterator type~abstractmeternode AbstractMeterNode type~meternodeiterator->type~abstractmeternode current type~abstractmeternodeiterator AbstractMeterNodeIterator type~meternodeiterator->type~abstractmeternodeiterator iterator_of_current_child type~meternodeiterator->type~abstractmeternodeiterator type~meternode MeterNode type~meternodeiterator->type~meternode reference type~meternodevectoriterator MeterNodeVectorIterator type~meternodeiterator->type~meternodevectoriterator iterator_over_children type~meternode->type~abstractmeternode type~abstractmeter AbstractMeter type~meternode->type~abstractmeter meter type~meternodevector MeterNodeVector type~meternode->type~meternodevector children type~v_wrapper~3 v_Wrapper type~meternodevectoriterator->type~v_wrapper~3 elements type~meternodevector->type~v_wrapper~3 elements type~v_wrapper~3->type~abstractmeternode item

Constructor

public interface MeterNodeIterator

  • private function new_MeterNodeIterator(meter_node) result(iterator)

    Arguments

    Type IntentOptional Attributes Name
    type(MeterNode), intent(in), target :: meter_node

    Return Value type(MeterNodeIterator)


Type-Bound Procedures

procedure, public :: equals

procedure, public :: get

  • private function get(this) result(tree)

    Arguments

    Type IntentOptional Attributes Name
    class(MeterNodeIterator), intent(in), target :: this

    Return Value class(AbstractMeterNode), pointer

procedure, public :: get_meter => get_meter_iter

  • private function get_meter_iter(this) result(t)

    Arguments

    Type IntentOptional Attributes Name
    class(MeterNodeIterator), intent(in) :: this

    Return Value class(AbstractMeter), pointer

procedure, public :: get_name => get_name_iter

  • private function get_name_iter(this) result(name)

    Arguments

    Type IntentOptional Attributes Name
    class(MeterNodeIterator), intent(in) :: this

    Return Value character(len=:), pointer

procedure, public :: next

  • private recursive subroutine next(this)

    Arguments

    Type IntentOptional Attributes Name
    class(MeterNodeIterator), intent(inout) :: this

procedure, public :: not_equals

generic, public :: operator(/=) => not_equals

generic, public :: operator(==) => equals

Source Code

   type, extends(AbstractMeterNodeIterator) :: MeterNodeIterator
      private
      class (MeterNode), pointer :: reference => null()
      class (AbstractMeterNode), pointer :: current => null()

      ! Subiterators are allocated after iterator goes beyond the root node
      type (MeterNodeVectorIterator), allocatable :: iterator_over_children
      class (AbstractMeterNodeIterator), allocatable :: iterator_of_current_child
   contains
      procedure :: get
      procedure :: get_name => get_name_iter
      procedure :: get_meter => get_meter_iter
      procedure :: equals
      procedure :: not_equals
      procedure :: next
   end type MeterNodeIterator