2020-03-21 13:27:46 +01:00
using System ;
namespace Capnp.Rpc
2019-06-12 21:56:55 +02:00
{
/// <summary>
/// Base class for a low-level capability at consumer side. It is created by the <see cref="RpcEngine"/>. An application does not directly interact with it
/// (which is intentionally impossible, since the invocation method is internal), but instead uses a <see cref="Proxy"/>-derived wrapper.
/// </summary>
public abstract class ConsumedCapability
{
2019-11-06 18:48:25 +01:00
internal abstract IPromisedAnswer DoCall ( ulong interfaceId , ushort methodId , DynamicSerializerState args ) ;
2019-06-12 21:56:55 +02:00
/// <summary>
/// Request the RPC engine to release this capability from its import table,
/// which usually also means to remove it from the remote peer's export table.
/// </summary>
protected abstract void ReleaseRemotely ( ) ;
2020-03-21 13:27:46 +01:00
internal abstract Action ? Export ( IRpcEndpoint endpoint , CapDescriptor . WRITER writer ) ;
2020-01-11 17:21:31 +01:00
internal abstract void Freeze ( out IRpcEndpoint ? boundEndpoint ) ;
2019-06-12 21:56:55 +02:00
internal abstract void Unfreeze ( ) ;
internal abstract void AddRef ( ) ;
2019-12-30 18:47:33 +01:00
internal abstract void Release (
2020-03-10 21:55:34 +01:00
bool keepAlive ,
2019-12-30 18:47:33 +01:00
[System.Runtime.CompilerServices.CallerMemberName] string methodName = "" ,
[System.Runtime.CompilerServices.CallerFilePath] string filePath = "" ,
[System.Runtime.CompilerServices.CallerLineNumber] int lineNumber = 0 ) ;
2020-03-22 00:12:50 +01:00
#if DebugFinalizers
internal Proxy ? OwningProxy { get ; set ; }
internal ConsumedCapability ? ResolvingCap { get ; set ; }
#endif
2019-06-12 21:56:55 +02:00
}
2020-01-11 17:56:12 +01:00
}