Class GrainReference
This is the base class for all typed grain references.
Inheritance
Namespace: Orleans.Runtime
Assembly: Orleans.Core.Abstractions.dll
Syntax
public class GrainReference : object, IAddressable, IEquatable<GrainReference>, ISerializable
Constructors
| Improve this Doc View SourceGrainReference(GrainReference)
Constructs a copy of a grain reference.
Declaration
protected GrainReference(GrainReference other)
Parameters
Type | Name | Description |
---|---|---|
GrainReference | other | The reference to copy. |
GrainReference(GrainReference, InvokeMethodOptions)
Declaration
protected GrainReference(GrainReference other, InvokeMethodOptions invokeMethodOptions)
Parameters
Type | Name | Description |
---|---|---|
GrainReference | other | |
InvokeMethodOptions | invokeMethodOptions |
GrainReference(SerializationInfo, StreamingContext)
Declaration
protected GrainReference(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
Fields
| Improve this Doc View SourceSystemTargetSilo
Called from generated code.
Declaration
protected readonly SiloAddress SystemTargetSilo
Field Value
Type | Description |
---|---|
SiloAddress |
Properties
| Improve this Doc View SourceInterfaceId
Implemented by generated subclasses to return a constant Implemented in generated code.
Declaration
public virtual int InterfaceId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
InterfaceName
Return the name of the interface for this GrainReference. Implemented in Orleans generated code.
Declaration
public virtual string InterfaceName { get; }
Property Value
Type | Description |
---|---|
System.String |
InterfaceVersion
Implemented in generated code.
Declaration
public virtual ushort InterfaceVersion { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
IsInitializedSystemTarget
Whether the runtime environment for system targets has been initialized yet. Called from generated code.
Declaration
protected bool IsInitializedSystemTarget { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceEquals(GrainReference)
Declaration
public bool Equals(GrainReference other)
Parameters
Type | Name | Description |
---|---|---|
GrainReference | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Tests this reference for equality to another object. Two grain references are equal if they both refer to the same grain.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to test for equality against this reference. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode()
Calculates a hash code for a grain reference.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
GetMethodName(Int32, Int32)
Return the method name associated with the specified interfaceId and methodId values.
Declaration
public virtual string GetMethodName(int interfaceId, int methodId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | interfaceId | Interface Id |
System.Int32 | methodId | Method Id |
Returns
Type | Description |
---|---|
System.String | Method name string. |
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
GetUniformHashCode()
Get a uniform hash code for this grain reference.
Declaration
public uint GetUniformHashCode()
Returns
Type | Description |
---|---|
System.UInt32 |
InvokeMethodAsync<T>(Int32, Object[], InvokeMethodOptions, SiloAddress)
Called from generated code.
Declaration
protected Task<T> InvokeMethodAsync<T>(int methodId, object[] arguments, InvokeMethodOptions options = default (InvokeMethodOptions), SiloAddress silo = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | methodId | |
System.Object[] | arguments | |
InvokeMethodOptions | options | |
SiloAddress | silo |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
InvokeOneWayMethod(Int32, Object[], InvokeMethodOptions, SiloAddress)
Called from generated code.
Declaration
protected void InvokeOneWayMethod(int methodId, object[] arguments, InvokeMethodOptions options = default (InvokeMethodOptions), SiloAddress silo = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | methodId | |
System.Object[] | arguments | |
InvokeMethodOptions | options | |
SiloAddress | silo |
IsCompatible(Int32)
Implemented in generated code.
Declaration
public virtual bool IsCompatible(int interfaceId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | interfaceId |
Returns
Type | Description |
---|---|
System.Boolean |
ToKeyString()
Get the key value for this grain, as a string.
Declaration
public string ToKeyString()
Returns
Type | Description |
---|---|
System.String |
ToString()
Returns a string representation of this reference.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Operators
| Improve this Doc View SourceEquality(GrainReference, GrainReference)
Compares two references for equality. Two grain references are equal if they both refer to the same grain.
Declaration
public static bool operator ==(GrainReference reference1, GrainReference reference2)
Parameters
Type | Name | Description |
---|---|---|
GrainReference | reference1 | First grain reference to compare. |
GrainReference | reference2 | Second grain reference to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Inequality(GrainReference, GrainReference)
Compares two references for inequality. Two grain references are equal if they both refer to the same grain.
Declaration
public static bool operator !=(GrainReference reference1, GrainReference reference2)
Parameters
Type | Name | Description |
---|---|---|
GrainReference | reference1 | First grain reference to compare. |
GrainReference | reference2 | Second grain reference to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|