|
1 | | -/* ======================================================================== |
2 | | - * Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved. |
3 | | - * |
4 | | - * OPC Foundation MIT License 1.00 |
5 | | - * |
6 | | - * Permission is hereby granted, free of charge, to any person |
7 | | - * obtaining a copy of this software and associated documentation |
8 | | - * files (the "Software"), to deal in the Software without |
9 | | - * restriction, including without limitation the rights to use, |
10 | | - * copy, modify, merge, publish, distribute, sublicense, and/or sell |
11 | | - * copies of the Software, and to permit persons to whom the |
12 | | - * Software is furnished to do so, subject to the following |
13 | | - * conditions: |
14 | | - * |
15 | | - * The above copyright notice and this permission notice shall be |
16 | | - * included in all copies or substantial portions of the Software. |
17 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
18 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
19 | | - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
20 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
21 | | - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
22 | | - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
23 | | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
24 | | - * OTHER DEALINGS IN THE SOFTWARE. |
25 | | - * |
26 | | - * The complete license agreement can be found here: |
27 | | - * http://opcfoundation.org/License/MIT/1.00/ |
28 | | - * ======================================================================*/ |
| 1 | +/* Copyright (c) 1996-2022 The OPC Foundation. All rights reserved. |
| 2 | + The source code in this file is covered under a dual-license scenario: |
| 3 | + - RCL: for OPC Foundation Corporate Members in good-standing |
| 4 | + - GPL V2: everybody else |
| 5 | + RCL license terms accompanied with this source code. See http://opcfoundation.org/License/RCL/1.00/ |
| 6 | + GNU General Public License as published by the Free Software Foundation; |
| 7 | + version 2 of the License are accompanied with this source code. See http://opcfoundation.org/License/GPLv2 |
| 8 | + This source code is distributed in the hope that it will be useful, |
| 9 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 | +*/ |
29 | 12 |
|
30 | 13 | using System.Collections.Generic; |
31 | 14 | using System.Threading; |
32 | 15 | using System.Threading.Tasks; |
33 | 16 |
|
34 | | -namespace Opc.Ua.Client |
| 17 | +namespace Opc.Ua |
35 | 18 | { |
36 | 19 | /// <summary> |
37 | 20 | /// Caches the type tree of the server on the client side. |
@@ -216,6 +199,23 @@ ValueTask<NodeId> FindDataTypeIdAsync( |
216 | 199 | CancellationToken ct = default); |
217 | 200 | } |
218 | 201 |
|
| 202 | + /// <summary> |
| 203 | + /// Type table extensions |
| 204 | + /// </summary> |
| 205 | + public static class TypeTableExtensions |
| 206 | + { |
| 207 | + /// <summary> |
| 208 | + /// Expose a async type table as a synchronous table to |
| 209 | + /// adapt it to code that requires synchronous methods. |
| 210 | + /// </summary> |
| 211 | + /// <param name="table"></param> |
| 212 | + /// <returns></returns> |
| 213 | + public static ITypeTable AsTypeTable(this IAsyncTypeTable table) |
| 214 | + { |
| 215 | + return new TypeTableAdapter(table); |
| 216 | + } |
| 217 | + } |
| 218 | + |
219 | 219 | /// <summary> |
220 | 220 | /// Type table adapter for synchronous access to the table. |
221 | 221 | /// We need to keep the sync interface for now as it is shared |
|
0 commit comments