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()

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

value int

Value to write.