< Summary

Information
Class: Ice.ObjectPrxHelperBase.GetConnectionTaskCompletionCallback
Assembly: Ice
File(s): /_/csharp/src/Ice/Proxy.cs
Tag: 99_23991109993
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 1835
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 2
Total methods: 2
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
handleInvokeResponse(...)100%11100%

File(s)

/_/csharp/src/Ice/Proxy.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3#nullable enable
 4
 5using Ice.Internal;
 6using System.ComponentModel;
 7using System.Diagnostics.CodeAnalysis;
 8
 9namespace Ice;
 10
 11/// <summary>
 12/// The base interface of all Ice proxies.
 13/// </summary>
 14public interface ObjectPrx : IEquatable<ObjectPrx>
 15{
 16    /// <summary>
 17    /// Gets the communicator that created this proxy.
 18    /// </summary>
 19    /// <returns>The communicator that created this proxy.</returns>
 20    Communicator ice_getCommunicator();
 21
 22    /// <summary>
 23    /// Tests whether this object supports a specific Slice interface.
 24    /// </summary>
 25    /// <param name="id">The type ID of the Slice interface to test against.</param>
 26    /// <param name="context">The request context.</param>
 27    /// <returns><see langword="true"/> if the target object implements the Slice interface specified by <paramref name=
 28    /// or implements a derived interface, and <see langword="false"/> otherwise.</returns>
 29    bool ice_isA(string id, Dictionary<string, string>? context = null);
 30
 31    /// <summary>
 32    /// Tests whether this object supports a specific Slice interface.
 33    /// </summary>
 34    /// <param name="id">The type ID of the Slice interface to test against.</param>
 35    /// <param name="context">The request context.</param>
 36    /// <param name="progress">Sent progress provider.</param>
 37    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 38    /// <returns>A task that will complete with <see langword="true"/> if the target object implements the Slice
 39    /// interface specified by <paramref name="id"/> or implements a derived interface, and <see langword="false"/>
 40    /// otherwise.</returns>
 41    Task<bool> ice_isAAsync(
 42        string id,
 43        Dictionary<string, string>? context = null,
 44        IProgress<bool>? progress = null,
 45        CancellationToken cancel = default);
 46
 47    /// <summary>
 48    /// Tests whether the target object of this proxy can be reached.
 49    /// </summary>
 50    /// <param name="context">The request context.</param>
 51    void ice_ping(Dictionary<string, string>? context = null);
 52
 53    /// <summary>
 54    /// Tests whether the target object of this proxy can be reached.
 55    /// </summary>
 56    /// <param name="context">The request context.</param>
 57    /// <param name="progress">Sent progress provider.</param>
 58    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 59    /// <returns>A task that completes when the invocation completes.</returns>
 60    Task ice_pingAsync(
 61        Dictionary<string, string>? context = null,
 62        IProgress<bool>? progress = null,
 63        CancellationToken cancel = default);
 64
 65    /// <summary>
 66    /// Returns the Slice interfaces supported by this object as a list of Slice type IDs.
 67    /// </summary>
 68    /// <param name="context">The request context.</param>
 69    /// <returns>The Slice type IDs of the interfaces supported by this object, in alphabetical order.</returns>
 70    string[] ice_ids(Dictionary<string, string>? context = null);
 71
 72    /// <summary>
 73    /// Returns the Slice interfaces supported by this object as a list of Slice type IDs.
 74    /// </summary>
 75    /// <param name="context">The request context.</param>
 76    /// <param name="progress">Sent progress provider.</param>
 77    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 78    /// <returns>A task that will complete with The Slice type IDs of the interfaces supported by this object,
 79    /// in alphabetical order.</returns>
 80    Task<string[]> ice_idsAsync(
 81        Dictionary<string, string>? context = null,
 82        IProgress<bool>? progress = null,
 83        CancellationToken cancel = default);
 84
 85    /// <summary>
 86    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 87    /// </summary>
 88    /// <param name="context">The request context.</param>
 89    /// <returns>The Slice type ID of the most-derived interface.</returns>
 90    string ice_id(Dictionary<string, string>? context = null);
 91
 92    /// <summary>
 93    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 94    /// </summary>
 95    /// <param name="context">The request context.</param>
 96    /// <param name="progress">Sent progress provider.</param>
 97    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 98    /// <returns>The task object representing the asynchronous operation.</returns>
 99    Task<string> ice_idAsync(
 100        Dictionary<string, string>? context = null,
 101        IProgress<bool>? progress = null,
 102        CancellationToken cancel = default);
 103
 104    /// <summary>
 105    /// Invokes an operation dynamically.
 106    /// </summary>
 107    /// <param name="operation">The name of the operation to invoke.</param>
 108    /// <param name="mode">The operation mode (normal or idempotent).</param>
 109    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 110    /// <param name="outEncaps">The encoded out-parameters and return value
 111    /// for the operation. The return value follows any out-parameters.</param>
 112    /// <param name="context">The request context.</param>
 113    /// <returns>If the operation completed successfully, the return value is <see langword="true"/>.
 114    /// If the operation raises a user exception, the return value is <see langword="false"/>; in this case,
 115    /// <paramref name="outEncaps"/> contains the encoded user exception. If the operation raises a run-time exception,
 116    /// it throws it directly.</returns>
 117    bool ice_invoke(
 118        string operation,
 119        OperationMode mode,
 120        byte[] inEncaps,
 121        out byte[] outEncaps,
 122        Dictionary<string, string>? context = null);
 123
 124    /// <summary>
 125    /// Invokes an operation dynamically.
 126    /// </summary>
 127    /// <param name="operation">The name of the operation to invoke.</param>
 128    /// <param name="mode">The operation mode (normal or idempotent).</param>
 129    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 130    /// <param name="context">The request context.</param>
 131    /// <param name="progress">Sent progress provider.</param>
 132    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 133    /// <returns>The task object representing the asynchronous operation.</returns>
 134    Task<Object_Ice_invokeResult>
 135    ice_invokeAsync(
 136        string operation,
 137        OperationMode mode,
 138        byte[] inEncaps,
 139        Dictionary<string, string>? context = null,
 140        IProgress<bool>? progress = null,
 141        CancellationToken cancel = default);
 142
 143    /// <summary>
 144    /// Gets the identity embedded in this proxy.
 145    /// <returns>The identity of the target object.</returns>
 146    /// </summary>
 147    Identity ice_getIdentity();
 148
 149    /// <summary>
 150    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 151    /// <param name="newIdentity">The identity for the new proxy.</param>
 152    /// <returns>The proxy with the new identity.</returns>
 153    /// </summary>
 154    ObjectPrx ice_identity(Identity newIdentity);
 155
 156    /// <summary>
 157    /// Gets the per-proxy context for this proxy.
 158    /// </summary>
 159    /// <returns>The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value
 160    /// is null.</returns>
 161    Dictionary<string, string> ice_getContext();
 162
 163    /// <summary>
 164    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 165    /// </summary>
 166    /// <param name="newContext">The context for the new proxy.</param>
 167    /// <returns>The proxy with the new per-proxy context.</returns>
 168    ObjectPrx ice_context(Dictionary<string, string> newContext);
 169
 170    /// <summary>
 171    /// Gets the facet for this proxy.
 172    /// </summary>
 173    /// <returns>The facet for this proxy. If the proxy uses the default facet, the return value is the
 174    /// empty string.</returns>
 175    string ice_getFacet();
 176
 177    /// <summary>
 178    /// Creates a new proxy that is identical to this proxy, except for the facet.
 179    /// </summary>
 180    /// <param name="newFacet">The facet for the new proxy.</param>
 181    /// <returns>The proxy with the new facet.</returns>
 182    ObjectPrx ice_facet(string newFacet);
 183
 184    /// <summary>
 185    /// Gets the adapter ID for this proxy.
 186    /// </summary>
 187    /// <returns>The adapter ID. If the proxy does not have an adapter ID, the return value is the
 188    /// empty string.</returns>
 189    string ice_getAdapterId();
 190
 191    /// <summary>
 192    /// Creates a new proxy that is identical to this proxy, except for the adapter ID.
 193    /// </summary>
 194    /// <param name="newAdapterId">The adapter ID for the new proxy.</param>
 195    /// <returns>The proxy with the new adapter ID.</returns>
 196    ObjectPrx ice_adapterId(string newAdapterId);
 197
 198    /// <summary>
 199    /// Gets the endpoints used by this proxy.
 200    /// </summary>
 201    /// <returns>The endpoints used by this proxy.</returns>
 202    Endpoint[] ice_getEndpoints();
 203
 204    /// <summary>
 205    /// Creates a new proxy that is identical to this proxy, except for the endpoints.
 206    /// </summary>
 207    /// <param name="newEndpoints">The endpoints for the new proxy.</param>
 208    /// <returns>The proxy with the new endpoints.</returns>
 209    ObjectPrx ice_endpoints(Endpoint[] newEndpoints);
 210
 211    /// <summary>
 212    /// Gets the locator cache timeout of this proxy.
 213    /// </summary>
 214    /// <returns>The locator cache timeout value.</returns>
 215    TimeSpan ice_getLocatorCacheTimeout();
 216
 217    /// <summary>
 218    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 219    /// </summary>
 220    /// <param name="newTimeout">The new locator cache timeout (in seconds).</param>
 221    ObjectPrx ice_locatorCacheTimeout(int newTimeout);
 222
 223    /// <summary>
 224    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 225    /// </summary>
 226    /// <param name="newTimeout">The new locator cache timeout.</param>
 227    ObjectPrx ice_locatorCacheTimeout(TimeSpan newTimeout);
 228
 229    /// <summary>
 230    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 231    /// </summary>
 232    /// <param name="newTimeout">The new invocation timeout (in milliseconds).</param>
 233    ObjectPrx ice_invocationTimeout(int newTimeout);
 234
 235    /// <summary>
 236    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 237    /// </summary>
 238    /// <param name="newTimeout">The new invocation timeout.</param>
 239    ObjectPrx ice_invocationTimeout(TimeSpan newTimeout);
 240
 241    /// <summary>
 242    /// Gets the invocation timeout of this proxy.
 243    /// </summary>
 244    /// <returns>The invocation timeout value.</returns>
 245    TimeSpan ice_getInvocationTimeout();
 246
 247    /// <summary>
 248    /// Returns whether this proxy caches connections.
 249    /// </summary>
 250    /// <returns><see langword="true"/> if this proxy caches connections; <see langword="false"/> otherwise.</returns>
 251    bool ice_isConnectionCached();
 252
 253    /// <summary>
 254    /// Creates a new proxy that is identical to this proxy, except for connection caching.
 255    /// </summary>
 256    /// <param name="newCache"><see langword="true"/> if the new proxy should cache connections;
 257    /// <see langword="false"/> otherwise.</param>
 258    /// <returns>The new proxy with the specified caching policy.</returns>
 259    ObjectPrx ice_connectionCached(bool newCache);
 260
 261    /// <summary>
 262    /// Returns how this proxy selects endpoints (randomly or ordered).
 263    /// </summary>
 264    /// <returns>The endpoint selection policy.</returns>
 265    EndpointSelectionType ice_getEndpointSelection();
 266
 267    /// <summary>
 268    /// Creates a new proxy that is identical to this proxy, except for the endpoint selection policy.
 269    /// </summary>
 270    /// <param name="newType">The new endpoint selection policy.</param>
 271    /// <returns>The new proxy with the specified endpoint selection policy.</returns>
 272    ObjectPrx ice_endpointSelection(EndpointSelectionType newType);
 273
 274    /// <summary>
 275    /// Creates a new proxy that is identical to this proxy, except for the encoding used to marshal
 276    /// parameters.
 277    /// </summary>
 278    /// <param name="encodingVersion">The encoding version to use to marshal requests parameters.</param>
 279    /// <returns>The new proxy with the specified encoding version.</returns>
 280    ObjectPrx ice_encodingVersion(EncodingVersion encodingVersion);
 281
 282    /// <summary>
 283    /// Gets the encoding version used to marshal requests parameters.
 284    /// </summary>
 285    /// <returns>The encoding version.</returns>
 286    EncodingVersion ice_getEncodingVersion();
 287
 288    /// <summary>
 289    /// Gets the router for this proxy.
 290    /// </summary>
 291    /// <returns>The router for the proxy. If no router is configured for the proxy, the return value
 292    /// is null.</returns>
 293    RouterPrx? ice_getRouter();
 294
 295    /// <summary>
 296    /// Creates a new proxy that is identical to this proxy, except for the router.
 297    /// </summary>
 298    /// <param name="router">The router for the new proxy.</param>
 299    /// <returns>The new proxy with the specified router.</returns>
 300    ObjectPrx ice_router(RouterPrx? router);
 301
 302    /// <summary>
 303    /// Gets the locator for this proxy.
 304    /// </summary>
 305    /// <returns>The locator for this proxy. If no locator is configured, the return value is null.</returns>
 306    LocatorPrx? ice_getLocator();
 307
 308    /// <summary>
 309    /// Creates a new proxy that is identical to this proxy, except for the locator.
 310    /// </summary>
 311    /// <param name="locator">The locator for the new proxy.</param>
 312    /// <returns>The new proxy with the specified locator.</returns>
 313    ObjectPrx ice_locator(LocatorPrx? locator);
 314
 315    /// <summary>
 316    /// Returns whether this proxy uses collocation optimization.
 317    /// </summary>
 318    /// <returns><see langword="true"/> if the proxy uses collocation optimization;
 319    /// <see langword="false"/> otherwise.</returns>
 320    bool ice_isCollocationOptimized();
 321
 322    /// <summary>
 323    /// Creates a new proxy that is identical to this proxy, except for collocation optimization.
 324    /// </summary>
 325    /// <param name="collocated"><see langword="true"/> if the new proxy enables collocation optimization;
 326    /// <see langword="false"/> otherwise.</param>
 327    /// <returns>The new proxy the specified collocation optimization.</returns>
 328    ObjectPrx ice_collocationOptimized(bool collocated);
 329
 330    /// <summary>
 331    /// Creates a new proxy that is identical to this proxy, but uses twoway invocations.
 332    /// </summary>
 333    /// <returns>A new proxy that uses twoway invocations.</returns>
 334    ObjectPrx ice_twoway();
 335
 336    /// <summary>
 337    /// Returns whether this proxy uses twoway invocations.
 338    /// </summary>
 339    /// <returns><see langword="true"/> if this proxy uses twoway invocations;
 340    /// <see langword="false"/> otherwise.</returns>
 341    bool ice_isTwoway();
 342
 343    /// <summary>
 344    /// Creates a new proxy that is identical to this proxy, but uses oneway invocations.
 345    /// </summary>
 346    /// <returns>A new proxy that uses oneway invocations.</returns>
 347    ObjectPrx ice_oneway();
 348
 349    /// <summary>
 350    /// Returns whether this proxy uses oneway invocations.
 351    /// </summary>
 352    /// <returns><see langword="true"/> if this proxy uses oneway invocations;
 353    /// <see langword="false"/> otherwise.</returns>
 354    bool ice_isOneway();
 355
 356    /// <summary>
 357    /// Creates a new proxy that is identical to this proxy, but uses batch oneway invocations.
 358    /// </summary>
 359    /// <returns>A new proxy that uses batch oneway invocations.</returns>
 360    ObjectPrx ice_batchOneway();
 361
 362    /// <summary>
 363    /// Returns whether this proxy uses batch oneway invocations.
 364    /// </summary>
 365    /// <returns><see langword="true"/> if this proxy uses batch oneway invocations;
 366    /// <see langword="false"/> otherwise.</returns>
 367    bool ice_isBatchOneway();
 368
 369    /// <summary>
 370    /// Creates a new proxy that is identical to this proxy, but uses datagram invocations.
 371    /// </summary>
 372    /// <returns>A new proxy that uses datagram invocations.</returns>
 373    ObjectPrx ice_datagram();
 374
 375    /// <summary>
 376    /// Returns whether this proxy uses datagram invocations.
 377    /// </summary>
 378    /// <returns><see langword="true"/> if this proxy uses datagram invocations;
 379    /// <see langword="false"/> otherwise.</returns>
 380    bool ice_isDatagram();
 381
 382    /// <summary>
 383    /// Creates a new proxy that is identical to this proxy, but uses batch datagram invocations.
 384    /// </summary>
 385    /// <returns>A new proxy that uses batch datagram invocations.</returns>
 386    ObjectPrx ice_batchDatagram();
 387
 388    /// <summary>
 389    /// Returns whether this proxy uses batch datagram invocations.
 390    /// </summary>
 391    /// <returns><see langword="true"/> if this proxy uses batch datagram invocations;
 392    /// <see langword="false"/> otherwise.</returns>
 393    bool ice_isBatchDatagram();
 394
 395    /// <summary>
 396    /// Creates a new proxy that is identical to this proxy, except for compression.
 397    /// </summary>
 398    /// <param name="compress"><see langword="true"/> enables compression for the new proxy;
 399    /// <see langword="false"/> disables compression.</param>
 400    /// <returns>A new proxy with the specified compression setting.</returns>
 401    ObjectPrx ice_compress(bool compress);
 402
 403    /// <summary>
 404    /// Gets the compression override setting of this proxy.
 405    /// </summary>
 406    /// <returns>The compression override setting. If null is returned, no override is set. Otherwise, <see langword="tr
 407    /// if compression is enabled, <see langword="false"/> otherwise.</returns>
 408    bool? ice_getCompress();
 409
 410    /// <summary>
 411    /// Creates a new proxy that is identical to this proxy, except for its connection ID.
 412    /// </summary>
 413    /// <param name="connectionId">The connection ID for the new proxy. An empty string removes the
 414    /// connection ID.</param>
 415    /// <returns>A new proxy with the specified connection ID.</returns>
 416    ObjectPrx ice_connectionId(string connectionId);
 417
 418    /// <summary>
 419    /// Gets the connection id of this proxy.
 420    /// </summary>
 421    /// <returns>The connection id.</returns>
 422    string ice_getConnectionId();
 423
 424    /// <summary>
 425    /// Returns a proxy that is identical to this proxy, except it's a fixed proxy bound
 426    /// the given connection.
 427    /// </summary>
 428    /// <param name="connection">The fixed proxy connection.</param>
 429    /// <returns>A fixed proxy bound to the given connection.</returns>
 430    ObjectPrx ice_fixed(Ice.Connection connection);
 431
 432    /// <summary>
 433    /// Returns whether this proxy is a fixed proxy.
 434    /// </summary>
 435    /// <returns><see langword="true"/> if this is a fixed proxy; <see langword="false"/> otherwise.</returns>
 436    bool ice_isFixed();
 437
 438    /// <summary>
 439    /// Gets the connection to the server that hosts the target object. This method establishes the connection to the
 440    /// server if it is not already established.
 441    /// </summary>
 442    /// <returns>The connection to the server that hosts the target object, or null when this proxy uses collocation
 443    /// optimization to communicate with the target object.</returns>
 444    Connection? ice_getConnection();
 445
 446    /// <summary>
 447    /// Gets the connection to the server that hosts the target object. This method establishes the connection to the
 448    /// server if it is not already established.
 449    /// </summary>
 450    /// <param name="progress">Sent progress provider.</param>
 451    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 452    /// <returns>The connection to the server that hosts the target object, or null when this proxy uses collocation
 453    /// optimization to communicate with the target object.</returns>
 454    Task<Connection?> ice_getConnectionAsync(IProgress<bool>? progress = null, CancellationToken cancel = default);
 455
 456    /// <summary>
 457    /// Gets the cached Connection for this proxy. If the proxy does not yet have an established
 458    /// connection, it does not attempt to create a connection.
 459    /// </summary>
 460    /// <returns>The cached Connection for this proxy (null if the proxy does not have
 461    /// an established connection).</returns>
 462    Connection? ice_getCachedConnection();
 463
 464    /// <summary>
 465    /// Flushes any pending batched requests for this proxy. The call blocks until the flush is complete.
 466    /// </summary>
 467    void ice_flushBatchRequests();
 468
 469    /// <summary>
 470    /// Asynchronously flushes any pending batched requests for this proxy.
 471    /// </summary>
 472    /// <param name="progress">Sent progress provider.</param>
 473    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 474    /// <returns>The task object representing the asynchronous operation.</returns>
 475    Task ice_flushBatchRequestsAsync(
 476        IProgress<bool>? progress = null,
 477        CancellationToken cancel = default);
 478
 479    /// <summary>
 480    /// Write a proxy to the output stream.
 481    /// </summary>
 482    /// <param name="os">Output stream object to write the proxy.</param>
 483    [EditorBrowsable(EditorBrowsableState.Never)]
 484    void iceWrite(OutputStream os);
 485
 486    /// <summary>
 487    /// Returns a scheduler object that uses the Ice thread pool.
 488    /// </summary>
 489    /// <returns>The task scheduler object.</returns>
 490    TaskScheduler ice_scheduler();
 491
 492    /// <summary>
 493    /// Ensures that a proxy received over the wire is not null.
 494    /// </summary>
 495    /// <param name="proxy">The proxy to check.</param>
 496    /// <param name="current">The current object of the corresponding incoming request.</param>
 497    /// <exception cref="MarshalException">Thrown when the proxy is null.</exception>
 498    static void checkNotNull(ObjectPrx? proxy, Current current)
 499    {
 500        if (proxy is null)
 501        {
 502            throw new MarshalException(
 503                $"Null proxy passed to '{current.operation}' on object '{current.adapter.getCommunicator().identityToStr
 504        }
 505    }
 506}
 507
 508/// <summary>
 509/// Represent the result of the ice_invokeAsync operation.
 510/// </summary>
 511public record struct Object_Ice_invokeResult(bool returnValue, byte[] outEncaps);
 512
 513/// <summary>
 514/// Base class of all object proxies.
 515/// </summary>
 516public abstract class ObjectPrxHelperBase : ObjectPrx
 517{
 518    public static bool operator ==(ObjectPrxHelperBase? lhs, ObjectPrxHelperBase? rhs) =>
 519        lhs is not null ? lhs.Equals(rhs) : rhs is null;
 520
 521    public static bool operator !=(ObjectPrxHelperBase? lhs, ObjectPrxHelperBase? rhs) => !(lhs == rhs);
 522
 523    /// <summary>
 524    /// Returns whether this proxy equals the passed object. Two proxies are equal if they are equal in all
 525    /// respects, that is, if their object identity, endpoints timeout settings, and so on are all equal.
 526    /// </summary>
 527    /// <param name="other">The proxy to compare this proxy with.</param>
 528    /// <returns><see langword="true"/> if this proxy is equal to <paramref name="other"/>;
 529    /// <see langword="false"/> otherwise.</returns>
 530    public bool Equals(ObjectPrx? other) =>
 531        other is not null && _reference == ((ObjectPrxHelperBase)other)._reference;
 532
 533    public override bool Equals(object? obj) => Equals(obj as ObjectPrx);
 534
 535    /// <summary>
 536    /// Returns a hash code for this proxy.
 537    /// </summary>
 538    /// <returns>The hash code.</returns>
 539    public override int GetHashCode() => _reference.GetHashCode();
 540
 541    /// <summary>
 542    /// Gets the communicator that created this proxy.
 543    /// </summary>
 544    /// <returns>The communicator that created this proxy.</returns>
 545    public Communicator ice_getCommunicator() => _reference.getCommunicator();
 546
 547    /// <summary>
 548    /// Gets the stringified form of this proxy.
 549    /// </summary>
 550    /// <returns>The stringified proxy.</returns>
 551    public override string ToString() => _reference.ToString();
 552
 553    /// <summary>
 554    /// Tests whether this object supports a specific Slice interface.
 555    /// </summary>
 556    /// <param name="id">The type ID of the Slice interface to test against.</param>
 557    /// <param name="context">The request context.</param>
 558    /// <returns><see langword="true"/> if the target object has the interface specified by id or derives
 559    /// from the interface specified by id.</returns>
 560    public bool ice_isA(string id, Dictionary<string, string>? context = null)
 561    {
 562        try
 563        {
 564            return iceI_ice_isAAsync(id, context, synchronous: true, progress: null, CancellationToken.None).Result;
 565        }
 566        catch (AggregateException ex)
 567        {
 568            throw ex.InnerException!;
 569        }
 570    }
 571
 572    /// <summary>
 573    /// Tests whether this object supports a specific Slice interface.
 574    /// </summary>
 575    /// <param name="id">The type ID of the Slice interface to test against.</param>
 576    /// <param name="context">The request context.</param>
 577    /// <param name="progress">Sent progress provider.</param>
 578    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 579    /// <returns>The task object representing the asynchronous operation.</returns>
 580    public Task<bool> ice_isAAsync(
 581        string id,
 582        Dictionary<string, string>? context = null,
 583        IProgress<bool>? progress = null,
 584        CancellationToken cancel = default) => iceI_ice_isAAsync(id, context, synchronous: false, progress, cancel);
 585
 586    private Task<bool>
 587    iceI_ice_isAAsync(
 588        string id,
 589        Dictionary<string, string>? context,
 590        bool synchronous,
 591        IProgress<bool>? progress,
 592        CancellationToken cancel)
 593    {
 594        iceCheckTwowayOnly(_ice_isA_name);
 595        var completed = new OperationTaskCompletionCallback<bool>(progress, cancel);
 596        iceI_ice_isA(id, context, completed, synchronous);
 597        return completed.Task;
 598    }
 599
 600    private const string _ice_isA_name = "ice_isA";
 601
 602    private void iceI_ice_isA(
 603        string id,
 604        Dictionary<string, string>? context,
 605        OutgoingAsyncCompletionCallback completed,
 606        bool synchronous)
 607    {
 608        iceCheckAsyncTwowayOnly(_ice_isA_name);
 609        getOutgoingAsync<bool>(completed).invoke(
 610            _ice_isA_name,
 611            OperationMode.Idempotent,
 612            FormatType.CompactFormat,
 613            context,
 614            synchronous,
 615            (OutputStream os) => os.writeString(id),
 616            null,
 617            (InputStream iss) => iss.readBool());
 618    }
 619
 620    /// <summary>
 621    /// Tests whether the target object of this proxy can be reached.
 622    /// </summary>
 623    /// <param name="context">The request context.</param>
 624    public void ice_ping(Dictionary<string, string>? context = null)
 625    {
 626        try
 627        {
 628            iceI_ice_pingAsync(context, synchronous: true, progress: null, CancellationToken.None).Wait();
 629        }
 630        catch (AggregateException ex)
 631        {
 632            throw ex.InnerException!;
 633        }
 634    }
 635
 636    /// <summary>
 637    /// Tests whether the target object of this proxy can be reached.
 638    /// </summary>
 639    /// <param name="context">The request context.</param>
 640    /// <param name="progress">Sent progress provider.</param>
 641    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 642    /// <returns>The task object representing the asynchronous operation.</returns>
 643    public Task ice_pingAsync(
 644        Dictionary<string, string>? context = null,
 645        IProgress<bool>? progress = null,
 646        CancellationToken cancel = default) => iceI_ice_pingAsync(context, synchronous: false, progress, cancel);
 647
 648    private Task
 649    iceI_ice_pingAsync(
 650        Dictionary<string, string>? context,
 651        bool synchronous,
 652        IProgress<bool>? progress,
 653        CancellationToken cancel)
 654    {
 655        var completed = new OperationTaskCompletionCallback<object>(progress, cancel);
 656        iceI_ice_ping(context, completed, synchronous);
 657        return completed.Task;
 658    }
 659
 660    private const string _ice_ping_name = "ice_ping";
 661
 662    private void iceI_ice_ping(
 663        Dictionary<string, string>? context,
 664        OutgoingAsyncCompletionCallback completed,
 665        bool synchronous)
 666    {
 667        getOutgoingAsync<object>(completed).invoke(
 668            _ice_ping_name,
 669            OperationMode.Idempotent,
 670            FormatType.CompactFormat,
 671            context,
 672            synchronous);
 673    }
 674
 675    /// <summary>
 676    /// Gets the Slice type IDs of the interfaces supported by the target object of this proxy.
 677    /// </summary>
 678    /// <param name="context">The request context.</param>
 679    /// <returns>The Slice type IDs of the interfaces supported by the target object, in alphabetical order.</returns>
 680    public string[] ice_ids(Dictionary<string, string>? context = null)
 681    {
 682        try
 683        {
 684            return iceI_ice_idsAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 685        }
 686        catch (AggregateException ex)
 687        {
 688            throw ex.InnerException!;
 689        }
 690    }
 691
 692    /// <summary>
 693    /// Gets the Slice type IDs of the interfaces supported by the target object of this proxy.
 694    /// </summary>
 695    /// <param name="context">The request context.</param>
 696    /// <param name="progress">Sent progress provider.</param>
 697    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 698    /// <returns>The task object representing the asynchronous operation.</returns>
 699    public Task<string[]>
 700    ice_idsAsync(
 701        Dictionary<string, string>? context = null,
 702        IProgress<bool>? progress = null,
 703        CancellationToken cancel = default) => iceI_ice_idsAsync(context, synchronous: false, progress, cancel);
 704
 705    private Task<string[]> iceI_ice_idsAsync(
 706        Dictionary<string, string>? context,
 707        bool synchronous,
 708        IProgress<bool>? progress,
 709        CancellationToken cancel)
 710    {
 711        iceCheckTwowayOnly(_ice_ids_name);
 712        var completed = new OperationTaskCompletionCallback<string[]>(progress, cancel);
 713        iceI_ice_ids(context, completed, synchronous);
 714        return completed.Task;
 715    }
 716
 717    private const string _ice_ids_name = "ice_ids";
 718
 719    private void iceI_ice_ids(
 720        Dictionary<string, string>? context,
 721        OutgoingAsyncCompletionCallback completed,
 722        bool synchronous)
 723    {
 724        iceCheckAsyncTwowayOnly(_ice_ids_name);
 725        getOutgoingAsync<string[]>(completed).invoke(
 726            _ice_ids_name,
 727            OperationMode.Idempotent,
 728            FormatType.CompactFormat,
 729            context,
 730            synchronous,
 731            read: (InputStream iss) => iss.readStringSeq());
 732    }
 733
 734    /// <summary>
 735    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 736    /// </summary>
 737    /// <param name="context">The request context.</param>
 738    /// <returns>The Slice type ID of the most-derived interface.</returns>
 739    public string ice_id(Dictionary<string, string>? context = null)
 740    {
 741        try
 742        {
 743            return iceI_ice_idAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 744        }
 745        catch (AggregateException ex)
 746        {
 747            throw ex.InnerException!;
 748        }
 749    }
 750
 751    /// <summary>
 752    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 753    /// </summary>
 754    /// <param name="context">The request context.</param>
 755    /// <param name="progress">Sent progress provider.</param>
 756    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 757    /// <returns>The task object representing the asynchronous operation.</returns>
 758    public Task<string> ice_idAsync(
 759        Dictionary<string, string>? context = null,
 760        IProgress<bool>? progress = null,
 761        CancellationToken cancel = default) => iceI_ice_idAsync(context, synchronous: false, progress, cancel);
 762
 763    private Task<string>
 764    iceI_ice_idAsync(
 765        Dictionary<string, string>? context,
 766        bool synchronous,
 767        IProgress<bool>? progress,
 768        CancellationToken cancel)
 769    {
 770        iceCheckTwowayOnly(_ice_id_name);
 771        var completed = new OperationTaskCompletionCallback<string>(progress, cancel);
 772        iceI_ice_id(context, completed, synchronous);
 773        return completed.Task;
 774    }
 775
 776    private const string _ice_id_name = "ice_id";
 777
 778    private void iceI_ice_id(
 779        Dictionary<string, string>? context,
 780        OutgoingAsyncCompletionCallback completed,
 781        bool synchronous)
 782    {
 783        getOutgoingAsync<string>(completed).invoke(
 784            _ice_id_name,
 785            OperationMode.Idempotent,
 786            FormatType.CompactFormat,
 787            context,
 788            synchronous,
 789            read: (InputStream iss) => iss.readString());
 790    }
 791
 792    /// <summary>
 793    /// Invokes an operation dynamically.
 794    /// </summary>
 795    /// <param name="operation">The name of the operation to invoke.</param>
 796    /// <param name="mode">The operation mode (normal or idempotent).</param>
 797    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 798    /// <param name="outEncaps">The encoded out-parameters and return value
 799    /// for the operation. The return value follows any out-parameters.</param>
 800    /// <param name="context">The request context.</param>
 801    /// <returns>If the operation completed successfully, the return value is <see langword="true"/>.
 802    /// If the operation raises a user exception, the return value is <see langword="false"/>; in this case,
 803    /// <paramref name="outEncaps"/> contains the encoded user exception.
 804    /// If the operation raises a run-time exception, it throws it directly.</returns>
 805    public bool ice_invoke(
 806        string operation,
 807        OperationMode mode,
 808        byte[] inEncaps,
 809        out byte[] outEncaps,
 810        Dictionary<string, string>? context = null)
 811    {
 812        try
 813        {
 814            Object_Ice_invokeResult result = iceI_ice_invokeAsync(
 815                operation,
 816                mode,
 817                inEncaps,
 818                context,
 819                synchronous: true,
 820                progress: null,
 821                CancellationToken.None).Result;
 822            outEncaps = result.outEncaps;
 823            return result.returnValue;
 824        }
 825        catch (AggregateException ex)
 826        {
 827            throw ex.InnerException!;
 828        }
 829    }
 830
 831    /// <summary>
 832    /// Invokes an operation dynamically.
 833    /// </summary>
 834    /// <param name="operation">The name of the operation to invoke.</param>
 835    /// <param name="mode">The operation mode (normal or idempotent).</param>
 836    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 837    /// <param name="context">The request context.</param>
 838    /// <param name="progress">Sent progress provider.</param>
 839    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 840    /// <returns>The task object representing the asynchronous operation.</returns>
 841    public Task<Object_Ice_invokeResult>
 842    ice_invokeAsync(
 843        string operation,
 844        OperationMode mode,
 845        byte[] inEncaps,
 846        Dictionary<string, string>? context = null,
 847        IProgress<bool>? progress = null,
 848        CancellationToken cancel = default) =>
 849            iceI_ice_invokeAsync(operation, mode, inEncaps, context, synchronous: false, progress, cancel);
 850
 851    private Task<Object_Ice_invokeResult>
 852    iceI_ice_invokeAsync(
 853        string operation,
 854        OperationMode mode,
 855        byte[] inEncaps,
 856        Dictionary<string, string>? context,
 857        bool synchronous,
 858        IProgress<bool>? progress,
 859        CancellationToken cancel)
 860    {
 861        var completed = new InvokeTaskCompletionCallback(progress, cancel);
 862        iceI_ice_invoke(operation, mode, inEncaps, context, completed, synchronous);
 863        return completed.Task;
 864    }
 865
 866    private void iceI_ice_invoke(
 867        string operation,
 868        OperationMode mode,
 869        byte[] inEncaps,
 870        Dictionary<string, string>? context,
 871        OutgoingAsyncCompletionCallback completed,
 872        bool synchronous) => getInvokeOutgoingAsync(completed).invoke(operation, mode, inEncaps, context, synchronous);
 873
 874    /// <summary>
 875    /// Gets the identity embedded in this proxy.
 876    /// </summary>
 877    /// <returns>The identity of the target object.</returns>
 878    public Identity ice_getIdentity() => _reference.getIdentity() with { };
 879
 880    /// <summary>
 881    /// Creates a new proxy that is identical to this proxy, except for the proxy identity.
 882    /// </summary>
 883    /// <param name="newIdentity">The identity for the new proxy.</param>
 884    /// <returns>The new proxy with the specified identity.</returns>
 885    /// <exception cref="ArgumentException">If the name of the new identity is empty.</exception>
 886    public ObjectPrx ice_identity(Identity newIdentity)
 887    {
 888        if (newIdentity.name.Length == 0)
 889        {
 890            throw new ArgumentException("The name of an Ice object identity cannot be empty.", nameof(newIdentity));
 891        }
 892        if (newIdentity == _reference.getIdentity())
 893        {
 894            return this;
 895        }
 896        else
 897        {
 898            return new ObjectPrxHelper(_reference.changeIdentity(newIdentity));
 899        }
 900    }
 901
 902    /// <summary>
 903    /// Gets the per-proxy context for this proxy.
 904    /// </summary>
 905    /// <returns>The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value
 906    /// is null.</returns>
 907    public Dictionary<string, string> ice_getContext() => new Dictionary<string, string>(_reference.getContext());
 908
 909    /// <summary>
 910    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 911    /// </summary>
 912    /// <param name="newContext">The context for the new proxy.</param>
 913    /// <returns>The proxy with the new per-proxy context.</returns>
 914    public ObjectPrx ice_context(Dictionary<string, string> newContext) =>
 915        iceNewInstance(_reference.changeContext(newContext));
 916
 917    /// <summary>
 918    /// Gets the facet for this proxy.
 919    /// </summary>
 920    /// <returns>The facet for this proxy. If the proxy uses the default facet, the return value is the
 921    /// empty string.</returns>
 922    public string ice_getFacet() => _reference.getFacet();
 923
 924    /// <summary>
 925    /// Creates a new proxy that is identical to this proxy, except for the facet.
 926    /// </summary>
 927    /// <param name="newFacet">The facet for the new proxy.</param>
 928    /// <returns>The proxy with the new facet.</returns>
 929    public ObjectPrx ice_facet(string newFacet)
 930    {
 931        newFacet ??= "";
 932
 933        if (newFacet == _reference.getFacet())
 934        {
 935            return this;
 936        }
 937        else
 938        {
 939            return new ObjectPrxHelper(_reference.changeFacet(newFacet));
 940        }
 941    }
 942
 943    /// <summary>
 944    /// Gets the adapter ID for this proxy.
 945    /// </summary>
 946    /// <returns>The adapter ID. If the proxy does not have an adapter ID, the return value is the
 947    /// empty string.</returns>
 948    public string ice_getAdapterId() => _reference.getAdapterId();
 949
 950    /// <summary>
 951    /// Creates a new proxy that is identical to this proxy, except for the adapter ID.
 952    /// </summary>
 953    /// <param name="newAdapterId">The adapter ID for the new proxy.</param>
 954    /// <returns>The new proxy with the specified adapter ID.</returns>
 955    public ObjectPrx ice_adapterId(string newAdapterId)
 956    {
 957        newAdapterId ??= "";
 958
 959        if (newAdapterId == _reference.getAdapterId())
 960        {
 961            return this;
 962        }
 963        else
 964        {
 965            return iceNewInstance(_reference.changeAdapterId(newAdapterId));
 966        }
 967    }
 968
 969    /// <summary>
 970    /// Gets the endpoints used by this proxy.
 971    /// </summary>
 972    /// <returns>The endpoints used by this proxy.</returns>
 973    public Endpoint[] ice_getEndpoints() => (Endpoint[])_reference.getEndpoints().Clone();
 974
 975    /// <summary>
 976    /// Creates a new proxy that is identical to this proxy, except for the endpoints.
 977    /// </summary>
 978    /// <param name="newEndpoints">The endpoints for the new proxy.</param>
 979    /// <returns>The new proxy with the specified endpoints.</returns>
 980    public ObjectPrx ice_endpoints(Endpoint[] newEndpoints)
 981    {
 982        newEndpoints ??= [];
 983
 984        if (_reference.getEndpoints().SequenceEqual(newEndpoints))
 985        {
 986            return this;
 987        }
 988        else
 989        {
 990            var endpoints = new EndpointI[newEndpoints.Length];
 991            for (int i = 0; i < newEndpoints.Length; ++i)
 992            {
 993                endpoints[i] = (EndpointI)newEndpoints[i];
 994            }
 995            return iceNewInstance(_reference.changeEndpoints(endpoints));
 996        }
 997    }
 998
 999    /// <summary>
 1000    /// Gets the locator cache timeout of this proxy.
 1001    /// </summary>
 1002    /// <returns>The locator cache timeout value.</returns>
 1003    public TimeSpan ice_getLocatorCacheTimeout() => _reference.getLocatorCacheTimeout();
 1004
 1005    /// <summary>
 1006    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 1007    /// </summary>
 1008    /// <param name="newTimeout">The new locator cache timeout (in seconds).</param>
 1009    /// <returns>The new proxy with the specified locator cache timeout.</returns>
 1010    public ObjectPrx ice_locatorCacheTimeout(int newTimeout) =>
 1011        ice_locatorCacheTimeout(TimeSpan.FromSeconds(newTimeout));
 1012
 1013    /// <summary>
 1014    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 1015    /// </summary>
 1016    /// <param name="newTimeout">The new locator cache timeout.</param>
 1017    /// <returns>The new proxy with the specified locator cache timeout.</returns>
 1018    public ObjectPrx ice_locatorCacheTimeout(TimeSpan newTimeout)
 1019    {
 1020        if (newTimeout == _reference.getLocatorCacheTimeout())
 1021        {
 1022            return this;
 1023        }
 1024        else
 1025        {
 1026            return iceNewInstance(_reference.changeLocatorCacheTimeout(newTimeout));
 1027        }
 1028    }
 1029
 1030    /// <summary>
 1031    /// Gets the invocation timeout of this proxy.
 1032    /// </summary>
 1033    /// <returns>The invocation timeout value.</returns>
 1034    public TimeSpan ice_getInvocationTimeout() => _reference.getInvocationTimeout();
 1035
 1036    /// <summary>
 1037    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 1038    /// </summary>
 1039    /// <param name="newTimeout">The new invocation timeout (in milliseconds).</param>
 1040    /// <returns>The new proxy with the specified invocation timeout.</returns>
 1041    public ObjectPrx ice_invocationTimeout(int newTimeout) =>
 1042        ice_invocationTimeout(TimeSpan.FromMilliseconds(newTimeout));
 1043
 1044    /// <summary>
 1045    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 1046    /// </summary>
 1047    /// <param name="newTimeout">The new invocation timeout.</param>
 1048    /// <returns>The new proxy with the specified invocation timeout.</returns>
 1049    public ObjectPrx ice_invocationTimeout(TimeSpan newTimeout)
 1050    {
 1051        if (newTimeout == _reference.getInvocationTimeout())
 1052        {
 1053            return this;
 1054        }
 1055        else
 1056        {
 1057            return iceNewInstance(_reference.changeInvocationTimeout(newTimeout));
 1058        }
 1059    }
 1060
 1061    /// <summary>
 1062    /// Returns whether this proxy caches connections.
 1063    /// </summary>
 1064    /// <returns><see langword="true"/> if this proxy caches connections; <see langword="false"/> otherwise.</returns>
 1065    public bool ice_isConnectionCached() => _reference.getCacheConnection();
 1066
 1067    /// <summary>
 1068    /// Creates a new proxy that is identical to this proxy, except for connection caching.
 1069    /// </summary>
 1070    /// <param name="newCache"><see langword="true"/> if the new proxy should cache connections;
 1071    /// <see langword="false"/>, otherwise.</param>
 1072    /// <returns>The new proxy with the specified caching policy.</returns>
 1073    public ObjectPrx ice_connectionCached(bool newCache)
 1074    {
 1075        if (newCache == _reference.getCacheConnection())
 1076        {
 1077            return this;
 1078        }
 1079        else
 1080        {
 1081            return iceNewInstance(_reference.changeCacheConnection(newCache));
 1082        }
 1083    }
 1084
 1085    /// <summary>
 1086    /// Returns how this proxy selects endpoints (randomly or ordered).
 1087    /// </summary>
 1088    /// <returns>The endpoint selection policy.</returns>
 1089    public EndpointSelectionType ice_getEndpointSelection() => _reference.getEndpointSelection();
 1090
 1091    /// <summary>
 1092    /// Creates a new proxy that is identical to this proxy, except for the endpoint selection policy.
 1093    /// </summary>
 1094    /// <param name="newType">The new endpoint selection policy.</param>
 1095    /// <returns>The new proxy with the specified endpoint selection policy.</returns>
 1096    public ObjectPrx ice_endpointSelection(EndpointSelectionType newType)
 1097    {
 1098        if (newType == _reference.getEndpointSelection())
 1099        {
 1100            return this;
 1101        }
 1102        else
 1103        {
 1104            return iceNewInstance(_reference.changeEndpointSelection(newType));
 1105        }
 1106    }
 1107
 1108    /// <summary>
 1109    /// Creates a new proxy that is identical to this proxy, except for the encoding used to marshal
 1110    /// parameters.
 1111    /// </summary>
 1112    /// <param name="encodingVersion">The encoding version to use to marshal requests parameters.</param>
 1113    /// <returns>The new proxy with the specified encoding version.</returns>
 1114    public ObjectPrx ice_encodingVersion(EncodingVersion encodingVersion)
 1115    {
 1116        if (encodingVersion == _reference.getEncoding())
 1117        {
 1118            return this;
 1119        }
 1120        else
 1121        {
 1122            return iceNewInstance(_reference.changeEncoding(encodingVersion));
 1123        }
 1124    }
 1125
 1126    /// <summary>
 1127    /// Gets the encoding version used to marshal requests parameters.
 1128    /// </summary>
 1129    /// <returns>The encoding version.</returns>
 1130    public EncodingVersion ice_getEncodingVersion() => _reference.getEncoding();
 1131
 1132    /// <summary>
 1133    /// Gets the router for this proxy.
 1134    /// </summary>
 1135    /// <returns>The router for the proxy. If no router is configured for the proxy, the return value
 1136    /// is null.</returns>
 1137    public RouterPrx? ice_getRouter()
 1138    {
 1139        RouterInfo ri = _reference.getRouterInfo();
 1140        return ri?.getRouter();
 1141    }
 1142
 1143    /// <summary>
 1144    /// Creates a new proxy that is identical to this proxy, except for the router.
 1145    /// </summary>
 1146    /// <param name="router">The router for the new proxy.</param>
 1147    /// <returns>The new proxy with the specified router.</returns>
 1148    public ObjectPrx ice_router(RouterPrx? router)
 1149    {
 1150        if (router == _reference.getRouterInfo()?.getRouter())
 1151        {
 1152            return this;
 1153        }
 1154        else
 1155        {
 1156            return iceNewInstance(_reference.changeRouter(router));
 1157        }
 1158    }
 1159
 1160    /// <summary>
 1161    /// Gets the locator for this proxy.
 1162    /// </summary>
 1163    /// <returns>The locator for this proxy. If no locator is configured, the return value is null.</returns>
 1164    public LocatorPrx? ice_getLocator()
 1165    {
 1166        LocatorInfo li = _reference.getLocatorInfo();
 1167        return li?.getLocator();
 1168    }
 1169
 1170    /// <summary>
 1171    /// Creates a new proxy that is identical to this proxy, except for the locator.
 1172    /// </summary>
 1173    /// <param name="locator">The locator for the new proxy.</param>
 1174    /// <returns>The new proxy with the specified locator.</returns>
 1175    public ObjectPrx ice_locator(LocatorPrx? locator)
 1176    {
 1177        if (locator == _reference.getLocatorInfo()?.getLocator())
 1178        {
 1179            return this;
 1180        }
 1181        else
 1182        {
 1183            return iceNewInstance(_reference.changeLocator(locator));
 1184        }
 1185    }
 1186
 1187    /// <summary>
 1188    /// Returns whether this proxy uses collocation optimization.
 1189    /// </summary>
 1190    /// <returns><see langword="true"/> if the proxy uses collocation optimization;
 1191    /// <see langword="false"/>, otherwise.</returns>
 1192    public bool ice_isCollocationOptimized() => _reference.getCollocationOptimized();
 1193
 1194    /// <summary>
 1195    /// Creates a new proxy that is identical to this proxy, except for collocation optimization.
 1196    /// </summary>
 1197    /// <param name="collocated"><see langword="true"/> if the new proxy enables collocation optimization;
 1198    /// <see langword="false"/>, otherwise.</param>
 1199    /// <returns>The new proxy the specified collocation optimization.</returns>
 1200    public ObjectPrx ice_collocationOptimized(bool collocated)
 1201    {
 1202        if (collocated == _reference.getCollocationOptimized())
 1203        {
 1204            return this;
 1205        }
 1206        else
 1207        {
 1208            return iceNewInstance(_reference.changeCollocationOptimized(collocated));
 1209        }
 1210    }
 1211
 1212    /// <summary>
 1213    /// Creates a new proxy that is identical to this proxy, but uses twoway invocations.
 1214    /// </summary>
 1215    /// <returns>A new proxy that uses twoway invocations.</returns>
 1216    public ObjectPrx ice_twoway()
 1217    {
 1218        if (_reference.isTwoway)
 1219        {
 1220            return this;
 1221        }
 1222        else
 1223        {
 1224            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeTwoway));
 1225        }
 1226    }
 1227
 1228    /// <summary>
 1229    /// Returns whether this proxy uses twoway invocations.
 1230    /// </summary>
 1231    /// <returns><see langword="true"/> if this proxy uses twoway invocations;
 1232    /// <see langword="false"/> otherwise.</returns>
 1233    public bool ice_isTwoway() => _reference.isTwoway;
 1234
 1235    /// <summary>
 1236    /// Creates a new proxy that is identical to this proxy, but uses oneway invocations.
 1237    /// </summary>
 1238    /// <returns>A new proxy that uses oneway invocations.</returns>
 1239    public ObjectPrx ice_oneway()
 1240    {
 1241        if (_reference.getMode() == Reference.Mode.ModeOneway)
 1242        {
 1243            return this;
 1244        }
 1245        else
 1246        {
 1247            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeOneway));
 1248        }
 1249    }
 1250
 1251    /// <summary>
 1252    /// Returns whether this proxy uses oneway invocations.
 1253    /// </summary>
 1254    /// <returns><see langword="true"/> if this proxy uses oneway invocations;
 1255    /// <see langword="false"/> otherwise.</returns>
 1256    public bool ice_isOneway() => _reference.getMode() == Reference.Mode.ModeOneway;
 1257
 1258    /// <summary>
 1259    /// Creates a new proxy that is identical to this proxy, but uses batch oneway invocations.
 1260    /// </summary>
 1261    /// <returns>A new proxy that uses batch oneway invocations.</returns>
 1262    public ObjectPrx ice_batchOneway()
 1263    {
 1264        if (_reference.getMode() == Reference.Mode.ModeBatchOneway)
 1265        {
 1266            return this;
 1267        }
 1268        else
 1269        {
 1270            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeBatchOneway));
 1271        }
 1272    }
 1273
 1274    /// <summary>
 1275    /// Returns whether this proxy uses batch oneway invocations.
 1276    /// </summary>
 1277    /// <returns><see langword="true"/> if this proxy uses batch oneway invocations;
 1278    /// <see langword="false"/> otherwise.</returns>
 1279    public bool ice_isBatchOneway() => _reference.getMode() == Reference.Mode.ModeBatchOneway;
 1280
 1281    /// <summary>
 1282    /// Creates a new proxy that is identical to this proxy, but uses datagram invocations.
 1283    /// </summary>
 1284    /// <returns>A new proxy that uses datagram invocations.</returns>
 1285    public ObjectPrx ice_datagram()
 1286    {
 1287        if (_reference.getMode() == Reference.Mode.ModeDatagram)
 1288        {
 1289            return this;
 1290        }
 1291        else
 1292        {
 1293            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeDatagram));
 1294        }
 1295    }
 1296
 1297    /// <summary>
 1298    /// Returns whether this proxy uses datagram invocations.
 1299    /// </summary>
 1300    /// <returns><see langword="true"/> if this proxy uses datagram invocations;
 1301    /// <see langword="false"/> otherwise.</returns>
 1302    public bool ice_isDatagram() => _reference.getMode() == Reference.Mode.ModeDatagram;
 1303
 1304    /// <summary>
 1305    /// Creates a new proxy that is identical to this proxy, but uses batch datagram invocations.
 1306    /// </summary>
 1307    /// <returns>A new proxy that uses batch datagram invocations.</returns>
 1308    public ObjectPrx ice_batchDatagram()
 1309    {
 1310        if (_reference.getMode() == Reference.Mode.ModeBatchDatagram)
 1311        {
 1312            return this;
 1313        }
 1314        else
 1315        {
 1316            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeBatchDatagram));
 1317        }
 1318    }
 1319
 1320    /// <summary>
 1321    /// Returns whether this proxy uses batch datagram invocations.
 1322    /// </summary>
 1323    /// <returns><see langword="true"/> if this proxy uses batch datagram invocations;
 1324    /// <see langword="false"/>, otherwise.</returns>
 1325    public bool ice_isBatchDatagram() => _reference.getMode() == Reference.Mode.ModeBatchDatagram;
 1326
 1327    /// <summary>
 1328    /// Creates a new proxy that is identical to this proxy, except for compression.
 1329    /// </summary>
 1330    /// <param name="compress"><see langword="true"/> enables compression for the new proxy;
 1331    /// <see langword="false"/> disables compression.</param>
 1332    /// <returns>A new proxy with the specified compression setting.</returns>
 1333    public ObjectPrx ice_compress(bool compress)
 1334    {
 1335        if (compress == _reference.getCompress())
 1336        {
 1337            return this;
 1338        }
 1339        else
 1340        {
 1341            return iceNewInstance(_reference.changeCompress(compress));
 1342        }
 1343    }
 1344
 1345    /// <summary>
 1346    /// Obtains the compression override setting of this proxy.
 1347    /// </summary>
 1348    /// <returns>The compression override setting. If no optional value is present, no override is
 1349    /// set. Otherwise, <see langword="true"/> if compression is enabled, <see langword="false"/> otherwise.</returns>
 1350    public bool? ice_getCompress() => _reference.getCompress();
 1351
 1352    /// <summary>
 1353    /// Creates a new proxy that is identical to this proxy, except for its connection ID.
 1354    /// </summary>
 1355    /// <param name="connectionId">The connection ID for the new proxy. An empty string removes the
 1356    /// connection ID.</param>
 1357    /// <returns>A new proxy with the specified connection ID.</returns>
 1358    public ObjectPrx ice_connectionId(string connectionId)
 1359    {
 1360        if (connectionId == _reference.getConnectionId())
 1361        {
 1362            return this;
 1363        }
 1364        else
 1365        {
 1366            return iceNewInstance(_reference.changeConnectionId(connectionId));
 1367        }
 1368    }
 1369
 1370    /// <summary>
 1371    /// Gets the connection id of this proxy.
 1372    /// </summary>
 1373    /// <returns>The connection id.</returns>
 1374    public string ice_getConnectionId() => _reference.getConnectionId();
 1375
 1376    /// <summary>
 1377    /// Returns a proxy that is identical to this proxy, except it's a fixed proxy bound
 1378    /// the given connection.
 1379    /// </summary>
 1380    /// <param name="connection">The fixed proxy connection.</param>
 1381    /// <returns>A fixed proxy bound to the given connection.</returns>
 1382    public ObjectPrx ice_fixed(Ice.Connection connection)
 1383    {
 1384        if (connection is null)
 1385        {
 1386            throw new ArgumentException("invalid null connection passed to ice_fixed");
 1387        }
 1388        if (!(connection is Ice.ConnectionI))
 1389        {
 1390            throw new ArgumentException("invalid connection passed to ice_fixed");
 1391        }
 1392
 1393        if (connection == _reference.getConnection())
 1394        {
 1395            return this;
 1396        }
 1397        else
 1398        {
 1399            return iceNewInstance(_reference.changeConnection((Ice.ConnectionI)connection));
 1400        }
 1401    }
 1402
 1403    /// <summary>
 1404    /// Returns whether this proxy is a fixed proxy.
 1405    /// </summary>
 1406    /// <returns><see langword="true"/> if this is a fixed proxy; <see langword="false"/> otherwise.</returns>
 1407    public bool ice_isFixed() => _reference is Ice.Internal.FixedReference;
 1408
 1409    public class GetConnectionTaskCompletionCallback : TaskCompletionCallback<Connection?>
 1410    {
 1411        public GetConnectionTaskCompletionCallback(
 1412            IProgress<bool>? progress = null,
 1413            CancellationToken cancellationToken = default)
 11414            : base(progress, cancellationToken)
 1415        {
 11416        }
 1417
 1418        public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) =>
 11419            SetResult(((ProxyGetConnection)og).getConnection());
 1420    }
 1421
 1422    public Connection? ice_getConnection()
 1423    {
 1424        try
 1425        {
 1426            var completed = new GetConnectionTaskCompletionCallback();
 1427            iceI_ice_getConnection(completed, true);
 1428            return completed.Task.Result;
 1429        }
 1430        catch (AggregateException ex)
 1431        {
 1432            throw ex.InnerException!;
 1433        }
 1434    }
 1435
 1436    public Task<Connection?> ice_getConnectionAsync(IProgress<bool>? progress, CancellationToken cancel)
 1437    {
 1438        var completed = new GetConnectionTaskCompletionCallback(progress, cancel);
 1439        iceI_ice_getConnection(completed, false);
 1440        return completed.Task;
 1441    }
 1442
 1443    private const string _ice_getConnection_name = "ice_getConnection";
 1444
 1445    private void iceI_ice_getConnection(OutgoingAsyncCompletionCallback completed, bool synchronous)
 1446    {
 1447        var outgoing = new ProxyGetConnection(this, completed);
 1448        outgoing.invoke(_ice_getConnection_name, synchronous);
 1449    }
 1450
 1451    /// <summary>
 1452    /// Gets the cached Connection for this proxy. If the proxy does not yet have an established
 1453    /// connection, it does not attempt to create a connection.
 1454    /// </summary>
 1455    /// <returns>The cached Connection for this proxy (null if the proxy does not have
 1456    /// an established connection).</returns>
 1457    public Connection? ice_getCachedConnection() => _requestHandlerCache.cachedConnection;
 1458
 1459    /// <summary>
 1460    /// Flushes any pending batched requests for this communicator. The call blocks until the flush is complete.
 1461    /// </summary>
 1462    public void ice_flushBatchRequests()
 1463    {
 1464        try
 1465        {
 1466            var completed = new FlushBatchTaskCompletionCallback();
 1467            iceI_ice_flushBatchRequests(completed, true);
 1468            completed.Task.Wait();
 1469        }
 1470        catch (AggregateException ex)
 1471        {
 1472            throw ex.InnerException!;
 1473        }
 1474    }
 1475
 1476    internal const string _ice_flushBatchRequests_name = "ice_flushBatchRequests";
 1477
 1478    public Task ice_flushBatchRequestsAsync(
 1479        IProgress<bool>? progress = null,
 1480        CancellationToken cancel = default)
 1481    {
 1482        var completed = new FlushBatchTaskCompletionCallback(progress, cancel);
 1483        iceI_ice_flushBatchRequests(completed, false);
 1484        return completed.Task;
 1485    }
 1486
 1487    private void iceI_ice_flushBatchRequests(OutgoingAsyncCompletionCallback completed, bool synchronous)
 1488    {
 1489        var outgoing = new ProxyFlushBatchAsync(this, completed);
 1490        outgoing.invoke(_ice_flushBatchRequests_name, synchronous);
 1491    }
 1492
 1493    public System.Threading.Tasks.TaskScheduler ice_scheduler() => _reference.getThreadPool();
 1494
 1495    [EditorBrowsable(EditorBrowsableState.Never)]
 1496    public void iceWrite(OutputStream os)
 1497    {
 1498        Identity.ice_write(os, _reference.getIdentity());
 1499        _reference.streamWrite(os);
 1500    }
 1501
 1502    internal Reference iceReference() => _reference;
 1503
 1504    [EditorBrowsable(EditorBrowsableState.Never)]
 1505    public void iceCheckTwowayOnly(string name)
 1506    {
 1507        //
 1508        // No mutex lock necessary, there is nothing mutable in this
 1509        // operation.
 1510        //
 1511
 1512        if (!ice_isTwoway())
 1513        {
 1514            throw new TwowayOnlyException(name);
 1515        }
 1516    }
 1517
 1518    [EditorBrowsable(EditorBrowsableState.Never)]
 1519    public void iceCheckAsyncTwowayOnly(string name)
 1520    {
 1521        //
 1522        // No mutex lock necessary, there is nothing mutable in this
 1523        // operation.
 1524        //
 1525
 1526        if (!ice_isTwoway())
 1527        {
 1528            throw new ArgumentException("`" + name + "' can only be called with a twoway proxy");
 1529        }
 1530    }
 1531
 1532    internal RequestHandlerCache iceGetRequestHandlerCache() => _requestHandlerCache;
 1533
 1534    protected ObjectPrxHelperBase(ObjectPrx proxy)
 1535    {
 1536        // We don't supported decorated proxies here.
 1537        var helper = (ObjectPrxHelperBase)proxy;
 1538
 1539        _reference = helper._reference;
 1540        _requestHandlerCache = helper._requestHandlerCache;
 1541    }
 1542
 1543    protected OutgoingAsyncT<T>
 1544    getOutgoingAsync<T>(OutgoingAsyncCompletionCallback completed)
 1545    {
 1546        bool haveEntry = false;
 1547        InputStream? iss = null;
 1548        OutputStream? os = null;
 1549
 1550        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1551        {
 1552            lock (_mutex)
 1553            {
 1554                if (_streamCache != null && _streamCache.Count > 0)
 1555                {
 1556                    haveEntry = true;
 1557                    iss = _streamCache.First!.Value.iss;
 1558                    os = _streamCache.First.Value.os;
 1559
 1560                    _streamCache.RemoveFirst();
 1561                }
 1562            }
 1563        }
 1564        if (!haveEntry)
 1565        {
 1566            return new OutgoingAsyncT<T>(this, completed);
 1567        }
 1568        else
 1569        {
 1570            return new OutgoingAsyncT<T>(this, completed, os, iss);
 1571        }
 1572    }
 1573
 1574    private class InvokeOutgoingAsyncT : OutgoingAsync
 1575    {
 1576        public InvokeOutgoingAsyncT(
 1577            ObjectPrxHelperBase prx,
 1578            OutgoingAsyncCompletionCallback completionCallback,
 1579            OutputStream? os = null,
 1580            InputStream? iss = null)
 1581            : base(prx, completionCallback, os, iss)
 1582        {
 1583        }
 1584
 1585        public void invoke(
 1586            string operation,
 1587            OperationMode mode,
 1588            byte[] inParams,
 1589            Dictionary<string, string>? context,
 1590            bool synchronous)
 1591        {
 1592            try
 1593            {
 1594                prepare(operation, mode, context);
 1595                if (inParams is null || inParams.Length == 0)
 1596                {
 1597                    os_.writeEmptyEncapsulation(encoding_);
 1598                }
 1599                else
 1600                {
 1601                    os_.writeEncapsulation(inParams);
 1602                }
 1603                invoke(operation, synchronous);
 1604            }
 1605            catch (Exception ex)
 1606            {
 1607                abort(ex);
 1608            }
 1609        }
 1610
 1611        public Object_Ice_invokeResult
 1612        getResult(bool ok)
 1613        {
 1614            try
 1615            {
 1616                var ret = new Object_Ice_invokeResult();
 1617                if (proxy_.iceReference().isTwoway)
 1618                {
 1619                    ret.outEncaps = is_.readEncapsulation(out _);
 1620                }
 1621                else
 1622                {
 1623                    ret.outEncaps = [];
 1624                }
 1625                ret.returnValue = ok;
 1626                return ret;
 1627            }
 1628            finally
 1629            {
 1630                cacheMessageBuffers();
 1631            }
 1632        }
 1633    }
 1634
 1635    private class InvokeTaskCompletionCallback : TaskCompletionCallback<Object_Ice_invokeResult>
 1636    {
 1637        public InvokeTaskCompletionCallback(IProgress<bool>? progress, CancellationToken cancellationToken)
 1638            : base(progress, cancellationToken)
 1639        {
 1640        }
 1641
 1642        public override void handleInvokeSent(
 1643            bool sentSynchronously,
 1644            bool done,
 1645            bool alreadySent,
 1646            OutgoingAsyncBase og)
 1647        {
 1648            if (progress_ != null && !alreadySent)
 1649            {
 1650                progress_.Report(sentSynchronously);
 1651            }
 1652            if (done)
 1653            {
 1654                SetResult(new Object_Ice_invokeResult(true, []));
 1655            }
 1656        }
 1657
 1658        public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) =>
 1659            SetResult(((InvokeOutgoingAsyncT)og).getResult(ok));
 1660    }
 1661
 1662    private InvokeOutgoingAsyncT
 1663    getInvokeOutgoingAsync(OutgoingAsyncCompletionCallback completed)
 1664    {
 1665        bool haveEntry = false;
 1666        InputStream? iss = null;
 1667        OutputStream? os = null;
 1668
 1669        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1670        {
 1671            lock (_mutex)
 1672            {
 1673                if (_streamCache != null && _streamCache.Count > 0)
 1674                {
 1675                    haveEntry = true;
 1676                    iss = _streamCache.First!.Value.iss;
 1677                    os = _streamCache.First.Value.os;
 1678
 1679                    _streamCache.RemoveFirst();
 1680                }
 1681            }
 1682        }
 1683        if (!haveEntry)
 1684        {
 1685            return new InvokeOutgoingAsyncT(this, completed);
 1686        }
 1687        else
 1688        {
 1689            return new InvokeOutgoingAsyncT(this, completed, os, iss);
 1690        }
 1691    }
 1692
 1693    internal void cacheMessageBuffers(InputStream iss, OutputStream os)
 1694    {
 1695        lock (_mutex)
 1696        {
 1697            _streamCache ??= new LinkedList<(InputStream, OutputStream)>();
 1698            _streamCache.AddLast((iss, os));
 1699        }
 1700    }
 1701
 1702    /// <summary>
 1703    /// Initializes a new instance of the <see cref="ObjectPrxHelperBase" /> class.
 1704    /// </summary>
 1705    /// <param name="reference">The reference for the new proxy.</param>
 1706    [EditorBrowsable(EditorBrowsableState.Never)]
 1707    protected ObjectPrxHelperBase(Reference reference)
 1708    {
 1709        _reference = reference;
 1710        _requestHandlerCache = new RequestHandlerCache(reference);
 1711    }
 1712
 1713    /// <summary>
 1714    /// Constructs a new proxy instance.
 1715    /// </summary>
 1716    /// <param name="reference">The reference for the new proxy.</param>
 1717    /// <returns>The new proxy instance.</returns>
 1718    [EditorBrowsable(EditorBrowsableState.Never)]
 1719    protected abstract ObjectPrxHelperBase iceNewInstance(Reference reference);
 1720
 1721    private readonly Reference _reference;
 1722    private readonly RequestHandlerCache _requestHandlerCache;
 1723    private LinkedList<(InputStream iss, OutputStream os)>? _streamCache;
 1724    private readonly object _mutex = new();
 1725}
 1726
 1727/// <summary>
 1728/// Base class for all proxy helpers.
 1729/// </summary>
 1730public class ObjectPrxHelper : ObjectPrxHelperBase
 1731{
 1732    /// <summary>
 1733    /// Creates a new proxy that implements <see cref="ObjectPrx" />.
 1734    /// </summary>
 1735    /// <param name="communicator">The communicator of the new proxy.</param>
 1736    /// <param name="proxyString">The string representation of the proxy.</param>
 1737    /// <returns>The new proxy.</returns>
 1738    /// <exception name="ParseException">Thrown when <paramref name="proxyString" /> is not a valid proxy string.
 1739    /// </exception>
 1740    public static ObjectPrx createProxy(Communicator communicator, string proxyString)
 1741    {
 1742        Reference? reference = communicator.instance.referenceFactory().create(proxyString, "");
 1743
 1744        return reference is not null ?
 1745            new ObjectPrxHelper(reference) :
 1746            throw new ParseException("Invalid empty proxy string.");
 1747    }
 1748
 1749    /// <summary>
 1750    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1751    /// </summary>
 1752    /// <param name="proxy">The source proxy.</param>
 1753    /// <param name="context">The request context.</param>
 1754    /// <returns>A new proxy with the requested type, or null if the target object does not support the requested type.
 1755    /// </returns>
 1756    public static ObjectPrx? checkedCast(ObjectPrx? proxy, Dictionary<string, string>? context = null) =>
 1757        proxy is not null && proxy.ice_isA("::Ice::Object", context) ? proxy : null;
 1758
 1759    /// <summary>
 1760    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1761    /// </summary>
 1762    /// <param name="proxy">The source proxy (can be null).</param>
 1763    /// <param name="facet">A facet name.</param>
 1764    /// <param name="context">The request context.</param>
 1765    /// <returns>A new proxy with the requested type and facet, or null if the target facet does not support the
 1766    /// requested type.</returns>
 1767    public static ObjectPrx? checkedCast(ObjectPrx? proxy, string facet, Dictionary<string, string>? context = null) =>
 1768        checkedCast(proxy?.ice_facet(facet), context);
 1769
 1770    /// <summary>
 1771    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1772    /// </summary>
 1773    /// <param name="proxy">The source proxy.</param>
 1774    /// <param name="context">The request context.</param>
 1775    /// <param name="progress">Sent progress provider.</param>
 1776    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 1777    /// <returns>A new proxy with the requested type, or null if the target object does not support the requested type.
 1778    /// </returns>
 1779    public static async Task<ObjectPrx?> checkedCastAsync(
 1780        ObjectPrx proxy,
 1781        Dictionary<string, string>? context = null,
 1782        IProgress<bool>? progress = null,
 1783        CancellationToken cancel = default) =>
 1784       await proxy.ice_isAAsync("::Ice::Object", context, progress, cancel).ConfigureAwait(false) ? proxy : null;
 1785
 1786    /// <summary>
 1787    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1788    /// </summary>
 1789    /// <param name="proxy">The source proxy.</param>
 1790    /// <param name="facet">A facet name.</param>
 1791    /// <param name="context">The request context.</param>
 1792    /// <param name="progress">Sent progress provider.</param>
 1793    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 1794    /// <returns>A new proxy with the requested type and facet, or null if the target facet does not support the
 1795    /// requested type.</returns>
 1796    public static Task<ObjectPrx?> checkedCastAsync(
 1797        ObjectPrx proxy,
 1798        string facet,
 1799        Dictionary<string, string>? context = null,
 1800        IProgress<bool>? progress = null,
 1801        CancellationToken cancel = default) =>
 1802        checkedCastAsync(proxy.ice_facet(facet), context, progress, cancel);
 1803
 1804    /// <summary>
 1805    /// Creates a new proxy from an existing proxy.
 1806    /// </summary>
 1807    /// <param name="proxy">The source proxy.</param>
 1808    /// <returns>A new proxy with the requested type.</returns>
 1809    /// <remarks>This is a purely local operation.</remarks>
 1810    [return: NotNullIfNotNull(nameof(proxy))]
 1811    public static ObjectPrx? uncheckedCast(ObjectPrx? proxy) => proxy;
 1812
 1813    /// <summary>
 1814    /// Creates a new proxy from an existing proxy.
 1815    /// </summary>
 1816    /// <param name="proxy">The source proxy.</param>
 1817    /// <param name="facet">A facet name.</param>
 1818    /// <returns>A new proxy with the requested type and facet, or null if the source proxy is null.</returns>
 1819    /// <remarks>This is a purely local operation.</remarks>
 1820    [return: NotNullIfNotNull(nameof(proxy))]
 1821    public static ObjectPrx? uncheckedCast(ObjectPrx? proxy, string facet) => proxy?.ice_facet(facet);
 1822
 1823    /// <summary>
 1824    /// Gets the Slice type id of the interface or class associated with this proxy class.
 1825    /// </summary>
 1826    /// <returns>The type id, "::Ice::Object".</returns>
 1827    public static string ice_staticId() => Object.ice_staticId();
 1828
 1829    protected override ObjectPrxHelperBase iceNewInstance(Reference reference) => new ObjectPrxHelper(reference);
 1830
 1831    internal ObjectPrxHelper(Reference reference)
 1832        : base(reference)
 1833    {
 1834    }
 1835}