Table of Contents

Class StepConsignment

Namespace
Hi.MachiningSteps
Assembly
HiMech.dll

Internal Use Only. The step's luggage and its two briefs on their way to the step cache: kept on the MachiningStep as its creation cache (Hi.MachiningSteps.MachiningStep.ConsignmentCreationCache) from the step's construction until its rows are committed and the step is published (MachiningActRunner.SeekClearStepLuggageCache clears it once both have happened), and queued to the runner's writer as the item of one row of each table — the StepLuggage row and the StepBrief row of the two briefs, written in one transaction (SqliteStepStorage.InsertStepConsignments; the brief-into-DB chain's C3) — and, since the chain's C4c, the values written onto the step while the consignment is live (WrittenValues: a script's step-built handler, a CSV program's data columns), as the rows of the StepVariable table in the same transaction. One object a step, freed at the rendezvous.

Since play-core migration P14 (D8) the luggage travels as bytes (LuggageBytes, the truth): the writer binds them to the row's columns and serialises nothing for the luggage -- the store encodes two of them into forms of its own first (HiNc's SqliteStepStorage: the no-cut force array cut to its header, the contours deflated) and decodes them on read, so these bytes stay as the pipeline made them; the objects (StepLuggage) are parsed from the bytes on the first read and kept as a read cache.

HasStep false is a consignment without a step: the force stage produced the luggage and the sequential stage faulted before the step was published — the store gets the luggage row alone, no StepBrief row, and the flush makes no ByDb rendezvous visit for it (there is no step whose cache could pair with it; a visit would park a stale ByDb for the index). A step whose sequential stage never ran (a stop with steps in flight) has no consignment at all.

public sealed class StepConsignment
Inheritance
StepConsignment
Inherited Members
Extension Methods

Constructors

StepConsignment(StepLuggage, MillingForceBrief, SeqPhysicsState)

A consignment of a published step: its luggage as an object and its two briefs. The object is kept as the one the readers answer (by reference); the bytes the store takes are derived from it on the first read of LuggageBytes (Of(StepLuggage)), so an object the store never asks for is never serialised (critique TG-1).

public StepConsignment(StepLuggage stepLuggage, MillingForceBrief millingForceBrief, SeqPhysicsState seqPhysicsState)

Parameters

stepLuggage StepLuggage

The luggage; required.

millingForceBrief MillingForceBrief

The force brief; null when the physics did not run on the step.

seqPhysicsState SeqPhysicsState

The sequential physics state; required.

Exceptions

ArgumentNullException

The luggage or the sequential physics state is null.

StepConsignment(StepLuggage, MillingForceBrief, SeqPhysicsState, WrittenStepValues)

A consignment of a published step that keeps the written values of the consignment it replaces (the step-physics recompute, on a step whose consignment survived a failed flush: the recomputed briefs beside the values the play wrote).

public StepConsignment(StepLuggage stepLuggage, MillingForceBrief millingForceBrief, SeqPhysicsState seqPhysicsState, WrittenStepValues writtenValues)

Parameters

stepLuggage StepLuggage

The luggage; required.

millingForceBrief MillingForceBrief

The force brief; null when the physics did not run on the step.

seqPhysicsState SeqPhysicsState

The sequential physics state; required.

writtenValues WrittenStepValues

The written values carried over; null for none.

StepConsignment(StepLuggageBytes, MillingForceBrief, SeqPhysicsState)

