/* ======================================================================== * 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; namespace Opc.Ua.Server { /// /// The table of all reference types known to the server. /// /// This class is thread safe. public class ContinuationPoint : IDisposable { /// /// Initializes the object with default values. /// public ContinuationPoint() { } /// /// Frees any unmanaged resources. /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } /// /// An overrideable version of the Dispose. /// protected virtual void Dispose(bool disposing) { if (disposing) { (Data as IDisposable)?.Dispose(); } } /// /// A unique identifier for the continuation point. /// public Guid Id { get; set; } /// /// The node manager that created the continuation point. /// public IAsyncNodeManager Manager { get; set; } = null!; /// /// The view being browsed. /// public ViewDescription? View { get; set; } /// /// The node being browsed. /// public object NodeToBrowse { get; set; } = null!; /// /// The maximum number of results to return. /// public uint MaxResultsToReturn { get; set; } /// /// What direction to follow the references. /// public BrowseDirection BrowseDirection { get; set; } /// /// The reference type of the references to return. /// public NodeId ReferenceTypeId { get; set; } /// /// Whether subtypes of the reference type should be return as well. /// public bool IncludeSubtypes { get; set; } /// /// The node class of the target nodes for the references to return. /// public uint NodeClassMask { get; set; } /// /// The values to return. /// public BrowseResultMask ResultMask { get; set; } /// /// The index where browsing halted. /// public int Index { get; set; } /// /// Node manager specific data that is necessary to continue the browse. /// /// /// A node manager needs to hold onto unmanaged resources to continue the browse. /// If this is the case then the object stored here must implement the Idispose /// interface. This will ensure the unmanaged resources are freed if the continuation /// point expires. /// public object? Data { get; set; } /// /// Whether the ReferenceTypeId should be returned in the result. /// public bool ReferenceTypeIdRequired => ((int)ResultMask & (int)BrowseResultMask.ReferenceTypeId) != 0; /// /// Whether the IsForward flag should be returned in the result. /// public bool IsForwardRequired => ((int)ResultMask & (int)BrowseResultMask.IsForward) != 0; /// /// Whether the NodeClass should be returned in the result. /// public bool NodeClassRequired => ((int)ResultMask & (int)BrowseResultMask.NodeClass) != 0; /// /// Whether the BrowseName should be returned in the result. /// public bool BrowseNameRequired => ((int)ResultMask & (int)BrowseResultMask.BrowseName) != 0; /// /// Whether the DisplayName should be returned in the result. /// public bool DisplayNameRequired => ((int)ResultMask & (int)BrowseResultMask.DisplayName) != 0; /// /// Whether the TypeDefinition should be returned in the result. /// public bool TypeDefinitionRequired => ((int)ResultMask & (int)BrowseResultMask.TypeDefinition) != 0; /// /// False if it is not necessary to read the attributes a target node. /// /// /// This flag is true if the NodeClass filter is set or the target node attributes are returned in the result. /// public bool TargetAttributesRequired { get { if (NodeClassMask != 0) { return true; } return ( (int)ResultMask & ( (int)BrowseResultMask.NodeClass | (int)BrowseResultMask.BrowseName | (int)BrowseResultMask.DisplayName | (int)BrowseResultMask.TypeDefinition) ) != 0; } } } }