Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Objects.Libs.Rpc.RpcCodecAttribute Class Reference

An attribute to decorate a class, method, or entire assembly, to provide a custom binary codec provider (encoder and decoder) for type(s) used in RPC More...

Inheritance diagram for pluginbase.Objects.Libs.Rpc.RpcCodecAttribute:

Public Member Functions

 RpcCodecAttribute (Type codecType)
 Initializes a new instance of the pluginbase.Objects.Libs.Rpc.RpcCodecAttribute class. More...
 

Public Attributes

readonly Type CodecType
 The type of the codec More...
 

Properties

IBinaryCodec Codec [get]
 The instance of the codec More...
 

Detailed Description

An attribute to decorate a class, method, or entire assembly, to provide a custom binary codec provider (encoder and decoder) for type(s) used in RPC

Attribute: AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Assembly, AllowMultiple = true, Inherited = true)

Constructor & Destructor Documentation

pluginbase.Objects.Libs.Rpc.RpcCodecAttribute.RpcCodecAttribute ( Type  codecType)

Initializes a new instance of the pluginbase.Objects.Libs.Rpc.RpcCodecAttribute class.

Parameters
codecTypeType of the class providing the codecs. Must implement IBinaryCodec
36  {
37  CodecType = codecType;
38 
39  if (!typeof(IBinaryCodec).IsAssignableFrom(codecType))
40  {
41  throw new TypeAccessException("Expected codec to be of type IRpcCodec");
42  }
43 
44  _codec = (IBinaryCodec)Activator.CreateInstance(codecType);
45  }
readonly Type CodecType
The type of the codec
Definition: RpcCodecAttribute.cs:18
Defines an interface to get a codec for a type
Definition: IBinaryCodec.cs:9

Member Data Documentation

readonly Type pluginbase.Objects.Libs.Rpc.RpcCodecAttribute.CodecType

The type of the codec

Property Documentation

IBinaryCodec pluginbase.Objects.Libs.Rpc.RpcCodecAttribute.Codec
get

The instance of the codec

The codec.


The documentation for this class was generated from the following file: