<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="../../../design/description.xslt" type="text/xsl"?>
<node lang="en" type="DynamicNode.Lib.Basic.NIteration" assembly="NLibDefault" xmlns="http://dynamicnodes.mastersign.de/description">
  <caption>Iteration</caption>
  <group>Basics</group>
  <description>Iterates over enumarable objects in a controlled fashion.</description>
  <inPorts>
    <port name="iterable">
      <type>System.Collections.Generic.IEnumerable&lt;TElement&gt;</type>
      <description>This in port takes enumerable objects.</description>
    </port>
    <port name="step">
      <type>&lt;TAny&gt;</type>
      <description>
        Moves the iteration one step foreward if a new token
        arraives on this in port. With every step the next element
        in the enumeration is passed on to the out port <c>item</c>.
      </description>
    </port>
    <port name="reset">
      <type>&lt;TAny&gt;</type>
      <description>
        Resets the iteration and goes back before the first element of the enumeration.
      </description>
    </port>
  </inPorts>
  <outPorts>
    <port name="item">
      <type>TElement</type>
      <description>
        The current elements of the enumeration.
      </description>
    </port>
    <port name="index">
      <type>System.Int64</type>
      <description>
        The current position in the enumeration as integer number.
      </description>
    </port>
    <port name="end">
      <type>DynamicNode.Core.ControlTrigger</type>
      <description>
        Emits a trigger token if the end of the enumeration is reached.
      </description>
    </port>
  </outPorts>
  <helpText>
    <p>
      This node serves as an iterator for enumerable objects.
      The iteration is controlled by the in ports 
      <c>step</c> and <c>reset</c>.
    </p>
    <p>
      The emitted enumeration elements are associated with a stream object.
    </p>
  </helpText>
</node>