AElf.CSharp.Core¶
Contents¶
- Builder
- EncodingHelper
- IMethod
- Marshaller
- Marshallers
- MethodType
- Method
- Preconditions
- SafeMath
- ServerServiceDefinition
- ServiceBinderBase
- TimestampExtensions
- UnaryServerMethod
Builder type
¶
Namespace¶
AElf.CSharp.Core.ServerServiceDefinition
Summary¶
Builder class for ServerServiceDefinition.
ctor() constructor
¶
Summary¶
Creates a new instance of builder.
Parameters¶
This constructor has no parameters.
AddMethod``2(method,handler) method
¶
Summary¶
Adds a definition for a single request - single response method.
Returns¶
This builder instance.
Parameters¶
Name | Type | Description |
---|---|---|
method | AElf.CSharp.Core.Method | The method. |
handler | AElf.CSharp.Core.UnaryServerMethod | The method handler. |
Generic Types¶
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
Build() method
¶
Summary¶
Creates an immutable ServerServiceDefinition
from this builder.
Returns¶
The ServerServiceDefinition
object.
Parameters¶
This method has no parameters.
EncodingHelper type
¶
Namespace¶
AElf.CSharp.Core.Utils
Summary¶
Helper class for serializing strings.
EncodeUtf8(str) method
¶
Summary¶
Serializes a UTF-8 string to a byte array.
Returns¶
the serialized string.
Parameters¶
Name | Type | Description |
---|---|---|
str | System.String |
FullName property
¶
Summary¶
Gets the fully qualified name of the method. On the server side, methods are dispatched based on this name.
Marshaller type
¶
Namespace¶
AElf.CSharp.Core
Summary¶
Encapsulates the logic for serializing and deserializing messages.
ctor(serializer,deserializer) constructor
¶
Summary¶
Initializes a new marshaller from simple serialize/deserialize functions.
Parameters¶
Name | Type | Description |
---|---|---|
serializer | System.Func | Function that will be used to deserialize messages. |
StringMarshaller property
¶
Summary¶
Returns a marshaller for string
type. This is useful for testing.
Create() method
¶
Summary¶
Creates a marshaller from specified serializer and deserializer.
Parameters¶
This method has no parameters.
Method type
¶
Namespace¶
AElf.CSharp.Core
Summary¶
A description of a remote method.
Generic Types¶
Name | Description |
---|---|
TRequest | Request message type for this method. |
TResponse | Response message type for this method. |
ctor(type,serviceName,name,requestMarshaller,responseMarshaller) constructor
¶
Summary¶
Initializes a new instance of the Method
class.
Parameters¶
Name | Type | Description |
---|---|---|
type | AElf.CSharp.Core.Method | Type of method. |
serviceName | System.String | Name of service this method belongs to. |
name | System.String | Unqualified name of the method. |
request Marshaller | AElf.CSharp.Core.Marshaller | Marshaller used for request messages. |
response Marshaller | AElf.CSharp.Core.Marshaller | Marshaller used for response messages. |
FullName property
¶
Summary¶
Gets the fully qualified name of the method. On the server side, methods are dispatched based on this name.
GetFullName() method
¶
Summary¶
Gets full name of the method including the service name.
Parameters¶
This method has no parameters.
CheckNotNull(reference) method
¶
Summary¶
Throws ArgumentNullException if reference is null.
Parameters¶
Name | Type | Description |
---|---|---|
reference | The reference. |
CheckNotNull(reference,paramName) method
¶
Summary¶
Throws ArgumentNullException if reference is null.
Parameters¶
Name | Type | Description |
---|---|---|
reference | The reference. | |
paramName | System.String | The parameter name. |
SafeMath type
¶
Namespace¶
AElf.CSharp.Core
Summary¶
Helper methods for safe math operations that explicitly check for overflow.
ServerServiceDefinition type
¶
Namespace¶
AElf.CSharp.Core
Summary¶
Stores mapping of methods to server call handlers. Normally, the
ServerServiceDefinition
objects will be created by the
BindService
factory method that is part of the autogenerated code
for a protocol buffers service definition.
BindService() method
¶
Summary¶
Forwards all the previously stored AddMethod
calls to the service
binder.
Parameters¶
This method has no parameters.
CreateBuilder() method
¶
Summary¶
Creates a new builder object for ServerServiceDefinition
.
Returns¶
The builder object.
Parameters¶
This method has no parameters.
ServiceBinderBase type
¶
Namespace¶
AElf.CSharp.Core
Summary¶
Allows binding server-side method implementations in alternative serving
stacks. Instances of this class are usually populated by the
BindService
method that is part of the autogenerated code for a
protocol buffers service definition.
AddMethod(method,handler) method
¶
Summary¶
Adds a definition for a single request - single response method.
Parameters¶
Name | Type | Description |
---|---|---|
method | AElf.CSharp.Core.Method | The method. |
handler | AElf.CSharp.Core.UnaryServerMethod | The method handler. |
Generic Types¶
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
TimestampExtensions type
¶
Namespace¶
AElf.CSharp.Core.Extension
Summary¶
Helper methods for dealing with protobuf timestamps.
AddDays(timestamp,days) method
¶
Summary¶
Adds a given amount of days to a timestamp. Returns a new instance.
Returns¶
a new timestamp instance.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp | Google.Protobuf.WellKnown Types.Timestamp | the timestamp. |
days | System. Int64 | the amount of days. |
AddHours(timestamp,hours) method
¶
Summary¶
Adds a given amount of hours to a timestamp. Returns a new instance.
Returns¶
a new timestamp instance.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp | Google.Protobuf .WellKnownTypes.Timestamp | the timestamp. |
hours | System.Int64 | the amount of hours. |
AddMilliseconds(timestamp,milliseconds) method
¶
Summary¶
Adds a given amount of milliseconds to a timestamp. Returns a new instance.
Returns¶
a new timestamp instance.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp | Google.Protobuf. WellKnownTypes.Timestamp | the timestamp. |
milliseconds | System. Int64 | the amount of milliseconds to add. |
AddMinutes(timestamp,minutes) method
¶
Summary¶
Adds a given amount of minutes to a timestamp. Returns a new instance.
Returns¶
a new timestamp instance.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp | Google.Protobuf .WellKnownTypes.Timestamp | the timestamp. |
minutes | System.Int64 | the amount of minutes. |
AddSeconds(timestamp,seconds) method
¶
Summary¶
Adds a given amount of seconds to a timestamp. Returns a new instance.
Returns¶
a new timestamp instance.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp | Google.Protobuf .WellKnownTypes.Timestam | the timestamp. |
seconds | System.Int64 | the amount of seconds. |
Max(timestamp1,timestamp2) method
¶
Summary¶
Compares two timestamps and returns the greater one.
Returns¶
the greater timestamp.
Parameters¶
Name | Type | Description |
---|---|---|
timestamp1 | Google.Protobuf .WellKnownTypes.Timestamp | the first timestamp |
timestamp2 | Google.Protobuf .WellKnownTypes.Timestamp | the second timestamp |