title: Implement class to work with real time data
body: <p>Using C# I need to transform a time series, for example:</p>
  
  <pre><code>Input: 1 2 1 0 3 2 -&gt; Output: 1 3 4 4 7 9
  </code></pre>
  
  <p>In the previous example an output is the sum of current input with the previous inputs.</p>
  
  <p>I will have different transformations so I started with an abstract class:</p>
  
  <pre><code>public abstract class Transformation&lt;TInput, TOutput&gt; {
  
    private IEnumerable&lt;TInput&gt; _inputs { get; set; }
  
    public Transformation(IEnumerable&lt;TInput&gt; inputs) { 
      _inputs = inputs;
    }
  
    public abstract IEnumerable&lt;TOutput&gt; Calculate();
  
  }
  </code></pre>
  
  <p>So a transformation would be something like:</p>
  
  <pre><code>public class TransformationOne&lt;Int32, Int32&gt; {
  
    public override IEnumerable&lt;Int32&gt; Calculate();
      // Calculate the outputs with all inputs
    }
  
  }
  </code></pre>
  
  <p>This works fine if I have all inputs and want all outputs.</p>
  
  <p>But sometimes I would like to use my class in real time.</p>
  
  <p>So I would feed with a new input and would get a new output.</p>
  
  <p>What would be the best way to implement this?</p>