Class WrittenStepValues
- Namespace
- Hi.MachiningSteps
- Assembly
- HiMech.dll
Internal Use Only. The values written onto one step under step-variable keys
(this[string]: a script's step-built handler, a CSV program's
data columns) while the step's consignment is live — kept on the consignment
(WrittenValues) from the first write until the rendezvous
frees it, and on the runner as the last published step's values
(MachiningActRunner.LastPublishedStepValues), so that a handler reading the
previous step reads no row. The writer takes the values once
(TakeForWrite()) and writes them with the step's rows; a value set after that
is written to the store by the caller (Set(string, object) says so) and kept here for the
readers until the consignment is freed. Every member takes the gate: the sequential
stage writes while the writer thread reads. The writer takes the values of every
published consignment, one that nothing was written onto included
(TakeWrittenValuesForWrite() creates the object taken), so a
value written after the flush always finds a taken object and reaches the store. The
dictionary is allocated on the first value. The brief-into-DB chain's C4c.
public sealed class WrittenStepValues
- Inheritance
-
WrittenStepValues
- Inherited Members
- Extension Methods
Properties
Count
The keys written.
public int Count { get; }
Property Value
IsTaken
Whether the writer took the values (TakeForWrite()).
public bool IsTaken { get; }
Property Value
Keys
The keys written, in no particular order.
public string[] Keys { get; }
Property Value
- string[]
Methods
Set(string, object)
Writes value under key; null takes the key back.
public bool Set(string key, object value)
Parameters
keystringThe key.
valueobjectThe value, normalised already (TryNormalize(object, out object)): a double, a string, or null.
Returns
- bool
true when the writer has taken the values for the step's rows already: the caller writes the store itself.
Snapshot()
The keys and values as they stand, in no particular order; empty when nothing is written.
public KeyValuePair<string, object>[] Snapshot()
Returns
- KeyValuePair<string, object>[]
TakeForWrite()
The values for the step's rows, taken once by the writer: from here on Set(string, object) answers true and the caller writes the store itself.
public KeyValuePair<string, object>[] TakeForWrite()
Returns
- KeyValuePair<string, object>[]
TryGetValue(string, out object)
Reads the value written under key.
public bool TryGetValue(string key, out object value)
Parameters
keystringThe key.
valueobjectThe value: a double or a string (StepVariableValue).
Returns
- bool
false when nothing is written under the key (or the write was taken back by a null).