< Summary

Information
Class: Ice.ObjectPrxHelperBase
Assembly: Ice
File(s): /_/csharp/src/Ice/Proxy.cs
Tag: 99_23991109993
Line coverage
93%
Covered lines: 286
Uncovered lines: 21
Coverable lines: 307
Total lines: 1835
Line coverage: 93.1%
Branch coverage
82%
Covered branches: 87
Total branches: 106
Branch coverage: 82%
Method coverage
97%
Covered methods: 95
Total methods: 97
Method coverage: 97.9%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
op_Equality(...)0%620%
op_Inequality(...)100%210%
Equals(...)100%22100%
Equals(...)100%11100%
GetHashCode()100%11100%
ice_getCommunicator()100%11100%
ToString()100%11100%
ice_isA(...)100%11100%
ice_isAAsync(...)100%11100%
iceI_ice_isAAsync(...)100%11100%
iceI_ice_isA(...)100%22100%
ice_ping(...)100%11100%
ice_pingAsync(...)100%11100%
iceI_ice_pingAsync(...)100%11100%
iceI_ice_ping(...)100%11100%
ice_ids(...)100%11100%
ice_idsAsync(...)100%11100%
iceI_ice_idsAsync(...)100%11100%
iceI_ice_ids(...)100%22100%
ice_id(...)100%1.13150%
ice_idAsync(...)100%11100%
iceI_ice_idAsync(...)100%11100%
iceI_ice_id(...)100%22100%
ice_invoke(...)100%11100%
ice_invokeAsync(...)100%11100%
iceI_ice_invokeAsync(...)100%11100%
iceI_ice_invoke(...)100%11100%
ice_getIdentity()100%11100%
ice_identity(...)75%4.13480%
ice_getContext()100%11100%
ice_context(...)100%11100%
ice_getFacet()100%11100%
ice_facet(...)50%4.25475%
ice_getAdapterId()100%11100%
ice_adapterId(...)50%4.25475%
ice_getEndpoints()100%11100%
ice_endpoints(...)83.33%66100%
ice_getLocatorCacheTimeout()100%11100%
ice_locatorCacheTimeout(...)100%11100%
ice_locatorCacheTimeout(...)100%22100%
ice_getInvocationTimeout()100%11100%
ice_invocationTimeout(...)100%11100%
ice_invocationTimeout(...)100%22100%
ice_isConnectionCached()100%11100%
ice_connectionCached(...)100%22100%
ice_getEndpointSelection()100%11100%
ice_endpointSelection(...)100%22100%
ice_encodingVersion(...)100%22100%
ice_getEncodingVersion()100%11100%
ice_getRouter()100%22100%
ice_router(...)100%44100%
ice_getLocator()100%22100%
ice_locator(...)100%44100%
ice_isCollocationOptimized()100%11100%
ice_collocationOptimized(...)100%22100%
ice_twoway()100%22100%
ice_isTwoway()100%11100%
ice_oneway()50%2.15266.67%
ice_isOneway()100%11100%
ice_batchOneway()50%2.15266.67%
ice_isBatchOneway()100%11100%
ice_datagram()50%2.15266.67%
ice_isDatagram()100%11100%
ice_batchDatagram()50%2.15266.67%
ice_isBatchDatagram()100%11100%
ice_compress(...)50%2.15266.67%
ice_getCompress()100%11100%
ice_connectionId(...)50%2.15266.67%
ice_getConnectionId()100%11100%
ice_fixed(...)83.33%6.11685.71%
ice_isFixed()100%11100%
.ctor(...)100%11100%
handleInvokeResponse(...)100%11100%
ice_getConnection()100%11100%
ice_getConnectionAsync(...)100%11100%
iceI_ice_getConnection(...)100%11100%
ice_getCachedConnection()100%11100%
ice_flushBatchRequests()100%1.02171.43%
ice_flushBatchRequestsAsync(...)100%11100%
iceI_ice_flushBatchRequests(...)100%11100%
ice_scheduler()100%11100%
iceWrite(...)100%11100%
iceReference()100%11100%
iceCheckTwowayOnly(...)100%22100%
iceCheckAsyncTwowayOnly(...)50%2.15266.67%
iceGetRequestHandlerCache()100%11100%
.ctor(...)100%11100%
getOutgoingAsync<T>(...)100%88100%
.ctor(...)100%11100%
invoke(...)100%4.43470%
getResult(...)100%22100%
.ctor(...)100%11100%
handleInvokeSent(...)50%6.29680%
handleInvokeResponse(...)100%11100%
getInvokeOutgoingAsync(...)100%88100%
cacheMessageBuffers(...)100%22100%
.ctor(...)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) =>
 0519        lhs is not null ? lhs.Equals(rhs) : rhs is null;
 520
 0521    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) =>
 1531        other is not null && _reference == ((ObjectPrxHelperBase)other)._reference;
 532
 1533    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>
 1539    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>
 1545    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>
 1551    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        {
 1564            return iceI_ice_isAAsync(id, context, synchronous: true, progress: null, CancellationToken.None).Result;
 565        }
 1566        catch (AggregateException ex)
 567        {
 1568            throw ex.InnerException!;
 569        }
 1570    }
 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,
 1584        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    {
 1594        iceCheckTwowayOnly(_ice_isA_name);
 1595        var completed = new OperationTaskCompletionCallback<bool>(progress, cancel);
 1596        iceI_ice_isA(id, context, completed, synchronous);
 1597        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    {
 1608        iceCheckAsyncTwowayOnly(_ice_isA_name);
 1609        getOutgoingAsync<bool>(completed).invoke(
 1610            _ice_isA_name,
 1611            OperationMode.Idempotent,
 1612            FormatType.CompactFormat,
 1613            context,
 1614            synchronous,
 1615            (OutputStream os) => os.writeString(id),
 1616            null,
 1617            (InputStream iss) => iss.readBool());
 1618    }
 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        {
 1628            iceI_ice_pingAsync(context, synchronous: true, progress: null, CancellationToken.None).Wait();
 1629        }
 1630        catch (AggregateException ex)
 631        {
 1632            throw ex.InnerException!;
 633        }
 1634    }
 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,
 1646        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    {
 1655        var completed = new OperationTaskCompletionCallback<object>(progress, cancel);
 1656        iceI_ice_ping(context, completed, synchronous);
 1657        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    {
 1667        getOutgoingAsync<object>(completed).invoke(
 1668            _ice_ping_name,
 1669            OperationMode.Idempotent,
 1670            FormatType.CompactFormat,
 1671            context,
 1672            synchronous);
 1673    }
 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        {
 1684            return iceI_ice_idsAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 685        }
 1686        catch (AggregateException ex)
 687        {
 1688            throw ex.InnerException!;
 689        }
 1690    }
 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,
 1703        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    {
 1711        iceCheckTwowayOnly(_ice_ids_name);
 1712        var completed = new OperationTaskCompletionCallback<string[]>(progress, cancel);
 1713        iceI_ice_ids(context, completed, synchronous);
 1714        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    {
 1724        iceCheckAsyncTwowayOnly(_ice_ids_name);
 1725        getOutgoingAsync<string[]>(completed).invoke(
 1726            _ice_ids_name,
 1727            OperationMode.Idempotent,
 1728            FormatType.CompactFormat,
 1729            context,
 1730            synchronous,
 1731            read: (InputStream iss) => iss.readStringSeq());
 1732    }
 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        {
 1743            return iceI_ice_idAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 744        }
 0745        catch (AggregateException ex)
 746        {
 0747            throw ex.InnerException!;
 748        }
 1749    }
 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,
 1761        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    {
 1770        iceCheckTwowayOnly(_ice_id_name);
 1771        var completed = new OperationTaskCompletionCallback<string>(progress, cancel);
 1772        iceI_ice_id(context, completed, synchronous);
 1773        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    {
 1783        getOutgoingAsync<string>(completed).invoke(
 1784            _ice_id_name,
 1785            OperationMode.Idempotent,
 1786            FormatType.CompactFormat,
 1787            context,
 1788            synchronous,
 1789            read: (InputStream iss) => iss.readString());
 1790    }
 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        {
 1814            Object_Ice_invokeResult result = iceI_ice_invokeAsync(
 1815                operation,
 1816                mode,
 1817                inEncaps,
 1818                context,
 1819                synchronous: true,
 1820                progress: null,
 1821                CancellationToken.None).Result;
 1822            outEncaps = result.outEncaps;
 1823            return result.returnValue;
 824        }
 1825        catch (AggregateException ex)
 826        {
 1827            throw ex.InnerException!;
 828        }
 1829    }
 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) =>
 1849            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    {
 1861        var completed = new InvokeTaskCompletionCallback(progress, cancel);
 1862        iceI_ice_invoke(operation, mode, inEncaps, context, completed, synchronous);
 1863        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,
 1872        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>
 1878    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    {
 1888        if (newIdentity.name.Length == 0)
 889        {
 0890            throw new ArgumentException("The name of an Ice object identity cannot be empty.", nameof(newIdentity));
 891        }
 1892        if (newIdentity == _reference.getIdentity())
 893        {
 1894            return this;
 895        }
 896        else
 897        {
 1898            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>
 1907    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) =>
 1915        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>
 1922    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    {
 1931        newFacet ??= "";
 932
 1933        if (newFacet == _reference.getFacet())
 934        {
 0935            return this;
 936        }
 937        else
 938        {
 1939            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>
 1948    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    {
 1957        newAdapterId ??= "";
 958
 1959        if (newAdapterId == _reference.getAdapterId())
 960        {
 0961            return this;
 962        }
 963        else
 964        {
 1965            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>
 1973    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    {
 1982        newEndpoints ??= [];
 983
 1984        if (_reference.getEndpoints().SequenceEqual(newEndpoints))
 985        {
 1986            return this;
 987        }
 988        else
 989        {
 1990            var endpoints = new EndpointI[newEndpoints.Length];
 1991            for (int i = 0; i < newEndpoints.Length; ++i)
 992            {
 1993                endpoints[i] = (EndpointI)newEndpoints[i];
 994            }
 1995            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>
 11003    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) =>
 11011        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    {
 11020        if (newTimeout == _reference.getLocatorCacheTimeout())
 1021        {
 11022            return this;
 1023        }
 1024        else
 1025        {
 11026            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>
 11034    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) =>
 11042        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    {
 11051        if (newTimeout == _reference.getInvocationTimeout())
 1052        {
 11053            return this;
 1054        }
 1055        else
 1056        {
 11057            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>
 11065    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    {
 11075        if (newCache == _reference.getCacheConnection())
 1076        {
 11077            return this;
 1078        }
 1079        else
 1080        {
 11081            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>
 11089    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    {
 11098        if (newType == _reference.getEndpointSelection())
 1099        {
 11100            return this;
 1101        }
 1102        else
 1103        {
 11104            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    {
 11116        if (encodingVersion == _reference.getEncoding())
 1117        {
 11118            return this;
 1119        }
 1120        else
 1121        {
 11122            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>
 11130    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    {
 11139        RouterInfo ri = _reference.getRouterInfo();
 11140        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    {
 11150        if (router == _reference.getRouterInfo()?.getRouter())
 1151        {
 11152            return this;
 1153        }
 1154        else
 1155        {
 11156            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    {
 11166        LocatorInfo li = _reference.getLocatorInfo();
 11167        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    {
 11177        if (locator == _reference.getLocatorInfo()?.getLocator())
 1178        {
 11179            return this;
 1180        }
 1181        else
 1182        {
 11183            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>
 11192    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    {
 11202        if (collocated == _reference.getCollocationOptimized())
 1203        {
 11204            return this;
 1205        }
 1206        else
 1207        {
 11208            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    {
 11218        if (_reference.isTwoway)
 1219        {
 11220            return this;
 1221        }
 1222        else
 1223        {
 11224            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>
 11233    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    {
 11241        if (_reference.getMode() == Reference.Mode.ModeOneway)
 1242        {
 01243            return this;
 1244        }
 1245        else
 1246        {
 11247            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>
 11256    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    {
 11264        if (_reference.getMode() == Reference.Mode.ModeBatchOneway)
 1265        {
 01266            return this;
 1267        }
 1268        else
 1269        {
 11270            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>
 11279    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    {
 11287        if (_reference.getMode() == Reference.Mode.ModeDatagram)
 1288        {
 01289            return this;
 1290        }
 1291        else
 1292        {
 11293            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>
 11302    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    {
 11310        if (_reference.getMode() == Reference.Mode.ModeBatchDatagram)
 1311        {
 01312            return this;
 1313        }
 1314        else
 1315        {
 11316            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>
 11325    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    {
 11335        if (compress == _reference.getCompress())
 1336        {
 01337            return this;
 1338        }
 1339        else
 1340        {
 11341            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>
 11350    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    {
 11360        if (connectionId == _reference.getConnectionId())
 1361        {
 01362            return this;
 1363        }
 1364        else
 1365        {
 11366            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>
 11374    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    {
 11384        if (connection is null)
 1385        {
 11386            throw new ArgumentException("invalid null connection passed to ice_fixed");
 1387        }
 11388        if (!(connection is Ice.ConnectionI))
 1389        {
 01390            throw new ArgumentException("invalid connection passed to ice_fixed");
 1391        }
 1392
 11393        if (connection == _reference.getConnection())
 1394        {
 11395            return this;
 1396        }
 1397        else
 1398        {
 11399            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>
 11407    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        {
 11426            var completed = new GetConnectionTaskCompletionCallback();
 11427            iceI_ice_getConnection(completed, true);
 11428            return completed.Task.Result;
 1429        }
 11430        catch (AggregateException ex)
 1431        {
 11432            throw ex.InnerException!;
 1433        }
 11434    }
 1435
 1436    public Task<Connection?> ice_getConnectionAsync(IProgress<bool>? progress, CancellationToken cancel)
 1437    {
 11438        var completed = new GetConnectionTaskCompletionCallback(progress, cancel);
 11439        iceI_ice_getConnection(completed, false);
 11440        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    {
 11447        var outgoing = new ProxyGetConnection(this, completed);
 11448        outgoing.invoke(_ice_getConnection_name, synchronous);
 11449    }
 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>
 11457    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        {
 11466            var completed = new FlushBatchTaskCompletionCallback();
 11467            iceI_ice_flushBatchRequests(completed, true);
 11468            completed.Task.Wait();
 11469        }
 01470        catch (AggregateException ex)
 1471        {
 01472            throw ex.InnerException!;
 1473        }
 11474    }
 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    {
 11482        var completed = new FlushBatchTaskCompletionCallback(progress, cancel);
 11483        iceI_ice_flushBatchRequests(completed, false);
 11484        return completed.Task;
 1485    }
 1486
 1487    private void iceI_ice_flushBatchRequests(OutgoingAsyncCompletionCallback completed, bool synchronous)
 1488    {
 11489        var outgoing = new ProxyFlushBatchAsync(this, completed);
 11490        outgoing.invoke(_ice_flushBatchRequests_name, synchronous);
 11491    }
 1492
 11493    public System.Threading.Tasks.TaskScheduler ice_scheduler() => _reference.getThreadPool();
 1494
 1495    [EditorBrowsable(EditorBrowsableState.Never)]
 1496    public void iceWrite(OutputStream os)
 1497    {
 11498        Identity.ice_write(os, _reference.getIdentity());
 11499        _reference.streamWrite(os);
 11500    }
 1501
 11502    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
 11512        if (!ice_isTwoway())
 1513        {
 11514            throw new TwowayOnlyException(name);
 1515        }
 11516    }
 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
 11526        if (!ice_isTwoway())
 1527        {
 01528            throw new ArgumentException("`" + name + "' can only be called with a twoway proxy");
 1529        }
 11530    }
 1531
 11532    internal RequestHandlerCache iceGetRequestHandlerCache() => _requestHandlerCache;
 1533
 11534    protected ObjectPrxHelperBase(ObjectPrx proxy)
 1535    {
 1536        // We don't supported decorated proxies here.
 11537        var helper = (ObjectPrxHelperBase)proxy;
 1538
 11539        _reference = helper._reference;
 11540        _requestHandlerCache = helper._requestHandlerCache;
 11541    }
 1542
 1543    protected OutgoingAsyncT<T>
 1544    getOutgoingAsync<T>(OutgoingAsyncCompletionCallback completed)
 1545    {
 11546        bool haveEntry = false;
 11547        InputStream? iss = null;
 11548        OutputStream? os = null;
 1549
 11550        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1551        {
 11552            lock (_mutex)
 1553            {
 11554                if (_streamCache != null && _streamCache.Count > 0)
 1555                {
 11556                    haveEntry = true;
 11557                    iss = _streamCache.First!.Value.iss;
 11558                    os = _streamCache.First.Value.os;
 1559
 11560                    _streamCache.RemoveFirst();
 1561                }
 11562            }
 1563        }
 11564        if (!haveEntry)
 1565        {
 11566            return new OutgoingAsyncT<T>(this, completed);
 1567        }
 1568        else
 1569        {
 11570            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)
 11581            : base(prx, completionCallback, os, iss)
 1582        {
 11583        }
 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            {
 11594                prepare(operation, mode, context);
 11595                if (inParams is null || inParams.Length == 0)
 1596                {
 11597                    os_.writeEmptyEncapsulation(encoding_);
 1598                }
 1599                else
 1600                {
 11601                    os_.writeEncapsulation(inParams);
 1602                }
 11603                invoke(operation, synchronous);
 11604            }
 01605            catch (Exception ex)
 1606            {
 01607                abort(ex);
 01608            }
 11609        }
 1610
 1611        public Object_Ice_invokeResult
 1612        getResult(bool ok)
 1613        {
 1614            try
 1615            {
 11616                var ret = new Object_Ice_invokeResult();
 11617                if (proxy_.iceReference().isTwoway)
 1618                {
 11619                    ret.outEncaps = is_.readEncapsulation(out _);
 1620                }
 1621                else
 1622                {
 11623                    ret.outEncaps = [];
 1624                }
 11625                ret.returnValue = ok;
 11626                return ret;
 1627            }
 1628            finally
 1629            {
 11630                cacheMessageBuffers();
 11631            }
 11632        }
 1633    }
 1634
 1635    private class InvokeTaskCompletionCallback : TaskCompletionCallback<Object_Ice_invokeResult>
 1636    {
 1637        public InvokeTaskCompletionCallback(IProgress<bool>? progress, CancellationToken cancellationToken)
 11638            : base(progress, cancellationToken)
 1639        {
 11640        }
 1641
 1642        public override void handleInvokeSent(
 1643            bool sentSynchronously,
 1644            bool done,
 1645            bool alreadySent,
 1646            OutgoingAsyncBase og)
 1647        {
 11648            if (progress_ != null && !alreadySent)
 1649            {
 01650                progress_.Report(sentSynchronously);
 1651            }
 11652            if (done)
 1653            {
 11654                SetResult(new Object_Ice_invokeResult(true, []));
 1655            }
 11656        }
 1657
 1658        public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) =>
 11659            SetResult(((InvokeOutgoingAsyncT)og).getResult(ok));
 1660    }
 1661
 1662    private InvokeOutgoingAsyncT
 1663    getInvokeOutgoingAsync(OutgoingAsyncCompletionCallback completed)
 1664    {
 11665        bool haveEntry = false;
 11666        InputStream? iss = null;
 11667        OutputStream? os = null;
 1668
 11669        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1670        {
 11671            lock (_mutex)
 1672            {
 11673                if (_streamCache != null && _streamCache.Count > 0)
 1674                {
 11675                    haveEntry = true;
 11676                    iss = _streamCache.First!.Value.iss;
 11677                    os = _streamCache.First.Value.os;
 1678
 11679                    _streamCache.RemoveFirst();
 1680                }
 11681            }
 1682        }
 11683        if (!haveEntry)
 1684        {
 11685            return new InvokeOutgoingAsyncT(this, completed);
 1686        }
 1687        else
 1688        {
 11689            return new InvokeOutgoingAsyncT(this, completed, os, iss);
 1690        }
 1691    }
 1692
 1693    internal void cacheMessageBuffers(InputStream iss, OutputStream os)
 1694    {
 11695        lock (_mutex)
 1696        {
 11697            _streamCache ??= new LinkedList<(InputStream, OutputStream)>();
 11698            _streamCache.AddLast((iss, os));
 11699        }
 11700    }
 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)]
 11707    protected ObjectPrxHelperBase(Reference reference)
 1708    {
 11709        _reference = reference;
 11710        _requestHandlerCache = new RequestHandlerCache(reference);
 11711    }
 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;
 11724    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}

Methods/Properties

op_Equality(Ice.ObjectPrxHelperBase, Ice.ObjectPrxHelperBase)
op_Inequality(Ice.ObjectPrxHelperBase, Ice.ObjectPrxHelperBase)
Equals(Ice.ObjectPrx)
Equals(object)
GetHashCode()
ice_getCommunicator()
ToString()
ice_isA(string, System.Collections.Generic.Dictionary<string, string>)
ice_isAAsync(string, System.Collections.Generic.Dictionary<string, string>, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_isAAsync(string, System.Collections.Generic.Dictionary<string, string>, bool, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_isA(string, System.Collections.Generic.Dictionary<string, string>, Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_ping(System.Collections.Generic.Dictionary<string, string>)
ice_pingAsync(System.Collections.Generic.Dictionary<string, string>, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_pingAsync(System.Collections.Generic.Dictionary<string, string>, bool, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_ping(System.Collections.Generic.Dictionary<string, string>, Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_ids(System.Collections.Generic.Dictionary<string, string>)
ice_idsAsync(System.Collections.Generic.Dictionary<string, string>, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_idsAsync(System.Collections.Generic.Dictionary<string, string>, bool, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_ids(System.Collections.Generic.Dictionary<string, string>, Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_id(System.Collections.Generic.Dictionary<string, string>)
ice_idAsync(System.Collections.Generic.Dictionary<string, string>, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_idAsync(System.Collections.Generic.Dictionary<string, string>, bool, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_id(System.Collections.Generic.Dictionary<string, string>, Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_invoke(string, Ice.OperationMode, byte[], out byte[], System.Collections.Generic.Dictionary<string, string>)
ice_invokeAsync(string, Ice.OperationMode, byte[], System.Collections.Generic.Dictionary<string, string>, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_invokeAsync(string, Ice.OperationMode, byte[], System.Collections.Generic.Dictionary<string, string>, bool, System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_invoke(string, Ice.OperationMode, byte[], System.Collections.Generic.Dictionary<string, string>, Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_getIdentity()
ice_identity(Ice.Identity)
ice_getContext()
ice_context(System.Collections.Generic.Dictionary<string, string>)
ice_getFacet()
ice_facet(string)
ice_getAdapterId()
ice_adapterId(string)
ice_getEndpoints()
ice_endpoints(Ice.Endpoint[])
ice_getLocatorCacheTimeout()
ice_locatorCacheTimeout(int)
ice_locatorCacheTimeout(System.TimeSpan)
ice_getInvocationTimeout()
ice_invocationTimeout(int)
ice_invocationTimeout(System.TimeSpan)
ice_isConnectionCached()
ice_connectionCached(bool)
ice_getEndpointSelection()
ice_endpointSelection(Ice.EndpointSelectionType)
ice_encodingVersion(Ice.EncodingVersion)
ice_getEncodingVersion()
ice_getRouter()
ice_router(Ice.RouterPrx)
ice_getLocator()
ice_locator(Ice.LocatorPrx)
ice_isCollocationOptimized()
ice_collocationOptimized(bool)
ice_twoway()
ice_isTwoway()
ice_oneway()
ice_isOneway()
ice_batchOneway()
ice_isBatchOneway()
ice_datagram()
ice_isDatagram()
ice_batchDatagram()
ice_isBatchDatagram()
ice_compress(bool)
ice_getCompress()
ice_connectionId(string)
ice_getConnectionId()
ice_fixed(Ice.Connection)
ice_isFixed()
.ctor(System.IProgress<bool>, System.Threading.CancellationToken)
handleInvokeResponse(bool, Ice.Internal.OutgoingAsyncBase)
ice_getConnection()
ice_getConnectionAsync(System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_getConnection(Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_getCachedConnection()
ice_flushBatchRequests()
ice_flushBatchRequestsAsync(System.IProgress<bool>, System.Threading.CancellationToken)
iceI_ice_flushBatchRequests(Ice.Internal.OutgoingAsyncCompletionCallback, bool)
ice_scheduler()
iceWrite(Ice.OutputStream)
iceReference()
iceCheckTwowayOnly(string)
iceCheckAsyncTwowayOnly(string)
iceGetRequestHandlerCache()
.ctor(Ice.ObjectPrx)
getOutgoingAsync<T>(Ice.Internal.OutgoingAsyncCompletionCallback)
.ctor(Ice.ObjectPrxHelperBase, Ice.Internal.OutgoingAsyncCompletionCallback, Ice.OutputStream, Ice.InputStream)
invoke(string, Ice.OperationMode, byte[], System.Collections.Generic.Dictionary<string, string>, bool)
getResult(bool)
.ctor(System.IProgress<bool>, System.Threading.CancellationToken)
handleInvokeSent(bool, bool, bool, Ice.Internal.OutgoingAsyncBase)
handleInvokeResponse(bool, Ice.Internal.OutgoingAsyncBase)
getInvokeOutgoingAsync(Ice.Internal.OutgoingAsyncCompletionCallback)
cacheMessageBuffers(Ice.InputStream, Ice.OutputStream)
.ctor(Ice.Internal.Reference)