This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/api/Hi.NcParsers.NcCompositionGate.html
T

378 lines
16 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class NcCompositionGate | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class NcCompositionGate | HiAPI-C# 2025 ">
<meta name="description" content="License gate for the NC composition layer — the capability of registering external (non-built-in) processing units into a pipeline, and of executing NC-embedded C# scripts (). The boundary: the script layer (calling the public API from your own application code, e.g. session scripts) needs no extra license; the composition layer (registering or replacing processing units inside the interpretation pipeline — , , , , — or injecting per-line scripts into it) requires . A unit is built-in when its concrete type lives in this library&#39;s own assembly; anything else is external. Order, count, duplication and constructor configuration of built-in units are unrestricted — the gate never inspects the shape of the pipeline, only the identity of each unit. Degradation is silent and functional: without the license the built-in dialects run unchanged; external units are skipped for the session and a single Composition--NotLicensed diagnostic lists them. The decision and its rejection record live in the native license module.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Hi.NcParsers.NcCompositionGate">
<h1 id="Hi_NcParsers_NcCompositionGate" data-uid="Hi.NcParsers.NcCompositionGate" class="text-break">
Class NcCompositionGate
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.NcParsers.html">NcParsers</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
</div>
<div class="markdown summary"><p>License gate for the NC composition layer — the capability of registering
external (non-built-in) processing units into a <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a>
pipeline, and of executing NC-embedded C# scripts
(<a class="xref" href="Hi.Numerical.Acts.ActLineCsScript.html">ActLineCsScript</a>).</p>
<p>
The boundary: the <b>script layer</b> (calling the public API from your own
application code, e.g. session scripts) needs no extra license; the
<b>composition layer</b> (registering or replacing processing units inside
the interpretation pipeline — <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSyntaxList">NcSyntaxList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_PipelineNcDependencyList">PipelineNcDependencyList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSemanticList">NcSemanticList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcInitializationList">NcInitializationList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_Segmenter">Segmenter</a> — or injecting per-line scripts into
it) requires <a class="xref" href="Hi.Licenses.AuthFeature.html#Hi_Licenses_AuthFeature_NcComposition">NcComposition</a>.
</p>
<p>
A unit is <b>built-in</b> when its concrete type lives in this library's
own assembly; anything else is <b>external</b>. Order, count, duplication
and constructor configuration of built-in units are unrestricted — the
gate never inspects the shape of the pipeline, only the identity of each
unit.
</p>
<p>
Degradation is silent and functional: without the license the built-in
dialects run unchanged; external units are skipped for the session and a
single <code>Composition--NotLicensed</code> diagnostic lists them. The decision
and its rejection record live in the native license module.
</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class NcCompositionGate</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">NcCompositionGate</span></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_NcParsers_NcCompositionGate_CollectForeignUnits_" data-uid="Hi.NcParsers.NcCompositionGate.CollectForeignUnits*"></a>
<h3 id="Hi_NcParsers_NcCompositionGate_CollectForeignUnits_Hi_NcParsers_SoftNcRunner_System_Collections_Generic_List_Hi_NcParsers_Dependencys_INcDependency__" data-uid="Hi.NcParsers.NcCompositionGate.CollectForeignUnits(Hi.NcParsers.SoftNcRunner,System.Collections.Generic.List{Hi.NcParsers.Dependencys.INcDependency})">
CollectForeignUnits(SoftNcRunner, List&lt;INcDependency&gt;)
</h3>
<div class="markdown level1 summary"><p>Collects every external (non-built-in) processing unit reachable from
the given runner's five pipeline members: the syntax list (descending
into <a class="xref" href="Hi.NcParsers.Syntaxs.BundleSyntax.html">BundleSyntax</a> nesting), the dependency list, the
semantic list, the initializer list, and the segmenter.
Pure inspection — nothing is licensed, mutated, or resolved here.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;object&gt; CollectForeignUnits(SoftNcRunner runner, List&lt;INcDependency&gt; resolvedNcDependencyList = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>runner</code> <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a></dt>
<dd><p>Runner whose composed pipeline is inspected.</p>
</dd>
<dt><code>resolvedNcDependencyList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.NcParsers.Dependencys.INcDependency.html">INcDependency</a>&gt;</dt>
<dd><p>Optional proxy-resolved
dependency list to inspect instead of the runner's raw
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_PipelineNcDependencyList">PipelineNcDependencyList</a> (the session gate
passes <a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html#Hi_MachiningProcs_NcRunnerSessionState_EffectiveNcDependencyList">EffectiveNcDependencyList</a>
so the concrete proxied instances are judged, not the proxies).</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</dt>
<dd><p>The external units, in pipeline order per member.</p>
</dd>
</dl>
<a id="Hi_NcParsers_NcCompositionGate_IsBuiltIn_" data-uid="Hi.NcParsers.NcCompositionGate.IsBuiltIn*"></a>
<h3 id="Hi_NcParsers_NcCompositionGate_IsBuiltIn_System_Type_" data-uid="Hi.NcParsers.NcCompositionGate.IsBuiltIn(System.Type)">
IsBuiltIn(Type)
</h3>
<div class="markdown level1 summary"><p>Whether the given concrete processing-unit type is built-in — i.e.
defined in this library's own assembly. External (customer-authored)
unit types return false regardless of their name.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsBuiltIn(Type unitType)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>unitType</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a></dt>
<dd><p>Concrete type of a pipeline processing unit.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True when the type is built-in.</p>
</dd>
</dl>
<a id="Hi_NcParsers_NcCompositionGate_IsEmbeddedScriptLicensed_" data-uid="Hi.NcParsers.NcCompositionGate.IsEmbeddedScriptLicensed*"></a>
<h3 id="Hi_NcParsers_NcCompositionGate_IsEmbeddedScriptLicensed" data-uid="Hi.NcParsers.NcCompositionGate.IsEmbeddedScriptLicensed">
IsEmbeddedScriptLicensed()
</h3>
<div class="markdown level1 summary"><p>Whether NC-embedded C# scripts
(<a class="xref" href="Hi.Numerical.Acts.ActLineCsScript.html">ActLineCsScript</a> — NC-comment markers,
CSV script columns, per-line script injection) may execute. Fresh
native license query for <a class="xref" href="Hi.Licenses.AuthFeature.html#Hi_Licenses_AuthFeature_NcComposition">NcComposition</a>;
callers on hot paths cache the answer per play.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsEmbeddedScriptLicensed()</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_NcCompositionGate_PassComposition_" data-uid="Hi.NcParsers.NcCompositionGate.PassComposition*"></a>
<h3 id="Hi_NcParsers_NcCompositionGate_PassComposition_System_Collections_Generic_IReadOnlyCollection_System_Object__" data-uid="Hi.NcParsers.NcCompositionGate.PassComposition(System.Collections.Generic.IReadOnlyCollection{System.Object})">
PassComposition(IReadOnlyCollection&lt;object&gt;)
</h3>
<div class="markdown level1 summary"><p>Native decision point: pass when no external unit is present, or when
<a class="xref" href="Hi.Licenses.AuthFeature.html#Hi_Licenses_AuthFeature_NcComposition">NcComposition</a> is licensed. The rejection
(with the unit names) is recorded on the native side. A core.dll that
predates the gate fails closed for external units.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool PassComposition(IReadOnlyCollection&lt;object&gt; foreignUnits)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>foreignUnits</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</dt>
<dd><p>External units collected by
<a class="xref" href="Hi.NcParsers.NcCompositionGate.html#Hi_NcParsers_NcCompositionGate_CollectForeignUnits_Hi_NcParsers_SoftNcRunner_System_Collections_Generic_List_Hi_NcParsers_Dependencys_INcDependency__">CollectForeignUnits(SoftNcRunner, List&lt;INcDependency&gt;)</a>.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True when the composed pipeline may run as-is.</p>
</dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>