Class S98InteroperabilityRule
- Namespace
- EncDotNet.S100.Datasets.Pipelines.Interoperability
- Assembly
- EncDotNet.S100.Core.dll
One S-98 inter-product rule: a guarded transformation of the sorted layer stack. PR-L2 ships five rules (see S98DefaultRules); future PRs may load additional rules from a parsed Interoperability Catalogue.
public sealed record S98InteroperabilityRule : IEquatable<S98InteroperabilityRule>
- Inheritance
-
S98InteroperabilityRule
- Implements
- Inherited Members
Remarks
A rule is a pair of pure delegates: Condition
decides whether the rule applies given the current set of loaded
datasets, and Effect transforms the sorted stack
when Condition returns true. Rules execute
in the order they appear in
ApplyRules(IReadOnlyList<SubLayerStackItem>, IReadOnlyList<LoadedDatasetInfo>, MarinerSettings?, IReadOnlyCollection<S98InteroperabilityRule>?)'s rule
collection (declaration order); each rule's output is the next
rule's input.
Rules are pure functions of (stack, context) — they must
not mutate the input list, the layers it references, or any
shared state. The default implementations in
S98DefaultRules follow this contract.
Constructors
S98InteroperabilityRule(string, string, Func<S98RuleContext, bool>, Func<IReadOnlyList<SubLayerStackItem>, S98RuleContext, IReadOnlyList<SubLayerStackItem>>)
One S-98 inter-product rule: a guarded transformation of the sorted layer stack. PR-L2 ships five rules (see S98DefaultRules); future PRs may load additional rules from a parsed Interoperability Catalogue.
public S98InteroperabilityRule(string RuleId, string SpecCitation, Func<S98RuleContext, bool> Condition, Func<IReadOnlyList<SubLayerStackItem>, S98RuleContext, IReadOnlyList<SubLayerStackItem>> Effect)
Parameters
RuleIdstringStable identifier, e.g.
"R-101-102-B". Used in diagnostics and tests; must be unique within a rule collection.SpecCitationstringFree-text citation of the spec clause(s) this rule derives from, e.g.
"S-98 Ed.2.0.0 Annex A §8.4.1 + Part B §B-3.1.2".ConditionFunc<S98RuleContext, bool>Predicate over the rule context;
truemeans the rule's Effect should be applied. Must be pure.EffectFunc<IReadOnlyList<SubLayerStackItem>, S98RuleContext, IReadOnlyList<SubLayerStackItem>>Transforms the sorted layer stack. Receives the (possibly already-transformed) stack and the rule context; must return a new list — input must not be mutated.
Remarks
A rule is a pair of pure delegates: Condition
decides whether the rule applies given the current set of loaded
datasets, and Effect transforms the sorted stack
when Condition returns true. Rules execute
in the order they appear in
ApplyRules(IReadOnlyList<SubLayerStackItem>, IReadOnlyList<LoadedDatasetInfo>, MarinerSettings?, IReadOnlyCollection<S98InteroperabilityRule>?)'s rule
collection (declaration order); each rule's output is the next
rule's input.
Rules are pure functions of (stack, context) — they must
not mutate the input list, the layers it references, or any
shared state. The default implementations in
S98DefaultRules follow this contract.
Properties
Condition
Predicate over the rule context; true means the rule's
Effect should be applied. Must be pure.
public Func<S98RuleContext, bool> Condition { get; init; }
Property Value
Effect
Transforms the sorted layer stack. Receives the (possibly already-transformed) stack and the rule context; must return a new list — input must not be mutated.
public Func<IReadOnlyList<SubLayerStackItem>, S98RuleContext, IReadOnlyList<SubLayerStackItem>> Effect { get; init; }
Property Value
RuleId
Stable identifier, e.g. "R-101-102-B". Used in diagnostics
and tests; must be unique within a rule collection.
public string RuleId { get; init; }
Property Value
SpecCitation
Free-text citation of the spec clause(s) this rule derives from,
e.g. "S-98 Ed.2.0.0 Annex A §8.4.1 + Part B §B-3.1.2".
public string SpecCitation { get; init; }