/// <summary> /// Flushes data through this filter and all its children. /// </summary> public virtual void Flush() { if (this.ChildFilter != null) { this.ChildFilter.Flush(); while (ChildFilter.DataReady) { T data = ChildFilter.Read(); lock (dataOut) { dataOut.Enqueue(data); } } } }
/// <summary> /// Writes data to the filter. If there are child filters, the data will automaticaly /// flow through them before being placed in the output of the filter. /// </summary> /// <param name="Data">A data value to be passed through the filter</param> public virtual void Write(T Data) { if (ChildFilter != null) { ChildFilter.Write(Data); while (ChildFilter.DataReady) { T data = ChildFilter.Read(); lock (dataOut) { dataOut.Enqueue(data); } } } else { lock (dataOut) { dataOut.Enqueue(Data); } } }