Class SegmenterDependency
- Namespace
- Hi.NcParsers.Dependencys.SystemWired
- Assembly
- HiMech.dll
Exposes the active ISegmenter to syntaxes that need to
re-segment auxiliary NC text mid-pipeline (e.g.,
SubProgramCallSyntax reading an O<n>
subprogram file and re-using the host runner's segmenter so the inlined
blocks are split with the same rules).
The actual segmenter is resolved at runtime via Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider; RunControlLines(string, IEnumerable<string>, MachiningSession, SessionProgress, CancellationToken) wires the provider to its own Segmenter at the start of each session run, so this dependency can sit in NcDependencyList without participating in XML serialization (see MakeXmlSource(string, string, bool)).
public class SegmenterDependency : INcDependency, IMakeXmlSource
- Inheritance
-
SegmenterDependency
- Implements
- Inherited Members
- Extension Methods
Constructors
SegmenterDependency()
Initializes a new instance with no Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider; the host runner assigns one before queries.
public SegmenterDependency()
SegmenterDependency(Func<ISegmenter>)
Initializes a new instance with the given Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider.
public SegmenterDependency(Func<ISegmenter> provider)
Parameters
providerFunc<ISegmenter>Delegate that resolves the live ISegmenter at lookup time.
Properties
Segmenter
The live segmenter, or null when Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider is unset or returns null.
public ISegmenter Segmenter { get; }
Property Value
XName
XML element name used to register this dependency with XFactory.
public static string XName { get; }
Property Value
Methods
MakeXmlSource(string, string, bool)
Runtime-only dependency — the Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider is wired per session and is not meaningful to persist; serialization writes only the empty element so the dependency survives an XML round-trip.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
Returns
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory