Class BufferedPl0Io
Buffered I/O implementation for deterministic VM tests.
public sealed class BufferedPl0Io : IPl0Io
- Inheritance
-
BufferedPl0Io
- Implements
- Inherited Members
Constructors
BufferedPl0Io(IEnumerable<int>?)
Creates a buffered I/O instance with optional input values.
public BufferedPl0Io(IEnumerable<int>? input = null)
Parameters
inputIEnumerable<int>Initial input values.
Fields
_input
Input queue of integer values.
private readonly Queue<int> _input
Field Value
_output
Collected output values.
private readonly List<int> _output
Field Value
Properties
Output
Gets the output values written so far.
public IReadOnlyList<int> Output { get; }
Property Value
Methods
ReadInt()
Reads the next input value.
public int ReadInt()
Returns
- int
The next integer in the input buffer.
WriteInt(int)
Writes an output value to the buffer.
public void WriteInt(int value)
Parameters
valueintValue to write.