/* ========================================================================
* Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System.Collections.Generic;
using System.Threading;
namespace Opc.Ua.SourceGeneration
{
///
/// Generator options
///
public sealed class GeneratorOptions
{
///
/// Optimize generated code for compile speed.
///
public bool OptimizeForCompileSpeed { get; set; }
///
/// Exclusions to apply on the input
///
public IReadOnlyList Exclusions { get; set; } = [];
///
/// Generation should be cancelled
///
public CancellationToken Cancellation { get; set; }
///
/// Write utf8 string literals when needed
///
public bool UseUtf8StringLiterals { get; set; } = true;
///
/// When set to true, the
/// is suppressed and no
/// *TypeClient proxy classes are emitted. Off by default —
/// proxies are emitted for every ObjectType in the model
/// alongside the standard model output.
///
public bool OmitObjectTypeProxies { get; set; }
///
/// Optional override for the C# namespace used by classes emitted
/// by the . When unset,
/// the model's target namespace prefix is used.
///
public string ObjectTypeProxyNamespace { get; set; }
///
/// When set to true, the
/// uses the modelling rules from the referenced type definition
/// unconditionally, rather than the overridden rules on instance
/// definitions, for all structural code generation decisions
/// (child inclusion, optional vs mandatory classification) and
/// the emitted runtime ModellingRuleId.
///
/// Off by default. When off, the generator still enforces OPC UA
/// modelling rule promotion semantics — instances may only
/// promote the type definition's rule:
/// Optional → Mandatory,
/// OptionalPlaceholder → Mandatory | MandatoryPlaceholder,
/// MandatoryPlaceholder → Mandatory.
/// Any demotion is silently rejected and the type definition's
/// rule is used instead.
///
///
public bool UseTypeDefinitionModellingRules { get; set; }
///
/// Maps an OPC UA namespace URI (key) to the C# namespace (value)
/// in which the corresponding source-generated *TypeClient
/// proxies live. Used by the
/// when a generated
/// proxy must derive from a base proxy that is defined in a
/// different (referenced) assembly.
///
///
/// The standard mapping
/// http://opcfoundation.org/UA/ -> Opc.Ua.Client is
/// always added by the generator and does not need to be
/// configured explicitly.
///
public IDictionary ObjectTypeProxyExternalNamespaces { get; }
= new Dictionary();
///
/// Optional override for the C# namespace used by classes
/// emitted by the . When
/// unset, the model's target namespace prefix is used.
///
public string EventRecordNamespace { get; set; }
///
/// Maps an OPC UA namespace URI (key) to the C# namespace
/// (value) in which the corresponding source-generated
/// *Record classes live. Used by the
/// when a record must
/// derive from a parent record defined in a different
/// (referenced) assembly.
///
///
/// The standard mapping
/// http://opcfoundation.org/UA/ -> Opc.Ua.Client.Alarms
/// is always added by the generator and does not need to be
/// configured explicitly.
///
public IDictionary EventRecordExternalNamespaces { get; }
= new Dictionary();
}
}