A consignment of a published step: its luggage as bytes and its two briefs (the pipeline's form since P14).

public StepConsignment(StepLuggageBytes luggageBytes, MillingForceBrief millingForceBrief, SeqPhysicsState seqPhysicsState)

Parameters

luggageBytes StepLuggageBytes

The luggage as bytes; required.

millingForceBrief MillingForceBrief

The force brief; null when the physics did not run on the step.

seqPhysicsState SeqPhysicsState

The sequential physics state; required.

Exceptions

ArgumentNullException

The luggage or the sequential physics state is null.

StepConsignment(StepLuggageBytes, MillingForceBrief, SeqPhysicsState, WrittenStepValues)

A consignment of a published step, from bytes, that keeps the written values of the consignment it replaces (see StepConsignment(StepLuggage, MillingForceBrief, SeqPhysicsState, WrittenStepValues)).

public StepConsignment(StepLuggageBytes luggageBytes, MillingForceBrief millingForceBrief, SeqPhysicsState seqPhysicsState, WrittenStepValues writtenValues)

Parameters

luggageBytes StepLuggageBytes

The luggage as bytes; required.

millingForceBrief MillingForceBrief

The force brief; null when the physics did not run on the step.

seqPhysicsState SeqPhysicsState

The sequential physics state; required.

writtenValues WrittenStepValues

The written values carried over; null for none.

Properties

HasStep

Whether the sequential stage published the step this consignment belongs to: the store then gets its StepBrief row and the flush visits ByDb for it.

public bool HasStep { get; }

Property Value

bool

LuggageBytes

The luggage as bytes, one array a kind (play-core migration P14, D8); never null. On the pipeline's path the consignment is born with them and they are the truth: what the writer hands the store and what the objects are parsed from. A consignment born with a StepLuggage object (the recompute, the tests) derives them here on the first read, through Of(StepLuggage) – when the writer takes them, so an object the store never asks for is never serialised (critique TG-1) – and keeps them; two first readers may each serialise, and the first stored arrays win.

public StepLuggageBytes LuggageBytes { get; }

Property Value

StepLuggageBytes

MillingForceBrief

The force brief the force stage built: null (the physics did not run on the step), the no-cut record or a computed brief — the three states the wire format's tag byte tells apart (MillingForceBrief.WireTagOf).

public MillingForceBrief MillingForceBrief { get; }

Property Value

MillingForceBrief

SeqPhysicsState

The sequential physics state the sequential stage built; never null when HasStep (a published step always has one), null on a luggage-only consignment.

public SeqPhysicsState SeqPhysicsState { get; }

Property Value

SeqPhysicsState

StepIndex

The step index, the luggage's (read at construction off the side the consignment was born with).

public int StepIndex { get; }

Property Value

int

StepLuggage

The luggage as objects; never null. Parsed from LuggageBytes on the first read (one parse of the three kinds, whichever reader asks first: the step's TryGet…, a GUI pick, a script's handler) and kept as a read cache; two first readers may each parse, and the first stored object is the one every reader answers from then on (D8, LLT-7). A consignment built from a StepLuggage answers that object by reference (its bytes are derived from it when the store asks). The side the consignment was born with is the truth and the other side is derived from it once: a change made to the object is not stored, and no caller assigns a luggage member outside construction.

public StepLuggage StepLuggage { get; }

Property Value

StepLuggage

WrittenValues

The values written onto the step while this consignment is live (this[string]), written with the step's rows and read ahead of the store until the rendezvous frees the consignment; null until the first write (a step nothing is written onto allocates nothing). The step-physics recompute hands a surviving consignment's values on to the one it replaces it with.

public WrittenStepValues WrittenValues { get; }

Property Value

WrittenStepValues

Methods

GetOrCreateWrittenValues()

The written values, created on the first write (one object, whichever thread writes first).

public WrittenStepValues GetOrCreateWrittenValues()

Returns

WrittenStepValues

LuggageOnly(StepLuggage)

A consignment without a step (see HasStep): the luggage alone, of a step the sequential stage faulted on before publishing it; the object is kept as the one the readers answer, and the bytes the store takes are derived from it when asked (critique TG-1).

public static StepConsignment LuggageOnly(StepLuggage stepLuggage)

Parameters

stepLuggage StepLuggage

The luggage; required.

Returns

StepConsignment

Exceptions

ArgumentNullException

The luggage is null.

LuggageOnly(StepLuggageBytes)

A consignment without a step (see HasStep): the luggage alone, as bytes, of a step the sequential stage faulted on before publishing it.

public static StepConsignment LuggageOnly(StepLuggageBytes luggageBytes)

Parameters

luggageBytes StepLuggageBytes

The luggage as bytes; required.

Returns

StepConsignment

Exceptions

ArgumentNullException

The luggage is null.

TakeWrittenValuesForWrite()

The writer's take of the written values for the step's rows: the values as they stand, and the object marked taken – created here when nothing was written yet, so that a value written after the flush, on a step the handler wrote nothing onto, finds the object taken and goes to the store (Set(string, object) answers true).

public KeyValuePair<string, object>[] TakeWrittenValuesForWrite()

Returns

KeyValuePair<string, object>[]