Table of Contents

Class StepAdjustmentLogger

Namespace
Hi.NcOpt
Assembly
HiMech.dll

Orders per-step adjustment log lines by step index and writes them to a log file. The logger is seeded with the expected step indexes; as unit logs arrive (possibly out of order from parallel workers), the contiguous ordered prefix is flushed to the underlying ParallelBulkWriter<TData>. Byte-identical log line composition stays the caller's job — this class only orders and writes.

public class StepAdjustmentLogger : IDisposable
Inheritance
StepAdjustmentLogger
Implements
Inherited Members
Extension Methods

Remarks

Ported from HiNc IndependentStepAdjustmentLogger (frozen HardNc baseline, HiNc/NcOpt/IndependentStepAdjustmentLogger.cs). Renamed to avoid any fully-qualified-name ambiguity with the HiNc internal type.

Constructors

StepAdjustmentLogger(string, IEnumerable<int>)

Ctor.

public StepAdjustmentLogger(string filePath, IEnumerable<int> stepIndexs)

Parameters

filePath string

The log file path. Parent directories are created if not existed.

stepIndexs IEnumerable<int>

The expected step indexes to be logged.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Enqueue(int, string)

Enqueue one unit log for the given step index. The contiguous ordered prefix is flushed to the writer.

public void Enqueue(int stepIndex, string o)

Parameters

stepIndex int

The step index of the unit log.

o string

The composed unit log line.

Wait()

Wait until all enqueued logs are written.

public void Wait()