Table of Contents

Class BufferedPl0Io

Namespace
Pl0.Vm
Assembly
Pl0.Vm.dll

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

input IEnumerable<int>

Initial input values.

Fields

_input

Input queue of integer values.

private readonly Queue<int> _input

Field Value

Queue<int>

_output

Collected output values.

private readonly List<int> _output

Field Value

List<int>

Properties

Output

Gets the output values written so far.

public IReadOnlyList<int> Output { get; }

Property Value

IReadOnlyList<int>

Methods

ReadInt()

Liest den nächsten Wert aus dem Eingabepuffer.

Reads the next value from the input buffer.

public int ReadInt()

Returns

int

Die nächste Ganzzahl im Eingabepuffer. / The next integer in the input buffer.

Exceptions

EndOfStreamException

Der Eingabepuffer enthält keinen weiteren Wert. / The input buffer contains no further value.

WriteInt(int)

Writes an output value to the buffer.

public void WriteInt(int value)

Parameters

value int

Value to write.